mirror of
https://github.com/scorpion-26/gBar.git
synced 2024-11-22 11:12:49 +00:00
Disable Nvidia on nvml init failure
https://github.com/scorpion-26/gBar/issues/39
This commit is contained in:
parent
49dbf074be
commit
ff22c08f01
1 changed files with 6 additions and 1 deletions
|
@ -28,7 +28,12 @@ namespace NvidiaGPU
|
||||||
typedef int (*PFN_nvmlInit)();
|
typedef int (*PFN_nvmlInit)();
|
||||||
auto nvmlInit = (PFN_nvmlInit)dlsym(nvmldl, "nvmlInit");
|
auto nvmlInit = (PFN_nvmlInit)dlsym(nvmldl, "nvmlInit");
|
||||||
int res = nvmlInit();
|
int res = nvmlInit();
|
||||||
ASSERT(res == 0, "Failed initializing nvml (Error: " << res << ")!");
|
if (res != 0)
|
||||||
|
{
|
||||||
|
LOG("Failed initializing nvml (Error: " << res << "), disabling Nvidia GPU");
|
||||||
|
RuntimeConfig::Get().hasNvidia = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Get GPU handle
|
// Get GPU handle
|
||||||
typedef int (*PFN_nvmlDeviceGetHandle)(uint32_t, void**);
|
typedef int (*PFN_nvmlDeviceGetHandle)(uint32_t, void**);
|
||||||
|
|
Loading…
Reference in a new issue