@tduncan / Nvidia-Optimization-Stack-VLLM Mirror · read-only / commits / ed6f002d33
Fork 0

A high-throughput and memory-efficient inference and serving engine for LLMs

Mirrored from https://github.com/tduncan-lum/Nvidia-Optimization-Stack---VLLM.git

Synced Nov 16, 18:15 UTC

[cuda][misc] error on empty CUDA_VISIBLE_DEVICES (#7924)

youkaichao committed Aug 27, 2024 at 12:06 UTC ed6f002d3340888142cb67c13a37c060b51fa889
1 file changed +3
vllm/platforms/cuda.py
+3
@@ -84,6 +84,9 @@ except ModuleNotFoundError:
84 def device_id_to_physical_device_id(device_id: int) -> int:
85 if "CUDA_VISIBLE_DEVICES" in os.environ:
86 device_ids = os.environ["CUDA_VISIBLE_DEVICES"].split(",")
87 + if device_ids == [""]:
88 + raise RuntimeError("CUDA_VISIBLE_DEVICES is set to empty string,"
89 + " which means GPU support is disabled.")
90 physical_device_id = device_ids[device_id]
91 return int(physical_device_id)
92 else: