Skip to content

Commit 26649a4

Browse files
document disabling GPUs
1 parent 79dbbd6 commit 26649a4

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

docs/src/gpu.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,19 @@ julia> x |> cpu
8585
8686
0.192538
8787
```
88+
89+
## Disable CUDA (or choose which GPUs are visible to Flux)
90+
91+
Sometimes we need 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`.
92+
93+
```
94+
$ export CUDA_VISIBLE_DEVICES=''
95+
96+
# or
97+
98+
$ export CUDA_VISIBLE_DEVICES='0,1'
99+
```
100+
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.
102+
103+
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)