You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/gpu.md
+16Lines changed: 16 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -85,3 +85,19 @@ julia> x |> cpu
85
85
⋮
86
86
0.192538
87
87
```
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