# CUDA under julia 1.5.0

**URL:** https://discourse.julialang.org/t/cuda-under-julia-1-5-0/44789
**Category:** GPU
**Created:** [August 12, 2020, 8:41am UTC](https://discourse.julialang.org/t/cuda-under-julia-1-5-0/44789 "2020-08-12T08:41:41Z")
**Posts on this page:** 14
**Page:** 1

<div class="post-metadata">

### Author: ![Ferran\_Mazzanti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ferran_mazzanti/32/7458_2.png) [@Ferran\_Mazzanti](https://discourse.julialang.org/u/Ferran_Mazzanti)
#### Post date: [August 12, 2020, 8:41am UTC](https://discourse.julialang.org/t/cuda-under-julia-1-5-0/44789/1 "2020-08-12T08:41:41Z")

</div>

Hi,  
this is ubuntu 20.04 fresh install, also Julia 1.5.0

```julia
add CUDA
[ Info: Resolving package identifier `CUDA` as a directory at `~/CUDA`.
ERROR: Did not find a git repository at `CUDA`

```

no CUDA whatsoever… what am I doing wrong?

Of course, other packages install well with the same procedure…

Best,

Ferran

---

<div class="post-metadata">

### Author: ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)
#### Post date: [August 12, 2020, 8:48am UTC](https://discourse.julialang.org/t/cuda-under-julia-1-5-0/44789/2 "2020-08-12T08:48:41Z")

</div>

The problem here is that it tries to add the local folder called `CUDA` on your harddrive. You can do

```julia
using Pkg
Pkg.add(name="CUDA")

```

There has been a discussion about removing this ambiguity, and forcing writing `add ./CUDA` to add the local folder over the named package.

---

<div class="post-metadata">

### Author: ![Ferran\_Mazzanti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ferran_mazzanti/32/7458_2.png) [@Ferran\_Mazzanti](https://discourse.julialang.org/u/Ferran_Mazzanti)
#### Post date: [August 12, 2020, 9:49am UTC](https://discourse.julialang.org/t/cuda-under-julia-1-5-0/44789/3 "2020-08-12T09:49:07Z")

</div>

Interesting issue… thanks for the info.  
In any case I guess this has to be fixed in future releases, right? I mean, it makes no sense to have to  
install this package in a different way from the rest (I mean that the standard way `add CUDA` should work, to my understandings…)  
Best,  
Ferran.

---

<div class="post-metadata">

### Author: ![Keno](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/keno/32/285_2.png) [@Keno](https://discourse.julialang.org/u/Keno)
#### Post date: [August 12, 2020, 3:06pm UTC](https://discourse.julialang.org/t/cuda-under-julia-1-5-0/44789/4 "2020-08-12T15:06:25Z")

</div>

It’s not specific to CUDA, it’s specific to you having a directory called `CUDA` in your home directory, but as @kristoffer.carlsson said, it can be a bit confusing and may get changed in the future.

---

<div class="post-metadata">

### Author: ![Ferran\_Mazzanti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ferran_mazzanti/32/7458_2.png) [@Ferran\_Mazzanti](https://discourse.julialang.org/u/Ferran_Mazzanti)
#### Post date: [August 12, 2020, 4:09pm UTC](https://discourse.julialang.org/t/cuda-under-julia-1-5-0/44789/5 "2020-08-12T16:09:23Z")

</div>

…which makes essentially no difference because the installation methods should not depend on the names of the folders I have on my local drive.  
Anyway it does not compile on my Julia 1.5.0 box under ubuntu 20.04 so I guess I’ll wait until the package gets a bit more stable, sticking to the old CuArrays etc packages for a while.  
Thanks for the replies,  
Ferran.

---

<div class="post-metadata">

### Author: ![ToucheSir](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/touchesir/32/14411_2.png) [@ToucheSir](https://discourse.julialang.org/u/ToucheSir)
#### Post date: [August 12, 2020, 4:26pm UTC](https://discourse.julialang.org/t/cuda-under-julia-1-5-0/44789/6 "2020-08-12T16:26:10Z")

</div>

I’m a little confused by this. Are you running Julia out of your home directory specifically? That’s the only way Pkg would pick up on a subdirectory called “CUDA”. Even changing to a different directory and trying to install CUDA in the global environment works as expected…

In other words, this is not a problem with CUDA itself. I would run into the same problem right now if I `cd`’d to a random directory, created a CuArrays subdir, started Julia and ran `] add CuArrays`. Are you able to just run Julia out of the same directory you have the rest of your project’s files/data in? I can only assume that would cut down on home directory clutter as well!

---

<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: [August 13, 2020, 6:19am UTC](https://discourse.julialang.org/t/cuda-under-julia-1-5-0/44789/7 "2020-08-13T06:19:26Z")

</div>

> [@Ferran\_Mazzanti](#):
>
> Anyway it does not compile on my Julia 1.5.0 box under ubuntu 20.04 so I guess I’ll wait until the package gets a bit more stable, sticking to the old CuArrays etc packages for a while.

This issue has literally nothing to do with the CUDA.jl package, but with the coincidence that you have a folder named `CUDA` in your home directory. Waiting for the package to ‘stabilize’ won’t help, a more productive approach is to get rid or rename said folder. If you have other issues, please file an issue.

---

<div class="post-metadata">

### Author: ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)
#### Post date: [August 13, 2020, 6:20am UTC](https://discourse.julialang.org/t/cuda-under-julia-1-5-0/44789/8 "2020-08-13T06:20:31Z")

</div>

> [@Ferran\_Mazzanti](#):
>
> …which makes essentially no difference because the installation methods should not depend on the names of the folders I have on my local drive.

Hence

> [@kristoffer.carlsson](#):
>
> There has been a discussion about removing this ambiguity, and forcing writing `add ./CUDA` to add the local folder over the named package.

---

<div class="post-metadata">

### Author: ![Ferran\_Mazzanti](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ferran_mazzanti/32/7458_2.png) [@Ferran\_Mazzanti](https://discourse.julialang.org/u/Ferran_Mazzanti)
#### Post date: [August 21, 2020, 5:09pm UTC](https://discourse.julialang.org/t/cuda-under-julia-1-5-0/44789/9 "2020-08-21T17:09:03Z")

</div>

HI,  
I renamed my CUDA folder (so to adapt my computer to Julia requests, very nice) and tried to install CUDA.jl on my ubuntu mate 20.04, julia 1.5.0 box. Still getting errors

```julia
   _ _ _(_)_ | Documentation: https://docs.julialang.org
  (_) | (_) (_) |
   _ _ _| |_ __ _ | Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` | |
  | | |_| | | | (_| | | Version 1.5.0 (2020-08-01)
 _/ |\ __'_|_|_|\__'_| | Official https://julialang.org/ release
|__/ |

julia> using CUDA
[Info: Precompiling CUDA [052768ef-5323-5732-b1bb-66c8b64840ba]
ERROR: LoadError: LoadError: LoadError: UndefVarError: AddrSpacePtr not defined
Stacktrace:
 [1] getproperty(::Module, ::Symbol) at ./Base.jl:26
 [2] top-level scope at /home/mazzanti/.julia/packages/CUDA/5t6R9/src/device/cuda/wmma.jl:52
 [3] include(::Function, ::Module, ::String) at ./Base.jl:380
 [4] include at ./Base.jl:368 [inlined]
 [5] include(::String) at /home/mazzanti/.julia/packages/CUDA/5t6R9/src/CUDA.jl:1
 [6] top-level scope at /home/mazzanti/.julia/packages/CUDA/5t6R9/src/device/cuda.jl:15
 [7] include(::Function, ::Module, ::String) at ./Base.jl:380
 [8] include at ./Base.jl:368 [inlined]
 [9] include(::String) at /home/mazzanti/.julia/packages/CUDA/5t6R9/src/CUDA.jl:1
 [10] top-level scope at /home/mazzanti/.julia/packages/CUDA/5t6R9/src/CUDA.jl:39
 [11] include(::Function, ::Module, ::String) at ./Base.jl:380
 [12] include(::Module, ::String) at ./Base.jl:368
 [13] top-level scope at none:2
 [14] eval at ./boot.jl:331 [inlined]
 [15] eval(::Expr) at ./client.jl:467
 [16] top-level scope at ./none:3
in expression starting at /home/mazzanti/.julia/packages/CUDA/5t6R9/src/device/cuda/wmma.jl:52
in expression starting at /home/mazzanti/.julia/packages/CUDA/5t6R9/src/device/cuda.jl:14
in expression starting at /home/mazzanti/.julia/packages/CUDA/5t6R9/src/CUDA.jl:39
ERROR: Failed to precompile CUDA [052768ef-5323-5732-b1bb-66c8b64840ba] to /home/mazzanti/.julia/compiled/v1.5/CUDA/oWw5k_JTdPc.ji.
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] compilecache(::Base.PkgId, ::String) at ./loading.jl:1290
 [3] _require(::Base.PkgId) at ./loading.jl:1030
 [4] require(::Base.PkgId) at ./loading.jl:928
 [5] require(::Module, ::Symbol) at ./loading.jl:923

```

…so there are still some issues here. Has anybody experienced anything similar?  
Thanks…

---

<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: [August 24, 2020, 9:23am UTC](https://discourse.julialang.org/t/cuda-under-julia-1-5-0/44789/10 "2020-08-24T09:23:04Z")

</div>

1.5 is only supported by a sufficiently recent version of CUDA.jl; you’re probably still using v0.1

---

<div class="post-metadata">

### Author: ![tamasgal](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tamasgal/32/27946_2.png) [@tamasgal](https://discourse.julialang.org/u/tamasgal)
#### Post date: [August 24, 2020, 9:31am UTC](https://discourse.julialang.org/t/cuda-under-julia-1-5-0/44789/11 "2020-08-24T09:31:03Z")

</div>

A `Pkg.status()` would certainly help other people reproduce the problem.

I have no issues using `CUDA.jl` with Julia 1.5.

---

<div class="post-metadata">

### Author: ![pritamd47](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pritamd47/32/12133_2.png) [@pritamd47](https://discourse.julialang.org/u/pritamd47)
#### Post date: [September 28, 2020, 8:09am UTC](https://discourse.julialang.org/t/cuda-under-julia-1-5-0/44789/12 "2020-09-28T08:09:44Z")

</div>

I too encountered the `LoadError: UnderVarError: AddrSpacePtr` error. [Discussion here](https://github.com/JuliaGPU/CuArrays.jl/issues/732) seems to be the correct explanation of what is happening. In my case, I had `CuArrays` installed, which might have been the culprit (of limiting CUDA to `v0.1.0`). I removed `CuArrays`, and installed the latest version of CUDA.jl using `]add CUDA@1.3.3` (latest at the time of writing), and now the precompiling doesn’t fail.

> Note: `CuArrays.jl` is Deprecated, and `CUDA.jl` should be used instead.

Prior to fixing the problem, my `]st` looked something like this. Hope this helps anyone else stumbling across this issue.

```Julia
(@v1.5) pkg> st
Status `~/.julia/environments/v1.5/Project.toml`
  [c9ce4bd3] ArchGDAL v0.5.1
  [6e4b80f9] BenchmarkTools v0.5.0
  [052768ef] CUDA v0.1.0
  [3895d2a7] CUDAapi v4.0.0
  [3a865a2d] CuArrays v2.2.2
  [39dd38d3] Dierckx v0.5.0
  [0c46a032] DifferentialEquations v6.15.0
  [e30172f5] Documenter v0.25.2
  [587475ba] Flux v0.10.4
  [7073ff75] IJulia v1.21.3
  [c601a237] Interact v0.10.3
  [eb30cadb] MLDatasets v0.5.2
  [ee78f7c6] Makie v0.11.1
  [9b87118b] PackageCompiler v1.2.1
  [d96e819e] Parameters v0.12.1
  [91a5bcdd] Plots v1.6.6
  [c3e4b0f8] Pluto v0.11.14
  [d330b81b] PyPlot v2.9.0
  [0f1e0344] WebIO v0.8.14

```

Error Message:

```Julia
[Info: Precompiling CUDA [052768ef-5323-5732-b1bb-66c8b64840ba]
ERROR: LoadError: LoadError: LoadError: UndefVarError: AddrSpacePtr not defined
Stacktrace:
 [1] getproperty(::Module, ::Symbol) at ./Base.jl:26
 [2] top-level scope at /home/pritamd47/.julia/packages/CUDA/5t6R9/src/device/cuda/wmma.jl:52
 [3] include(::Function, ::Module, ::String) at ./Base.jl:380
 [4] include at ./Base.jl:368 [inlined]
 [5] include(::String) at /home/pritamd47/.julia/packages/CUDA/5t6R9/src/CUDA.jl:1
 [6] top-level scope at /home/pritamd47/.julia/packages/CUDA/5t6R9/src/device/cuda.jl:15
 [7] include(::Function, ::Module, ::String) at ./Base.jl:380
 [8] include at ./Base.jl:368 [inlined]
 [9] include(::String) at /home/pritamd47/.julia/packages/CUDA/5t6R9/src/CUDA.jl:1
 [10] top-level scope at /home/pritamd47/.julia/packages/CUDA/5t6R9/src/CUDA.jl:39
 [11] include(::Function, ::Module, ::String) at ./Base.jl:380
 [12] include(::Module, ::String) at ./Base.jl:368
 [13] top-level scope at none:2
 [14] eval at ./boot.jl:331 [inlined]
 [15] eval(::Expr) at ./client.jl:467
 [16] top-level scope at ./none:3
in expression starting at /home/pritamd47/.julia/packages/CUDA/5t6R9/src/device/cuda/wmma.jl:52
in expression starting at /home/pritamd47/.julia/packages/CUDA/5t6R9/src/device/cuda.jl:14
in expression starting at /home/pritamd47/.julia/packages/CUDA/5t6R9/src/CUDA.jl:39

```

---

<div class="post-metadata">

### Author: ![Manu\_Francis](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/manu_francis/32/10010_2.png) [@Manu\_Francis](https://discourse.julialang.org/u/Manu_Francis)
#### Post date: [October 24, 2020, 3:56am UTC](https://discourse.julialang.org/t/cuda-under-julia-1-5-0/44789/13 "2020-10-24T03:56:57Z")

</div>

@pritamd47: I solved the error by doing the following method:

```julia
] rm CUDA
gc
add CUDA@v1.3.0

```

Problem solved 😃

---

<div class="post-metadata">

### Author: ![carlomontec](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carlomontec/32/2011_2.png) [@carlomontec](https://discourse.julialang.org/u/carlomontec)
#### Post date: [October 24, 2020, 6:46am UTC](https://discourse.julialang.org/t/cuda-under-julia-1-5-0/44789/14 "2020-10-24T06:46:03Z")

</div>

Hi, I followed @pritamd47 and your approach. Thank you guys! Wouldnt it be the case that if I uninstall the old CUDA related packages, then the installer would select the most recent version?
