Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
009439ca
Unverified
Commit
009439ca
authored
Feb 12, 2025
by
Lu Fang
Committed by
GitHub
Feb 13, 2025
Browse files
Simplify logic of locating CUDART so file path (#13203)
Signed-off-by:
Lu Fang
<
lufang@fb.com
>
parent
bc55d130
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
25 deletions
+1
-25
vllm/distributed/device_communicators/cuda_wrapper.py
vllm/distributed/device_communicators/cuda_wrapper.py
+1
-25
No files found.
vllm/distributed/device_communicators/cuda_wrapper.py
View file @
009439ca
...
...
@@ -5,7 +5,6 @@ convenient for use when we just need to call a few functions.
"""
import
ctypes
import
glob
from
dataclasses
import
dataclass
from
typing
import
Any
,
Dict
,
List
,
Optional
...
...
@@ -62,29 +61,6 @@ def find_loaded_library(lib_name) -> Optional[str]:
return
path
def
get_cudart_lib_path_from_env
()
->
Optional
[
str
]:
"""
In some system, find_loaded_library() may not work. So we allow users to
specify the path through environment variable VLLM_CUDART_SO_PATH.
"""
cudart_so_env
=
envs
.
VLLM_CUDART_SO_PATH
if
cudart_so_env
is
not
None
:
cudart_paths
=
[
cudart_so_env
,
]
for
path
in
cudart_paths
:
file_paths
=
glob
.
glob
(
path
)
if
len
(
file_paths
)
>
0
:
logger
.
info
(
"Found cudart library at %s through env var"
"VLLM_CUDART_SO_PATH=%s"
,
file_paths
[
0
],
cudart_so_env
,
)
return
file_paths
[
0
]
return
None
class
CudaRTLibrary
:
exported_functions
=
[
# cudaError_t cudaSetDevice ( int device )
...
...
@@ -131,7 +107,7 @@ class CudaRTLibrary:
if
so_file
is
None
:
so_file
=
find_loaded_library
(
"libcudart"
)
if
so_file
is
None
:
so_file
=
get_cudart_lib_path_from_env
()
so_file
=
envs
.
VLLM_CUDART_SO_PATH
# fallback to env var
assert
so_file
is
not
None
,
\
(
"libcudart is not loaded in the current process, "
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment