Unable to test or use HIP libraries on Windows 10

Hello,
I am relatively new to Julia and very new to GPU programming. Recently I decided to use AMDGPU.jl, however, it does not seem like Julia can AMD’s HIP libraries, even though it recognizes that they are there. Here’s a minimum working example:

AMDGPU HIP Test
using Pkg
Pkg.test("AMDGPU", test_args=["hip"])
     Testing Running tests...
┌ Warning: MIOpen is unavailable, functionality will be disabled. # I am not doing any ML so this is fine
└ @ AMDGPU C:\Users\*\.julia\packages\AMDGPU\BhNdC\src\AMDGPU.jl:213
[ Info: Running following tests: ["hip"].
[ Info: Running tests with 2 workers.
[ Info: Testing using device HIPDevice(name="AMD Radeon(TM) Graphics", id=1, gcn_arch=gfx90c:xnack-).
Julia Version 1.10.0
Commit 3120989f39 (2023-12-25 18:01 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 12 × AMD Ryzen 5 5500U with Radeon Graphics
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, znver2)
  Threads: 17 on 12 virtual cores
Environment:
  JULIA_LOAD_PATH = @;C:\Users\*\AppData\Local\Temp\jl_sLCpo0
  JULIA_EDITOR = code
ROCm provided by: system
[+] ld.lld
    @ C:\Program Files\AMD\ROCm\5.5\bin\ld.lld.exe # I am using version 5.5 to hopefully smooth over compatibility issues between ROCm and Julia
[+] ROCm-Device-Libs
    @ C:\Users\*\.julia\artifacts\5ad5ecb46e3c334821f54c1feecc6c152b7b6a45\amdgcn/bitcode
[+] HIP Runtime v5.7.31541
    @ C:\Windows\SYSTEM32\amdhip64.DLL
[+] rocBLAS v2.47.0
    @ C:\Program Files\AMD\ROCm\5.5\bin\rocblas.dll
[+] rocSOLVER v3.21.0
    @ C:\Program Files\AMD\ROCm\5.5\bin\rocsolver.dll
[+] rocALUTION
    @ C:\Program Files\AMD\ROCm\5.5\bin\rocalution.dll
[+] rocSPARSE
    @ C:\Program Files\AMD\ROCm\5.5\bin\rocsparse.dll
[+] rocRAND v2.10.5
    @ C:\Program Files\AMD\ROCm\5.5\bin\rocrand.dll
[+] rocFFT v1.0.21
    @ C:\Program Files\AMD\ROCm\5.5\bin\rocfft.dll
[-] MIOpen

HIP Devices [1]
    1. HIPDevice(name="AMD Radeon(TM) Graphics", id=1, gcn_arch=gfx90c:xnack-)
[ Info: Scanning for test items in project `AMDGPU` at paths: C:\Users\*\.julia\packages\AMDGPU\BhNdC
[ Info: Finished scanning for test items in 2.05 seconds. Scheduling 2 tests on pid 6032 with 2 worker processes and 1 threads per worker.
[ Info: Starting test workers
  Worker 4376:  [ Info: Starting test worker 1 on pid = 4376, with 1 threads
  Worker 9808:  [ Info: Starting test worker 2 on pid = 9808, with 1 threads[ Info: Starting running test items

  Worker 9808:  11:53:27 | maxrss  4.4% | mem 83.4% | START (2/2) test item "hip - extra" at test\hip_extra_tests.jl:1
  Worker 4376:  11:53:27 | maxrss  4.4% | mem 83.4% | START (1/2) test item "hip - core" at test\hip_core_tests.jl:1

Captured Logs for test item "hip - core" at test\hip_core_tests.jl:1 on worker 4376

rocBLAS error: Cannot read C:\Program Files\AMD\ROCm\5.5\bin\/rocblas/library/TensileLibrary.dat: No such file or directory
┌ Error: Worker(pid=4376, terminated=true, termsignal=0) died running test item "hip - core". Recording test error.
└ @ ReTestItems C:\Users\*\.julia\packages\ReTestItems\ELM7z\src\ReTestItems.jl:561

Captured Logs for test item "hip - extra" at test\hip_extra_tests.jl:1 on worker 9808

rocBLAS error: Cannot read C:\Program Files\AMD\ROCm\5.5\bin\/rocblas/library/TensileLibrary.dat: No such file or directory
┌ Error: Worker(pid=9808, terminated=true, termsignal=-2147483648) died running test item "hip - extra". Recording test error.
└ @ ReTestItems C:\Users\*\.julia\packages\ReTestItems\ELM7z\src\ReTestItems.jl:561
Test Summary:               | Error  Total     Time
AMDGPU                      |     2      2  1m11.3s
  test                      |     2      2  
    test\hip_core_tests.jl  |     1      1  
      hip - core            |     1      1     0.0s
    test\hip_extra_tests.jl |     1      1  
      hip - extra           |     1      1     0.0s
ERROR: LoadError: Some tests did not pass: 0 passed, 0 failed, 2 errored, 0 broken.
in expression starting at C:\Users\*\.julia\packages\AMDGPU\BhNdC\test\runtests.jl:105
ERROR: Package AMDGPU errored during testing
Stacktrace:
 [1] pkgerror(msg::String)
   @ Pkg.Types C:\Users\*\.julia\juliaup\julia-1.10.0+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\Types.jl:70
 [2] test(ctx::Pkg.Types.Context, pkgs::Vector{…}; coverage::Bool, julia_args::Cmd, test_args::Cmd, test_fn::Nothing, force_latest_compatible_version::Bool, allow_earlier_backwards_compatible_versions::Bool, allow_reresolve::Bool)
   @ Pkg.Operations C:\Users\*\.julia\juliaup\julia-1.10.0+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\Operations.jl:2018       
 [3] test
   @ C:\Users\*\.julia\juliaup\julia-1.10.0+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\Operations.jl:1899 [inlined]
 [4] test(ctx::Pkg.Types.Context, pkgs::Vector{…}; coverage::Bool, test_fn::Nothing, julia_args::Cmd, test_args::Vector{…}, force_latest_compatible_version::Bool, allow_earlier_backwards_compatible_versions::Bool, allow_reresolve::Bool, kwargs::@Kwargs{…})
   @ Pkg.API C:\Users\*\.julia\juliaup\julia-1.10.0+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\API.jl:444
 [5] test(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::@Kwargs{test_args::Vector{String}})
   @ Pkg.API C:\Users\*\.julia\juliaup\julia-1.10.0+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\API.jl:159
 [6] test
   @ Pkg.API C:\Users\*\.julia\juliaup\julia-1.10.0+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\API.jl:147 [inlined]
 [7] #test#74
   @ Pkg.API C:\Users\*\.julia\juliaup\julia-1.10.0+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\API.jl:146 [inlined]
 [8] top-level scope
   @ c:\Users\*\Documents\GoL\CGoL.jl\scripts\AMDGPUtest.jl:4
Some type information was truncated. Use `show(err)` to see complete types.

julia> show(err)
1-element ExceptionStack:
LoadError: Package AMDGPU errored during testing
Stacktrace:
  [1] pkgerror(msg::String)
    @ Pkg.Types C:\Users\*\.julia\juliaup\julia-1.10.0+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\Types.jl:70
  [2] test(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; coverage::Bool, julia_args::Cmd, test_args::Cmd, test_fn::Nothing, 
force_latest_compatible_version::Bool, allow_earlier_backwards_compatible_versions::Bool, allow_reresolve::Bool)
    @ Pkg.Operations C:\Users\*\.julia\juliaup\julia-1.10.0+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\Operations.jl:2018      
  [3] test
    @ C:\Users\*\.julia\juliaup\julia-1.10.0+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\Operations.jl:1899 [inlined]
  [4] test(ctx::Pkg.Types.Context, pkgs::Vector{Pkg.Types.PackageSpec}; coverage::Bool, test_fn::Nothing, julia_args::Cmd, test_args::Vector{String}, force_latest_compatible_version::Bool, allow_earlier_backwards_compatible_versions::Bool, allow_reresolve::Bool, kwargs::@Kwargs{io::Base.TTY})
    @ Pkg.API C:\Users\*\.julia\juliaup\julia-1.10.0+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\API.jl:444
  [5] test(pkgs::Vector{Pkg.Types.PackageSpec}; io::Base.TTY, kwargs::@Kwargs{test_args::Vector{String}})
    @ Pkg.API C:\Users\*\.julia\juliaup\julia-1.10.0+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\API.jl:159
  [6] test
    @ Pkg.API C:\Users\*\.julia\juliaup\julia-1.10.0+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\API.jl:147 [inlined]
  [7] #test#74
    @ Pkg.API C:\Users\*\.julia\juliaup\julia-1.10.0+0.x64.w64.mingw32\share\julia\stdlib\v1.10\Pkg\src\API.jl:146 [inlined]
  [8] top-level scope
    @ c:\Users\*\Documents\GoL\CGoL.jl\scripts\AMDGPUtest.jl:4
  [9] eval
    @ Core .\boot.jl:385 [inlined]
 [10] include_string(mapexpr::typeof(identity), mod::Module, code::String, filename::String)
    @ Base .\loading.jl:2070
 [11] include_string(m::Module, txt::String, fname::String)
    @ Base .\loading.jl:2080
 [12] invokelatest(::Any, ::Any, ::Vararg{Any}; kwargs::@Kwargs{})
    @ Base .\essentials.jl:887
 [13] invokelatest(::Any, ::Any, ::Vararg{Any})
    @ Base .\essentials.jl:884
 [14] inlineeval(m::Module, code::String, code_line::Int64, code_column::Int64, file::String; softscope::Bool)
    @ VSCodeServer c:\Users\*\.vscode\extensions\julialang.language-julia-1.66.2\scripts\packages\VSCodeServer\src\eval.jl:263
 [15] (::VSCodeServer.var"#67#72"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()
    @ VSCodeServer c:\Users\*\.vscode\extensions\julialang.language-julia-1.66.2\scripts\packages\VSCodeServer\src\eval.jl:181
 [16] withpath(f::VSCodeServer.var"#67#72"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams}, 
path::String)
    @ VSCodeServer c:\Users\*\.vscode\extensions\julialang.language-julia-1.66.2\scripts\packages\VSCodeServer\src\repl.jl:274
 [17] (::VSCodeServer.var"#66#71"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()        
    @ VSCodeServer c:\Users\*\.vscode\extensions\julialang.language-julia-1.66.2\scripts\packages\VSCodeServer\src\eval.jl:179
 [18] hideprompt(f::VSCodeServer.var"#66#71"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})
    @ VSCodeServer c:\Users\*\.vscode\extensions\julialang.language-julia-1.66.2\scripts\packages\VSCodeServer\src\repl.jl:38
 [19] (::VSCodeServer.var"#65#70"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()        
    @ VSCodeServer c:\Users\*\.vscode\extensions\julialang.language-julia-1.66.2\scripts\packages\VSCodeServer\src\eval.jl:150
 [20] with_logstate(f::Function, logstate::Any)
    @ Base.CoreLogging .\logging.jl:515
 [21] with_logger
    @ .\logging.jl:627 [inlined]
 [22] (::VSCodeServer.var"#64#69"{VSCodeServer.ReplRunCodeRequestParams})()
    @ VSCodeServer c:\Users\*\.vscode\extensions\julialang.language-julia-1.66.2\scripts\packages\VSCodeServer\src\eval.jl:255
 [23] #invokelatest#2
    @ Base .\essentials.jl:887 [inlined]
 [24] invokelatest(::Any)
    @ Base .\essentials.jl:884
 [25] (::VSCodeServer.var"#62#63")()
    @ VSCodeServer c:\Users\*\.vscode\extensions\julialang.language-julia-1.66.2\scripts\packages\VSCodeServer\src\eval.jl:34
in expression starting at c:\Users\*\Documents\GoL\CGoL.jl\scripts\AMDGPUtest.jl:4

However, the core of the package still works, so I can generate ROCArrays, but I can’t use rocRAND or rocFFT, which I need.

Manual testing
using AMDGPU
using AMDGPU.rocFFT
AMDGPU.allowscalar(false)
A = rand(3,3)
# A_d = AMDGPU.rand(3,3) # errors
A_d = ROCArray(A) # works just fine
# fft(A_d) # gives following error
1-element ExceptionStack:
LoadError: could not load library "C:\Program Files\AMD\ROCm\5.5\bin\rocfft.dll" # this file does exist on my hardware
The specified module could not be found.
Stacktrace:
  [1] rocfft_plan_create(plan::Base.RefValue{Ptr{AMDGPU.rocFFT.rocfft_plan_t}}, placement::AMDGPU.rocFFT.rocfft_result_placement_e, transform_type::AMDGPU.rocFFT.rocfft_transform_type_e, precision::AMDGPU.rocFFT.rocfft_precision_e, dimensions::Int64, lengths::Vector{Int64}, number_of_transforms::Int64, description::Ptr{Nothing})
    @ AMDGPU.rocFFT C:\Users\*\.julia\packages\AMDGPU\BhNdC\src\fft\librocfft.jl:77
  [2] create_plan(xtype::AMDGPU.rocFFT.rocfft_transform_type_e, xdims::Tuple{Int64, Int64}, T::Type, inplace::Bool, region::UnitRange{Int64})
    @ AMDGPU.rocFFT C:\Users\*\.julia\packages\AMDGPU\BhNdC\src\fft\util.jl:59
  [3] #3
    @ C:\Users\*\.julia\packages\AMDGPU\BhNdC\src\fft\util.jl:38 [inlined]
  [4] (::AMDGPU.var"#6#9"{AMDGPU.rocFFT.var"#3#4"{Tuple{AMDGPU.rocFFT.rocfft_transform_type_e, Tuple{Int64, Int64}, DataType, Bool, UnitRange{Int64}}}, HandleCache{Tuple{HIPContext, AMDGPU.rocFFT.rocfft_transform_type_e, Tuple{Vararg{Int64, N}} where N, Type, Bool, Any}, Tuple{Ptr{AMDGPU.rocFFT.rocfft_plan_t}, Int64}}, Tuple{HIPContext, AMDGPU.rocFFT.rocfft_transform_type_e, Tuple{Int64, Int64}, DataType, Bool, UnitRange{Int64}}})()
    @ AMDGPU C:\Users\*\.julia\packages\AMDGPU\BhNdC\src\cache.jl:29
  [5] lock(f::AMDGPU.var"#6#9"{AMDGPU.rocFFT.var"#3#4"{Tuple{AMDGPU.rocFFT.rocfft_transform_type_e, Tuple{Int64, Int64}, DataType, Bool, UnitRange{Int64}}}, HandleCache{Tuple{HIPContext, AMDGPU.rocFFT.rocfft_transform_type_e, Tuple{Vararg{Int64, N}} where N, Type, Bool, Any}, Tuple{Ptr{AMDGPU.rocFFT.rocfft_plan_t}, Int64}}, Tuple{HIPContext, AMDGPU.rocFFT.rocfft_transform_type_e, Tuple{Int64, Int64}, DataType, Bool, UnitRange{Int64}}}, l::ReentrantLock)
    @ Base .\lock.jl:229
  [6] (::AMDGPU.var"#check_cache#7"{HandleCache{Tuple{HIPContext, AMDGPU.rocFFT.rocfft_transform_type_e, Tuple{Vararg{Int64, N}} where N, Type, Bool, Any}, Tuple{Ptr{AMDGPU.rocFFT.rocfft_plan_t}, Int64}}, Tuple{HIPContext, AMDGPU.rocFFT.rocfft_transform_type_e, Tuple{Int64, Int64}, DataType, Bool, UnitRange{Int64}}})(f::AMDGPU.rocFFT.var"#3#4"{Tuple{AMDGPU.rocFFT.rocfft_transform_type_e, Tuple{Int64, Int64}, DataType, Bool, UnitRange{Int64}}})
    @ AMDGPU C:\Users\*\.julia\packages\AMDGPU\BhNdC\src\cache.jl:27
  [7] pop!(f::Function, cache::HandleCache{Tuple{HIPContext, AMDGPU.rocFFT.rocfft_transform_type_e, Tuple{Vararg{Int64, N}} where N, Type, 
Bool, Any}, Tuple{Ptr{AMDGPU.rocFFT.rocfft_plan_t}, Int64}}, key::Tuple{HIPContext, AMDGPU.rocFFT.rocfft_transform_type_e, Tuple{Int64, Int64}, DataType, Bool, UnitRange{Int64}})
    @ AMDGPU C:\Users\*\.julia\packages\AMDGPU\BhNdC\src\cache.jl:48
  [8] get_plan(::AMDGPU.rocFFT.rocfft_transform_type_e, ::Vararg{Any})
    @ AMDGPU.rocFFT C:\Users\*\.julia\packages\AMDGPU\BhNdC\src\fft\util.jl:37
  [9] plan_fft
    @ AMDGPU.rocFFT C:\Users\*\.julia\packages\AMDGPU\BhNdC\src\fft\fft.jl:110 [inlined]
 [10] fft
    @ AbstractFFTs C:\Users\*\.julia\packages\AbstractFFTs\4iQz5\src\definitions.jl:67 [inlined]
 [11] fft
    @ AbstractFFTs C:\Users\*\.julia\packages\AbstractFFTs\4iQz5\src\definitions.jl:214 [inlined]
 [12] fft(x::ROCArray{Float64, 2, AMDGPU.Runtime.Mem.HIPBuffer})
    @ AbstractFFTs C:\Users\*\.julia\packages\AbstractFFTs\4iQz5\src\definitions.jl:66
 [13] top-level scope
    @ c:\Users\*\Documents\GoL\CGoL.jl\scripts\AMDGPUtest.jl:7
 [14] eval
    @ Core .\boot.jl:385 [inlined]
 [15] include_string(mapexpr::typeof(identity), mod::Module, code::String, filename::String)
    @ Base .\loading.jl:2070
 [16] include_string(m::Module, txt::String, fname::String)
    @ Base .\loading.jl:2080
 [17] invokelatest(::Any, ::Any, ::Vararg{Any}; kwargs::@Kwargs{})
    @ Base .\essentials.jl:887
 [18] invokelatest(::Any, ::Any, ::Vararg{Any})
    @ Base .\essentials.jl:884
 [19] inlineeval(m::Module, code::String, code_line::Int64, code_column::Int64, file::String; softscope::Bool)
    @ VSCodeServer c:\Users\*\.vscode\extensions\julialang.language-julia-1.66.2\scripts\packages\VSCodeServer\src\eval.jl:263
 [20] (::VSCodeServer.var"#67#72"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()        
    @ VSCodeServer c:\Users\*\.vscode\extensions\julialang.language-julia-1.66.2\scripts\packages\VSCodeServer\src\eval.jl:181
 [21] withpath(f::VSCodeServer.var"#67#72"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams}, 
path::String)
    @ VSCodeServer c:\Users\*\.vscode\extensions\julialang.language-julia-1.66.2\scripts\packages\VSCodeServer\src\repl.jl:274
 [22] (::VSCodeServer.var"#66#71"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()        
    @ VSCodeServer c:\Users\*\.vscode\extensions\julialang.language-julia-1.66.2\scripts\packages\VSCodeServer\src\eval.jl:179
 [23] hideprompt(f::VSCodeServer.var"#66#71"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})
    @ VSCodeServer c:\Users\*\.vscode\extensions\julialang.language-julia-1.66.2\scripts\packages\VSCodeServer\src\repl.jl:38
 [24] (::VSCodeServer.var"#65#70"{Bool, Bool, Bool, Module, String, Int64, Int64, String, VSCodeServer.ReplRunCodeRequestParams})()        
    @ VSCodeServer c:\Users\*\.vscode\extensions\julialang.language-julia-1.66.2\scripts\packages\VSCodeServer\src\eval.jl:150
 [25] with_logstate(f::Function, logstate::Any)
    @ Base.CoreLogging .\logging.jl:515
 [26] with_logger
    @ .\logging.jl:627 [inlined]
 [27] (::VSCodeServer.var"#64#69"{VSCodeServer.ReplRunCodeRequestParams})()
    @ VSCodeServer c:\Users\*\.vscode\extensions\julialang.language-julia-1.66.2\scripts\packages\VSCodeServer\src\eval.jl:255
 [28] #invokelatest#2
    @ Base .\essentials.jl:887 [inlined]
 [29] invokelatest(::Any)
    @ Base .\essentials.jl:884
 [30] (::VSCodeServer.var"#62#63")()
    @ VSCodeServer c:\Users\*\.vscode\extensions\julialang.language-julia-1.66.2\scripts\packages\VSCodeServer\src\eval.jl:34
in expression starting at c:\Users\*\Documents\GoL\CGoL.jl\scripts\AMDGPUtest.jl:7

I’m aware that some packages like rocFFT may still be broken with Windows 10 (Some AMDGPU tests failing on Radeon VII under Windows) but it seems like here Julia can not even begin to access them. Please let me know if I need to provide any more information. Any help with this would be greatly appreciated!

It’s not Julia-specific at least:

I didn’t read carefully, maybe there’s a workaround, or unsupported hardware, or driver not installed? CUDA.jl is well-supported, Julia for AMD GPUS (HIP/ROCm a bit newer, but at least confirm it works/correctly installed first somehow without Julia).

[I don’t have your hardware, nor Windows, to test anything, just trying to explain/read the log.]

I suspect that your GPU is not supported on Windows.
See the list of supported devices:

On Linux you could define env variable HSA_OVERRIDE_GFX_VERSION=9.0.0 before launching Julia and that should make it work.
On Windows however, there’s no such option…

Well, that’s unfortunate. I even tried changing the environment variable globally and there was no luck.
Would it be worth trying to use Julia on WSL instead? I’m doing this for a personal project and I don’t have the option of switching hardware.
Thank you for your replies.

I’m not sure ROCm works under WSL… So I’d suggest trying with a proper Linux installation (dual-boot or not)