# CUDA package test shows error

**URL:** <https://discourse.julialang.org/t/cuda-package-test-shows-error/72714>\
**Category:** Package Management\
**Tags:** package, cuda\
**Created:** [December 7, 2021, 3:10pm UTC](https://discourse.julialang.org/t/cuda-package-test-shows-error/72714 "2021-12-07T15:10:11Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![VOLCANIC\_9](https://avatars.discourse-cdn.com/v4/letter/v/da6949/32.png) [@VOLCANIC\_9](https://discourse.julialang.org/u/VOLCANIC_9)\
**Post date:** [December 7, 2021, 3:10pm UTC](https://discourse.julialang.org/t/cuda-package-test-shows-error/72714/1 "2021-12-07T15:10:11Z")

</div>

Recently, I downloaded and installed the CUDA package for Julia. The CUDA toolkit version 6.5 was also installed on my windows.

I test package based on mentioned tutorial here: [CUDA programming in Julia](https://juliagpu.gitlab.io/CUDA.jl/).

After that, Julia showed this error:

> Loaderror: could not find a suitable CUDA installation

> Package CUDA errored during testing

I tested CUDA toolkit in command prompt via:

> nvcc --version

It showed the version.

I want to know what is wrong with the above procedure?

---

<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:** [December 7, 2021, 4:45pm UTC](https://discourse.julialang.org/t/cuda-package-test-shows-error/72714/2 "2021-12-07T16:45:07Z")

</div>

You’ll have to provide more details. Which version of Julia? Are you setting any environment variables?

> [@VOLCANIC\_9](#):
>
> The CUDA toolkit version 6.5 was also installed on my windows.

That will not be used, CUDA.jl automatically downloads the CUDA toolkit. Also, this version is extremely old.

Try running with `JULIA_DEBUG=CUDA` and pasting the output here.

---

<div class="post-metadata">

**Author:** ![VOLCANIC\_9](https://avatars.discourse-cdn.com/v4/letter/v/da6949/32.png) [@VOLCANIC\_9](https://discourse.julialang.org/u/VOLCANIC_9)\
**Post date:** [December 7, 2021, 6:38pm UTC](https://discourse.julialang.org/t/cuda-package-test-shows-error/72714/3 "2021-12-07T18:38:07Z")

</div>

> [@maleadt](#):
>
> JULIA\_DEBUG=CUDA

I use Julia 1.6.3 and I added the CUDA bin directory to the path. I previously run some code with Julia.

First: the output of the test procedure is:

```julia
ERROR: LoadError: Could not find a suitable CUDA installation
Stacktrace:
 [1] error(s::String)
   @ Base .\error.jl:33
 [2] macro expansion
   @ C:\Users\ALI\.julia\packages\CUDA\YpW0k\deps\bindeps.jl:77 [inlined]
 [3] macro expansion
   @ lock.jl:209 [inlined]
 [4] toolkit()
   @ CUDA.Deps C:\Users\ALI\.julia\packages\CUDA\YpW0k\deps\bindeps.jl:19
 [5] toolkit_release()
   @ CUDA.Deps C:\Users\ALI\.julia\packages\CUDA\YpW0k\deps\bindeps.jl:209
 [6] top-level scope
   @ C:\Users\ALI\.julia\packages\CUDA\YpW0k\test\runtests.jl:119
 [7] include(fname::String)
   @ Base.MainInclude .\client.jl:444
 [8] top-level scope
   @ none:6
in expression starting at C:\Users\ALI\.julia\packages\CUDA\YpW0k\test\runtests.
jl:119
ERROR: Package CUDA errored during testing
Stacktrace:
  [1] pkgerror(msg::String)
    @ Pkg.Types C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1
.6\Pkg\src\Types.jl:55
  [2] test(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; coverage
::Bool, julia_args::Cmd, test_args::Cmd, test_fn::Nothing)
    @ Pkg.Operations C:\buildbot\worker\package_win64\build\usr\share\julia\stdl
ib\v1.6\Pkg\src\Operations.jl:1693
  [3] test(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; coverage
::Bool, test_fn::Nothing, julia_args::Cmd, test_args::Cmd, kwargs::Base.Iterator
s.Pairs{Symbol, Base.TTY, Tuple{Symbol}, NamedTuple{(:io,), Tuple{Base.TTY}}})
    @ Pkg.API C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6
\Pkg\src\API.jl:343
  [4] test(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::Base.Itera
tors.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Pkg.API C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6
\Pkg\src\API.jl:80
  [5] test(pkgs::Vector{Pkg.Types.PackageSpec})
    @ Pkg.API C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6
\Pkg\src\API.jl:78
  [6] #test#63
    @ C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src
\API.jl:76 [inlined]
  [7] test
    @ C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src
\API.jl:76 [inlined]
  [8] #test#62
    @ C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src
\API.jl:75 [inlined]
  [9] test(pkg::String)
    @ Pkg.API C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6
\Pkg\src\API.jl:75
 [10] top-level scope
    @ REPL[5]:1
 [11] top-level scope
    @ C:\Users\ALI\.julia\packages\CUDA\YpW0k\src\initialization.jl:52

```

Second, I cannot understand correctly:

> Try running with `JULIA_DEBUG=CUDA` and pasting the output here.

When I just run `JULIA_DEBUG=CUDA`, it showed:

> ERROR: UndefVarError: CUDA not defined

When I just run `JULIA_DEBUG=CUDA` in test command, it showed:

```julia
ERROR: The following package names could not be resolved:
 * JULIA_DEBUG=CUDA (not found in project or manifest)

Stacktrace:
  [1] pkgerror(msg::String)
    @ Pkg.Types C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1
.6\Pkg\src\Types.jl:55
  [2] ensure_resolved(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec
}; registry::Bool)
    @ Pkg.Types C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1
.6\Pkg\src\Types.jl:883
  [3] ensure_resolved
    @ C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src
\Types.jl:846 [inlined]
  [4] test(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; coverage
::Bool, test_fn::Nothing, julia_args::Cmd, test_args::Cmd, kwargs::Base.Iterator
s.Pairs{Symbol, Base.TTY, Tuple{Symbol}, NamedTuple{(:io,), Tuple{Base.TTY}}})
    @ Pkg.API C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6
\Pkg\src\API.jl:341
  [5] test(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::Base.Itera
tors.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Pkg.API C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6
\Pkg\src\API.jl:80
  [6] test(pkgs::Vector{Pkg.Types.PackageSpec})
    @ Pkg.API C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6
\Pkg\src\API.jl:78
  [7] #test#63
    @ C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src
\API.jl:76 [inlined]
  [8] test
    @ C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src
\API.jl:76 [inlined]
  [9] #test#62
    @ C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Pkg\src
\API.jl:75 [inlined]
 [10] test(pkg::String)
    @ Pkg.API C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6
\Pkg\src\API.jl:75
 [11] top-level scope
    @ REPL[3]:1
 [12] top-level scope
    @ C:\Users\ALI\.julia\packages\CUDA\YpW0k\src\initialization.jl:52

```

---

<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:** [December 8, 2021, 6:32am UTC](https://discourse.julialang.org/t/cuda-package-test-shows-error/72714/4 "2021-12-08T06:32:15Z")

</div>

> [@VOLCANIC\_9](#):
>
> When I just run `JULIA_DEBUG=CUDA` in test command, it showed:

You need to set this in your environment before starting Julia.

---

<div class="post-metadata">

**Author:** ![lawless-m](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lawless-m/32/30869_2.png) [@lawless-m](https://discourse.julialang.org/u/lawless-m)\
**Post date:** [December 8, 2021, 1:42pm UTC](https://discourse.julialang.org/t/cuda-package-test-shows-error/72714/5 "2021-12-08T13:42:59Z")

</div>

like this

```julia

C:\Users\matt
$ set JULIA_DEBUG=CUDA

C:\Users\matt
$ julia -q
julia> ENV["JULIA_DEBUG"]
"CUDA "

julia>

```

---

<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:** [December 8, 2021, 1:56pm UTC](https://discourse.julialang.org/t/cuda-package-test-shows-error/72714/6 "2021-12-08T13:56:25Z")

</div>

Yes. You can also just set ENV before `using CUDA`. Maybe try that, because you seem to have a trailing space which make mess things up.

---

<div class="post-metadata">

**Author:** ![lawless-m](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lawless-m/32/30869_2.png) [@lawless-m](https://discourse.julialang.org/u/lawless-m)\
**Post date:** [December 8, 2021, 2:00pm UTC](https://discourse.julialang.org/t/cuda-package-test-shows-error/72714/7 "2021-12-08T14:00:18Z")

</div>

oh, good spot, but it seems that was just sloppy copy/pasting, I must have included one by accident

repeating it

```julia
$ set JULIA_DEBUG=CUDA

C:\Users\matt
$ julia -q
julia> ENV["JULIA_DEBUG"]
"CUDA"

```

---

<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:** [December 8, 2021, 2:02pm UTC](https://discourse.julialang.org/t/cuda-package-test-shows-error/72714/8 "2021-12-08T14:02:05Z")

</div>

Now import the package; this is just an env var that affects the behavior of CUDA.jl, and doesn’t do anything by itself.

---

<div class="post-metadata">

**Author:** ![VOLCANIC\_9](https://avatars.discourse-cdn.com/v4/letter/v/da6949/32.png) [@VOLCANIC\_9](https://discourse.julialang.org/u/VOLCANIC_9)\
**Post date:** [December 8, 2021, 2:07pm UTC](https://discourse.julialang.org/t/cuda-package-test-shows-error/72714/9 "2021-12-08T14:07:47Z")

</div>

I did it, I mean first:

> ENV[“JULIA\_DEBUG”] = “CUDA”

Then, I did:

> using Pkg  
> Pkg.test(“CUDA”)

After that, It showed:

```julia
┌ Debug: Could not download forward compatibility package
│ exception =
│ Cannot locate artifact 'CUDA_compat' for x86_64-w64-mingw32-libgfortran5-cx
x11-cuda+11.4-julia_version+1.6.3 in 'C:\Users\ALI\.julia\packages\CUDA\YpW0k\Ar
tifacts.toml'
│ Stacktrace:
│ [1] error(s::String)
│ @ Base .\error.jl:33
│ [2] artifact_slash_lookup(name::String, artifact_dict::Dict{String, Any},
 artifacts_toml::String, platform::Base.BinaryPlatforms.Platform)
│ @ Artifacts C:\buildbot\worker\package_win64\build\usr\share\julia\stdl
ib\v1.6\Artifacts\src\Artifacts.jl:608
│ [3] macro expansion
│ @ C:\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.6\Ar
tifacts\src\Artifacts.jl:688 [inlined]
│ [4] libcuda()
│ @ CUDA C:\Users\ALI\.julia\packages\CUDA\YpW0k\lib\cudadrv\CUDAdrv.jl:8
2
│ [5] macro expansion
│ @ C:\Users\ALI\.julia\packages\CUDA\YpW0k\lib\cudadrv\libcuda.jl:35 [in
lined]
│ [6] macro expansion
│ @ C:\Users\ALI\.julia\packages\CUDA\YpW0k\lib\cudadrv\error.jl:97 [inli
ned]
│ [7] cuDeviceGetCount
│ @ C:\Users\ALI\.julia\packages\CUDA\YpW0k\lib\utils\call.jl:26 [inlined
]
│ [8] ndevices()
│ @ CUDA C:\Users\ALI\.julia\packages\CUDA\YpW0k\lib\cudadrv\devices.jl:1
60
│ [9] top-level scope
│ @ C:\Users\ALI\.julia\packages\CUDA\YpW0k\test\runtests.jl:57
│ [10] include(fname::String)
│ @ Base.MainInclude .\client.jl:444
│ [11] top-level scope
│ @ none:6
│ [12] eval
│ @ .\boot.jl:360 [inlined]
│ [13] exec_options(opts::Base.JLOptions)
│ @ Base .\client.jl:261
│ [14] _start()
│ @ Base .\client.jl:485
└ @ CUDA C:\Users\ALI\.julia\packages\CUDA\YpW0k\lib\cudadrv\CUDAdrv.jl:84
┌ Debug: Trying to use artifacts...
└ @ CUDA.Deps C:\Users\ALI\.julia\packages\CUDA\YpW0k\deps\bindeps.jl:122
┌ Debug: Selecting artifacts based on driver compatibility 6.5.0
└ @ CUDA.Deps C:\Users\ALI\.julia\packages\CUDA\YpW0k\deps\bindeps.jl:134
┌ Debug: CUDA driver compatibility 6.5.0 is not compatible with any artifact
└ @ CUDA.Deps C:\Users\ALI\.julia\packages\CUDA\YpW0k\deps\bindeps.jl:142
┌ Debug: Could not find a compatible artifact.
└ @ CUDA.Deps C:\Users\ALI\.julia\packages\CUDA\YpW0k\deps\bindeps.jl:155
┌ Debug: Trying to use local installation...
└ @ CUDA.Deps C:\Users\ALI\.julia\packages\CUDA\YpW0k\deps\bindeps.jl:164
┌ Debug: Looking for CUDA toolkit via environment variables CUDA_PATH
└ @ CUDA.Deps C:\Users\ALI\.julia\packages\CUDA\YpW0k\deps\discovery.jl:271
┌ Debug: Looking for binary nvdisasm in G:\cuda\CUDA
│ all_locations =
│ 2-element Vector{String}:
│ "G:\\cuda\\CUDA"
│ "G:\\cuda\\CUDA\\bin"
└ @ CUDA.Deps C:\Users\ALI\.julia\packages\CUDA\YpW0k\deps\discovery.jl:147
┌ Debug: Found nvdisasm at G:\cuda\CUDA\bin\nvdisasm.exe
└ @ CUDA.Deps C:\Users\ALI\.julia\packages\CUDA\YpW0k\deps\discovery.jl:153
┌ Debug: Looking for library cudart, version 9.0.0 or 9.1.0 or 9.2.0 or 10.0.0 o
r 10.1.0 or 10.2.0 or 11.0.0 or 11.1.0 or 11.2.0 or 11.3.0 or 11.4.0 or 11.5.0 o
r 11.6.0 or 11.7.0 or 11.8.0 or 11.9.0 or 11.10.0 or 12.1.0 or 12.2.0 or 12.3.0
or 12.4.0 or 12.5.0 or 12.6.0 or 12.7.0 or 12.8.0 or 12.9.0 or 12.10.0 or 13.1.0
 or 13.2.0 or 13.3.0 or 13.4.0 or 13.5.0 or 13.6.0 or 13.7.0 or 13.8.0 or 13.9.0
 or 13.10.0 or 14.1.0 or 14.2.0 or 14.3.0 or 14.4.0 or 14.5.0 or 14.6.0 or 14.7.
0 or 14.8.0 or 14.9.0 or 14.10.0 or 15.1.0 or 15.2.0 or 15.3.0 or 15.4.0 or 15.5
.0 or 15.6.0 or 15.7.0 or 15.8.0 or 15.9.0 or 15.10.0, in G:\cuda\CUDA
│ all_names =
│ 230-element Vector{String}:
│ "cudart64.dll"
│ "cudart.dll"
│ ?
│ "cudart_15.dll"
│ all_locations =
│ 6-element Vector{String}:
│ "G:\\cuda\\CUDA"
│ "G:\\cuda\\CUDA\\lib"
│ ?
│ "G:\\cuda\\CUDA\\bin\\x64"
└ @ CUDA.Deps C:\Users\ALI\.julia\packages\CUDA\YpW0k\deps\discovery.jl:119
┌ Debug: Did not find cudart
└ @ CUDA.Deps C:\Users\ALI\.julia\packages\CUDA\YpW0k\deps\discovery.jl:122
┌ Debug: Could not find the CUDA runtime library
└ @ CUDA.Deps C:\Users\ALI\.julia\packages\CUDA\YpW0k\deps\bindeps.jl:179

```

---

<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:** [December 8, 2021, 2:19pm UTC](https://discourse.julialang.org/t/cuda-package-test-shows-error/72714/10 "2021-12-08T14:19:13Z")

</div>

> [@VOLCANIC\_9](#):
>
> `CUDA driver compatibility 6.5.0 is not compatible with any artifact`

Your NVIDIA driver is _way_ too old, you need one with at least CUDA compatibility 10.1 or higher.
