diff --git a/nvitop/select.py b/nvitop/select.py index 295a4bd..51fafd4 100644 --- a/nvitop/select.py +++ b/nvitop/select.py @@ -209,6 +209,7 @@ def select_devices( (not math.isnan(device.memory_used), -device.memory_used), # descending (not math.isnan(device.gpu_utilization), device.gpu_utilization), # ascending (not math.isnan(device.memory_utilization), device.memory_utilization), # ascending + -device.physical_index, # descending to keep free ), ) # type: List[DeviceSnapshot]