File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,16 +26,15 @@ def __init__(
2626 """Create object to control device using NVML."""
2727 pynvml .nvmlInit ()
2828
29- if sum (x is not None for x in [device_id , device_uuid , device_pci ]) != 1 :
29+ if sum (x is not None for x in [device_id , device_uuid , device_pci_bus ]) != 1 :
3030 raise ValueError ("invalid device: specify either the index, the UUID, or the PCI-bus" )
31- elif device_id :
31+ elif device_id is not None :
3232 self .dev = pynvml .nvmlDeviceGetHandleByIndex (device_id )
33- elif device_uuid :
33+ elif device_uuid is not None :
3434 self .dev = pynvml .nvmlDeviceGetHandleByUUID (device_uuid )
35- elif device_pci_bus :
35+ elif device_pci_bus is not None :
3636 self .dev = pynvml .nvmlDeviceGetHandleByPciBusId_v2 (device_pci_bus )
3737
38-
3938 self .id = pynvml .nvmlDeviceGetIndex (self .dev )
4039 self .nvidia_smi = nvidia_smi_fallback or "nvidia-smi"
4140
You can’t perform that action at this time.
0 commit comments