cuda.bindings.nvml.device_remove_gpu_v2#

cuda.bindings.nvml.device_remove_gpu_v2(intptr_t pci_info, int gpu_state, int link_state)#

This method will remove the specified GPU from the view of both NVML and the NVIDIA kernel driver as long as no other processes are attached. If other processes are attached, this call will return NVML_ERROR_IN_USE and the GPU will be returned to its original “draining” state. Note: the only situation where a process can still be attached after device_modify_drain_state() is called to initiate the draining state is if that process was using, and is still using, a GPU before the call was made. Also note, persistence mode counts as an attachment to the GPU thus it must be disabled prior to this call.

Parameters:
  • pci_info (intptr_t) – The PCI address of the GPU to be removed.

  • gpu_state (DetachGpuState) – Whether the GPU is to be removed, from the OS see nvmlDetachGpuState_t.

  • link_state (PcieLinkState) – Requested upstream PCIe link state, see nvmlPcieLinkState_t.

See also

nvmlDeviceRemoveGpu_v2