cuda.bindings._v2.driver.gl_get_devices_v2#

cuda.bindings._v2.driver.gl_get_devices_v2(int device_list)#

Gets the CUDA devices associated with the current OpenGL context.

Returns the CUDA-compatible devices for the current OpenGL context. If any of the GPUs used by the current OpenGL context are not CUDA-capable, CUDA_ERROR_NO_DEVICE is returned.

The device_list argument may be one of CU_GL_DEVICE_LIST_ALL (all devices used by the context), CU_GL_DEVICE_LIST_CURRENT_FRAME (devices rendering the current frame), or CU_GL_DEVICE_LIST_NEXT_FRAME (devices predicted to render the next frame, SLI only).

Note

This function is not supported on macOS.

Uses a fixed 64-element buffer; returns only the devices actually present.

Parameters:

device_list (int) – The set of devices to return (one of CU_GL_DEVICE_LIST_ALL, CU_GL_DEVICE_LIST_CURRENT_FRAME or CU_GL_DEVICE_LIST_NEXT_FRAME).

Returns:

numpy int32 array of the CUDA device ordinals associated with

the current OpenGL context.

Return type:

object

See also

cuGLGetDevices