omlins / ParallelStencil.jl

Package for writing high-level code for parallel high-performance stencil computations that can be deployed on both GPUs and CPUs
BSD 3-Clause "New" or "Revised" License
312 stars 31 forks source link

remove the CUDA.functional() error #17

Closed luraess closed 3 years ago

luraess commented 3 years ago

The @assert CUDA.functional(true) currently returns an error if ParallelStencil is initialised with the CUDA GPU backend on a machine that does not have libcuda (no GPU available). This is problematic if ParallelStencil is used within another module and recompilation is triggered for various backends. This PR suggest to remove the @assert CUDA.functional(true) check. ParallelStencil can thus be initialised with the CUDA backend even if no CUDA install is available on the machine. The resulting code will fail during early runtime when CUDA.jl will try to locate libcuda producing a sufficient verbose error message:

┌ Error: Error during initialization of CUDA.jl
│   exception =
│    could not load library "libcuda"
│    dlopen(libcuda.dylib, 1): image not found
│    Stacktrace:
[...]