@@ -34,7 +34,7 @@ if do_help
34
34
--list List all available tests.
35
35
--quickfail Fail the entire run as soon as a single test errored.
36
36
--jobs=N Launch `N` processes to perform tests (default: Sys.CPU_THREADS).
37
- --gpu=1,2, ... Which GPUs to use (comma -separated list of indices, default: all )
37
+ --gpu=0,1, ... Comma -separated list of GPUs to use ( default: 0 )
38
38
--sanitize[=tool] Run the tests under `compute-sanitizer`.
39
39
40
40
Remaining arguments filter the tests that will be executed.""" )
@@ -145,10 +145,11 @@ gpus = if do_gpu_list
145
145
gpu_entry (CuDevice (id))
146
146
end
147
147
else
148
- # find all GPUs
149
- map (gpu_entry, devices ())
148
+ # pick the first non-exclusive GPU
149
+ entries = map (gpu_entry, devices ())
150
+ filter! (entry-> entry. compute_mode != CUDA. CU_COMPUTEMODE_PROHIBITED, entries)
151
+ first (entries, 1 )
150
152
end
151
- filter! (gpu-> gpu. compute_mode != CUDA. CU_COMPUTEMODE_PROHIBITED, gpus)
152
153
@info (" Testing using device " * join (map (gpu-> " $(gpu. id) ($(gpu. name) )" , gpus), " , " , " and " ) *
153
154
" . To change this, specify the `--gpus` argument to the tests, or set the `CUDA_VISIBLE_DEVICES` environment variable." )
154
155
ENV [" CUDA_VISIBLE_DEVICES" ] = join (map (gpu-> gpu. uuid, gpus), " ," )
0 commit comments