Skip to content

Commit df11dd1

Browse files
Tweak docs about disabling CUDA devices
1 parent 8418a3c commit df11dd1

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/src/gpu.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,14 @@ julia> x |> cpu
9090

9191
Sometimes it is required to control which GPUs are visible to `julia` on a system with multiple GPUs or disable GPUs entirely. This can be achieved with an environment variable `CUDA_VISIBLE_DEVICES`.
9292

93+
To disable all devices:
94+
```
95+
$ export CUDA_VISIBLE_DEVICES='-1'
96+
```
97+
To select specific devices by device id:
9398
```
94-
$ export CUDA_VISIBLE_DEVICES=''
95-
96-
# or
97-
9899
$ export CUDA_VISIBLE_DEVICES='0,1'
99100
```
100101

101-
The environment variable `CUDA_VISIBLE_DEVICES` can also take a comma separated list of device IDs (`0,1,...`) which would be visible to CUDA related processes.
102102

103103
More information for conditional use of GPUs in CUDA.jl can be found in its [documentation](https://cuda.juliagpu.org/stable/installation/conditional/#Conditional-use), and information about the specific use of the variable is described in the [Nvidia CUDA blogpost](https://developer.nvidia.com/blog/cuda-pro-tip-control-gpu-visibility-cuda_visible_devices/).

0 commit comments

Comments
 (0)