File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 1
1
# SPDX-License-Identifier: Apache-2.0
2
2
# SPDX-FileCopyrightText: Copyright contributors to the vLLM project
3
3
4
+ import os
4
5
import types
5
6
from importlib .util import find_spec
6
7
23
24
x .driver for x in backends .values ()
24
25
if x .driver and x .driver .is_active ()
25
26
]
26
- if len (active_drivers ) != 1 :
27
+
28
+ # Check if we're in a distributed environment where CUDA_VISIBLE_DEVICES
29
+ # might be temporarily empty (e.g., Ray sets it to "" during actor init)
30
+ cuda_visible_devices = os .environ .get ("CUDA_VISIBLE_DEVICES" )
31
+ is_distributed_env = (cuda_visible_devices is not None
32
+ and len (cuda_visible_devices .strip ()) == 0 )
33
+
34
+ # Apply lenient driver check for distributed environments
35
+ if is_distributed_env and len (active_drivers ) == 0 :
36
+ # Allow 0 drivers in distributed environments - they may become
37
+ # active later when CUDA context is properly initialized
38
+ logger .debug (
39
+ "Triton found 0 active drivers in distributed environment. "
40
+ "This is expected during initialization." )
41
+ elif not is_distributed_env and len (active_drivers ) != 1 :
42
+ # Strict check for non-distributed environments
27
43
logger .info (
28
44
"Triton is installed but %d active driver(s) found "
29
45
"(expected 1). Disabling Triton to prevent runtime errors." ,
You can’t perform that action at this time.
0 commit comments