CUDA package test shows error

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.

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?

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

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.

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:

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:

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

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

like this


C:\Users\matt
$ set  JULIA_DEBUG=CUDA

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

julia>

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.

1 Like

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

repeating it

$ set JULIA_DEBUG=CUDA

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

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

I did it, I mean first:

ENV[β€œJULIA_DEBUG”] = β€œCUDA”

Then, I did:

using Pkg
Pkg.test(β€œCUDA”)

After that, It showed:

β”Œ 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

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