# Problem building CUDAnative

**URL:** <https://discourse.julialang.org/t/problem-building-cudanative/26540>\
**Category:** GPU\
**Created:** [July 19, 2019, 9:59am UTC](https://discourse.julialang.org/t/problem-building-cudanative/26540 "2019-07-19T09:59:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vargonis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vargonis/32/14614_2.png) [@vargonis](https://discourse.julialang.org/u/vargonis)\
**Post date:** [July 19, 2019, 9:59am UTC](https://discourse.julialang.org/t/problem-building-cudanative/26540/1 "2019-07-19T09:59:53Z")

</div>

Hi there. I’m trying to setup Julia to use CuArrays. I have Julia 1.0.4 and the cuda toolkit 10.1, on Pop!\_OS. I’m doing (on the REPL)

```julia
ENV["LD_LIBRARY_PATH"] = "/usr/lib/cuda/lib64"
ENV["CUDA_PATH"] = "/usr/lib/cuda"
using Pkg; Pkg.build("CuArrays")

```

which gives me

> Building CUDAdrv ───→ `~/.julia/packages/CUDAdrv/WVU1H/deps/build.log`  
> Building LLVM ──────→ `~/.julia/packages/LLVM/ViliQ/deps/build.log`  
> Building CUDAnative → `~/.julia/packages/CUDAnative/nItlk/deps/build.log`  
> ┌ Error: Error building `CUDAnative`:  
> │ Available CUDA toolchain does not provide libcudadevrt.  
> │  
> │ This is not a fatal error, but GPU functionality will be unavailable.  
> │ If you expected this to work, please open a thread on  
> │ [GPU - Julia Programming Language](https://discourse.julialang.org/c/domain/gpu)  
> └ @ Pkg.Operations \>/buildworker/worker/package\_linux32/build/usr/share/julia/stdlib/v1.0/Pkg/src/Operations.jl:1096  
> Building Conda ─────→ `~/.julia/packages/Conda/kLXeC/deps/build.log`  
> Building FFTW ──────→ `~/.julia/packages/FFTW/p7sLQ/deps/build.log`  
> Building CuArrays ──→ `~/.julia/packages/CuArrays/eFBar/deps/build.log`  
> ┌ Error: Error building `CuArrays`:  
> │ Could not find library ‘cublas’ (it should be part of the CUDA toolkit)  
> └ @ Pkg.Operations \>/buildworker/worker/package\_linux32/build/usr/share/julia/stdlib/v1.0/Pkg/src/Operations.jl:1096

The environment variables are correct, as far as I can tell. What should I do to get it to build?

---

<div class="post-metadata">

**Author:** ![maleadt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maleadt/32/10097_2.png) [@maleadt](https://discourse.julialang.org/u/maleadt)\
**Post date:** [July 26, 2019, 12:16am UTC](https://discourse.julialang.org/t/problem-building-cudanative/26540/2 "2019-07-26T00:16:42Z")

</div>

Sorry, missed this post. Do you actually have `libcudadevrt` and `libcublas` somewhere on your system? You need to install the CUDA toolkit, which provides both. You also shouldn’t need to set those environment variables, as `CUDAapi` should pick everything up (if it doesn’t, run with `JULIA_DEBUG=CUDAapi` and file a bug).

---

<div class="post-metadata">

**Author:** ![vargonis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vargonis/32/14614_2.png) [@vargonis](https://discourse.julialang.org/u/vargonis)\
**Post date:** [July 26, 2019, 7:29am UTC](https://discourse.julialang.org/t/problem-building-cudanative/26540/3 "2019-07-26T07:29:41Z")

</div>

The problem was that I had installed Julia via snap (on Ubuntu 18.04) and for some reason it installed the 32 bit version (my system is 64 bit). This was very frustrating, it took a lot of effort to understand the problem (had to dig into the source code of the library that finds CUDA related stuff and randomly test its functions, and tried several other things before realizing the real problem). I would suggest posting a warning about this issue on the installation page.
