Skip to content

Commit 0225f42

Browse files
committed
Fix wrong variable name in nvml
1 parent 0d5e9d8 commit 0225f42

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

kernel_tuner/observers/nvml.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)