See e.g.
Here’s how I compiled and tested Julia CUDA libraries in our cluster:
mkdir bin; cd bin
curl -o julia-1.3.0-linux-x86_64.tar.gz https://julialang-s3.julialang.org/bin/linux/x64/1.3/julia-1.3.0-linux-x86_64.tar.gz
tar xzvf julia-1.3.0-linux-x86_64.tar.gz
module add CUDA
ln -s julia-1.3.0 julia
julia/bin/julia
]
pkg> add CUDAapi CUDAdrv CUDAnative CuArrays BenchmarkTools DiffResults ForwardDiff Compat
cat > buildcuarrays.jl
using Pkg
Pkg.test("CuArrays")
srun -p gpu --mem=50G --time=5:00:00 bash -c 'pwd;echo $SLURMD_NODENAME;~/bin/julia-1.3.0/bin/julia ~/bin/testcuarrays.jl'