[Win32] Check adl and nvapi if either works

This commit is contained in:
FlightlessMango 2020-07-11 03:21:58 +02:00
parent 8bc64efa25
commit 2273cd30a4
4 changed files with 12 additions and 2 deletions

View File

@ -192,6 +192,7 @@ int initializeADL()
// Get the AdapterInfo structure for all adapters in the system // Get the AdapterInfo structure for all adapters in the system
ADL_Adapter_AdapterInfo_Get(lpAdapterInfo, sizeof(AdapterInfo)* iNumberAdapters); ADL_Adapter_AdapterInfo_Get(lpAdapterInfo, sizeof(AdapterInfo)* iNumberAdapters);
} }
printf("num adapters: %i", iNumberAdapters);
return TRUE; return TRUE;
} }

View File

@ -29,11 +29,12 @@ struct gpuInfo{
}; };
extern struct gpuInfo gpu_info; extern struct gpuInfo gpu_info;
extern bool init_adl;
// Nvidia linux // Nvidia linux
void getNvidiaGpuInfo(void); void getNvidiaGpuInfo(void);
void getAmdGpuInfo(void); void getAmdGpuInfo(void);
// Amd windows // Amd windows
int query_adl(void); int query_adl(void);
uint32_t adl_vendorid(void); uint32_t adl_vendorid(void);
int initializeADL(void);

View File

@ -6,6 +6,7 @@ extern nvmlDevice_t nvidiaDevice;
extern struct nvmlUtilization_st nvidiaUtilization; extern struct nvmlUtilization_st nvidiaUtilization;
extern struct nvmlMemory_st nvidiaMemory; extern struct nvmlMemory_st nvidiaMemory;
extern bool nvmlSuccess; extern bool nvmlSuccess;
extern bool init_nvapi_bool;
bool checkNVML(const char* pciBusId); bool checkNVML(const char* pciBusId);
bool checkNVAPI(void); bool checkNVAPI(void);

View File

@ -808,6 +808,13 @@ void init_gpu_stats(uint32_t& vendorID, overlay_params& params)
// NVIDIA or Intel but maybe has Optimus // NVIDIA or Intel but maybe has Optimus
#ifdef _WIN32 #ifdef _WIN32
bool nvSuccess = (checkNVML(nullptr) && getNVMLInfo()); bool nvSuccess = (checkNVML(nullptr) && getNVMLInfo());
init_adl = initializeADL();
init_nvapi_bool = checkNVAPI();
if(init_adl)
vendorID == 0x1002;
if(init_nvapi_bool)
vendorID == 0x10de;
printf("amd : %i", init_adl);
#endif #endif
#ifdef __gnu_linux__ #ifdef __gnu_linux__