Syllo / nvtop

GPU & Accelerator process monitoring for AMD, Apple, Huawei, Intel, NVIDIA and Qualcomm
Other
7.95k stars 291 forks source link

Fix: improve backward compatibility for old drivers (fixes #107) #108

Closed XuehaiPan closed 3 years ago

XuehaiPan commented 3 years ago

On old drivers, nvmlProcessInfo_t does not have gpuInstanceId and computeInstanceId fields. The function pointer check uses the legacy version of nvmlDeviceGetGraphicsRunningProcesses and nvmlDeviceGetComputeRunningProcesses (without _v2 suffixes), but the definition of struct nvmlProcessInfo_t is the v2 version. This causes inconsistency of the NVML APIs.

As nvtop never shows the GI ID and CI ID, it's OK to always using the legacy version of NVML APIs. (fixes #107)