Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
text-generation-inference
Commits
49a6c8c1
Commit
49a6c8c1
authored
May 30, 2023
by
OlivierDehaene
Browse files
fix(launcher): parse num cuda devices from CUDA_VISIBLE_DEVICES and NVIDIA_VISIBLE_DEVICES
parent
146e72c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
launcher/src/main.rs
launcher/src/main.rs
+4
-3
No files found.
launcher/src/main.rs
View file @
49a6c8c1
...
...
@@ -455,9 +455,10 @@ fn shutdown_shards(shutdown: Arc<Mutex<bool>>, shutdown_receiver: &mpsc::Receive
}
fn
num_cuda_devices
()
->
Option
<
usize
>
{
let
devices
=
env
::
var
(
"CUDA_VISIBLE_DEVICES"
)
.map_err
(|
_
|
env
::
var
(
"NVIDIA_VISIBLE_DEVICES"
))
.ok
()
?
;
let
devices
=
match
env
::
var
(
"CUDA_VISIBLE_DEVICES"
)
{
Ok
(
devices
)
=>
devices
,
Err
(
_
)
=>
env
::
var
(
"NVIDIA_VISIBLE_DEVICES"
)
.ok
()
?
,
};
let
n_devices
=
devices
.split
(
','
)
.count
();
Some
(
n_devices
)
}
...
...
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