cuda.bindings.nvml.device_get_count_v2#

cuda.bindings.nvml.device_get_count_v2() unsigned int#

Retrieves the number of compute devices in the system. A compute device is a single GPU.

For all products. Note: New nvmlDeviceGetCount_v2 (default in NVML 5.319) returns count of all devices in the system even if nvmlDeviceGetHandleByIndex_v2 returns NVML_ERROR_NO_PERMISSION for such device. Update your code to handle this error, or use NVML 4.304 or older nvml header file. For backward binary compatibility reasons _v1 version of the API is still present in the shared library. Old _v1 version of nvmlDeviceGetCount doesn’t count devices that NVML has no permission to talk to.

Returns:

Reference in which to return the number of

accessible devices.

Return type:

unsigned int

See also

nvmlDeviceGetCount_v2