NVAPI cannot enumerate GPU

Our machine has one NVidia Tesla T4 graphics card and one Quadro P2200 card. When we tried to use NVAPI to manage the cards, the APIs failed to enumerate the GPUs the following functions returned status NVAPI_NVIDIA_DEVICE_NOT_FOUND:

  • NvAPI_EnumPhysicalGPUs()
  • NvAPI_EnumNvidiaDisplayHandle()
    However, NvAPI_Initialize() returns a successful status.

By the way, the tool nvidia-smi can list all the two cards:

±----------------------------------------------------------------------------+
| NVIDIA-SMI 471.41 Driver Version: 471.41 CUDA Version: 11.4 |
|-------------------------------±---------------------±---------------------+
| GPU Name TCC/WDDM | Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
| | | MIG M. |
|===============================+======================+======================|
| 0 Tesla T4 TCC | 00000000:04:00.0 Off | 0 |
| N/A 58C P8 13W / 70W | 1MiB / 15205MiB | 0% Default |
| | | N/A |
±------------------------------±---------------------±---------------------+
| 1 Quadro P2200 TCC | 00000000:B3:00.0 Off | N/A |
| 68% 76C P0 65W / 75W | 453MiB / 5053MiB | 100% Default |
| | | N/A |
±------------------------------±---------------------±---------------------+

Dear @wanglei1355
Thank you for contacting NVIDIA developer forum.

The nvidia-smi log shared by you shows that the GPUs are in TCC (Tesla Compute Cluster) mode.
The documentation of API NvAPI_EnumPhysicalGPUs has the following information as well:

For GPU handles in TCC MODE please use NvAPI_EnumTCCPhysicalGPUs()

Note that not all APIs are supported for GPUs in TCC mode.

Additionally, look out for the tag //! TCC_SUPPORTED in nvapi.h file. The APIs that have this tag are guaranteed to be supported in TCC mode.

Thank you.
NVAPI Forum Moderator