Skip to content

Commit

Permalink
[cuda][misc] error on empty CUDA_VISIBLE_DEVICES (#7924)
Browse files Browse the repository at this point in the history
  • Loading branch information
youkaichao authored Aug 27, 2024
1 parent b09c755 commit ed6f002
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions vllm/platforms/cuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@ def warn_if_different_devices():
def device_id_to_physical_device_id(device_id: int) -> int:
if "CUDA_VISIBLE_DEVICES" in os.environ:
device_ids = os.environ["CUDA_VISIBLE_DEVICES"].split(",")
if device_ids == [""]:
raise RuntimeError("CUDA_VISIBLE_DEVICES is set to empty string,"
" which means GPU support is disabled.")
physical_device_id = device_ids[device_id]
return int(physical_device_id)
else:
Expand Down

0 comments on commit ed6f002

Please sign in to comment.