Skip to content

Commit

Permalink
Merge #1835 #1836
Browse files Browse the repository at this point in the history
1835: Document disabling GPUs r=DhairyaLGandhi a=DhairyaLGandhi

From the discussion in #1834

1836: Try using latest cu(DNN) binaries r=DhairyaLGandhi a=ToucheSir

Possible alternative to #1822.

Co-authored-by: Dhairya Gandhi <[email protected]>
Co-authored-by: Brian Chen <[email protected]>
  • Loading branch information
3 people authored Jan 15, 2022
3 parents 79dbbd6 + 8608107 + 6e3ca67 commit 9c789dc
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ steps:
agents:
queue: "juliagpu"
cuda: "*"
env:
JULIA_CUDA_USE_BINARYBUILDER: "true"
timeout_in_minutes: 60

# - label: "GPU nightly"
Expand Down
16 changes: 16 additions & 0 deletions docs/src/gpu.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,19 @@ julia> x |> cpu
0.192538
```

## Disabling CUDA or choosing which GPUs are visible to Flux

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`.

```
$ export CUDA_VISIBLE_DEVICES=''
# or
$ export CUDA_VISIBLE_DEVICES='0,1'
```

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.

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/).
6 changes: 1 addition & 5 deletions test/cuda/layers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,7 @@ function gpu_gradtest(name::String, layers::Vector, x_cpu = nothing, args...; te

# test
if test_cpu
if VERSION >= v"1.7" && layer === GroupedConvTranspose && args[end] == selu
@test_broken y_gpu y_cpu rtol=1f-3 atol=1f-3
else
@test y_gpu y_cpu rtol=1f-3 atol=1f-3
end
@test y_gpu y_cpu rtol=1f-3 atol=1f-3
if isnothing(xg_cpu)
@test isnothing(xg_gpu)
else
Expand Down

0 comments on commit 9c789dc

Please sign in to comment.