Skip to content

Do not install/load CUDA packages if no GPU is detected. #178

@ali-ramadhan

Description

@ali-ramadhan

This would be nice because most people might first install Oceananigans on their laptop without a GPU or CUDA toolkit, and are greeted with error messages that e.g. CUDAdrv failed to build.

While harmless errors, they don't look nice and make the package seem unstable. This would also speed up Travis CI and Appveyor builds.


Relevant bits from Pkg.instantiate():

┌ Error: Error building `CUDAdrv`: 
│ Could not find CUDA driver library.
└ @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Operations.jl:1075
┌ Error: Error building `CUDAnative`: 
│ Dependent package CUDAdrv.jl has not been built successfully.
│ 
│ This is not a fatal error, but GPU functionality will be unavailable.
│ If you expected this to work, please open a thread on
│ https://discourse.julialang.org/c/domain/gpu
└ @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Operations.jl:1075
┌ Error: Error building `CuArrays`: 
│ Dependent package CUDAdrv.jl has not been built successfully
└ @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Operations.jl:1075
┌ Error: Error building `CUDAdrv`: 
└ @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Operations.jl:1075
┌ Error: Error building `CUDAdrv`: 
└ @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Operations.jl:1075
  Building SpecialFunctions → `~/.julia/packages/SpecialFunctions/fvheQ/deps/build.log`
  Building LLVM ────────────→ `~/.julia/packages/LLVM/tg8MX/deps/build.log`
  Building CUDAnative ──────→ `~/.julia/packages/CUDAnative/B210M/deps/build.log`
Dependent package CUDAdrv.jl has not been built successfully.
This is not a fatal error, but GPU functionality will be unavailable.
If you expected this to work, please open a thread on
https://discourse.julialang.org/c/domain/gpu
┌ Error: Error building `CUDAnative`: 
└ @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Operations.jl:1075
┌ Error: Error building `CuArrays`: 
└ @ Pkg.Operations /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.1/Pkg/src/Operations.jl:1075
ERROR: LoadError: LoadError: UndefVarError: CUBLAS not defined
Stacktrace:
 [1] top-level scope at none:0 (repeats 2 times)
 [2] include at ./boot.jl:326 [inlined]
 [3] include_relative(::Module, ::String) at ./loading.jl:1038
 [4] include at ./sysimg.jl:29 [inlined]
 [5] include(::String) at /home/travis/.julia/packages/CuArrays/qZCAt/src/CuArrays.jl:3
 [6] top-level scope at none:0
 [7] include at ./boot.jl:326 [inlined]
 [8] include_relative(::Module, ::String) at ./loading.jl:1038
 [9] include(::Module, ::String) at ./sysimg.jl:29
 [10] top-level scope at none:2
 [11] eval at ./boot.jl:328 [inlined]
 [12] eval(::Expr) at ./client.jl:404
 [13] top-level scope at ./none:3

The cuBLAS error might be related to CuArrays: JuliaGPU/CuArrays.jl#255

Metadata

Metadata

Assignees

No one assigned

    Labels

    cleanup 🧹Paying off technical debttesting 🧪Tests get priority in case of emergency evacuation

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions