This commit is contained in:
OlivierDehaene 2023-03-08 10:51:17 +01:00
parent e4142e4fd5
commit 0d8b30d19a

View File

@ -115,7 +115,8 @@ fn main() -> ExitCode {
None => {
// try to default to the number of available GPUs
tracing::info!("Parsing num_shard from CUDA_VISIBLE_DEVICES");
let cuda_visible_devices = env::var("CUDA_VISIBLE_DEVICES").expect("--num-shard and CUDA_VISIBLE_DEVICES are not set");
let cuda_visible_devices = env::var("CUDA_VISIBLE_DEVICES")
.expect("--num-shard and CUDA_VISIBLE_DEVICES are not set");
let n_devices = cuda_visible_devices.split(",").count();
if n_devices <= 1 {
panic!("`sharded` is true but only found {n_devices} CUDA devices");