AMDGPU-error

Hi,

on my manjaro (arch linux) system (with a ryzen 4500u, no dedicated GPU) I get an error initiating a simple ROCArray:

a=ROCArray([1,2,3])
3-element ROCVector{Int64}:
Error showing value of type ROCVector{Int64}:
ERROR: could not load library ""
/home/olep/.julia/artifacts/aa6ac134081d81525be58c62abcb37f3e75029a5/lib/: cannot read file data: Is a directory
Stacktrace:
  [1] macro expansion
    @ ~/.julia/packages/AMDGPU/mNX1n/src/hip/error.jl:149 [inlined]
  [2] hipStreamSynchronize(stream::Ptr{Nothing})
    @ AMDGPU.HIP ~/.julia/packages/AMDGPU/mNX1n/src/hip/libhip.jl:2
  [3] wait!(ss::AMDGPU.SyncState)
    @ AMDGPU ~/.julia/packages/AMDGPU/mNX1n/src/sync.jl:19
  [4] wait!
    @ ~/.julia/packages/AMDGPU/mNX1n/src/array.jl:83 [inlined]
  [5] copyto!(dest::Vector{Int64}, d_offset::Int64, source::ROCVector{Int64}, s_offset::Int64, amount::Int64)
    @ AMDGPU ~/.julia/packages/AMDGPU/mNX1n/src/array.jl:173
  [6] copyto!
    @ ~/.julia/packages/GPUArrays/Z5nPF/src/host/abstractarray.jl:95 [inlined]
  [7] copyto_axcheck!
    @ ./abstractarray.jl:1056 [inlined]
  [8] Array
    @ ./array.jl:540 [inlined]
  [9] Array
    @ ./boot.jl:472 [inlined]
 [10] convert
    @ ./array.jl:532 [inlined]
 [11] adapt_storage
    @ ~/.julia/packages/GPUArrays/Z5nPF/src/host/abstractarray.jl:45 [inlined]
 [12] adapt_structure
    @ ~/.julia/packages/Adapt/RGNRk/src/Adapt.jl:42 [inlined]
 [13] adapt
    @ ~/.julia/packages/Adapt/RGNRk/src/Adapt.jl:40 [inlined]
 [14] print_array
    @ ~/.julia/packages/GPUArrays/Z5nPF/src/host/abstractarray.jl:48 [inlined]
 [15] show(io::IOContext{Base.TTY}, #unused#::MIME{Symbol("text/plain")}, X::ROCVector{Int64})
    @ Base ./arrayshow.jl:368
 [16] (::REPL.var"#38#39"{REPL.REPLDisplay{REPL.LineEditREPL}, MIME{Symbol("text/plain")}, Base.RefValue{Any}})(io::Any)
    @ REPL /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:220
 [17] with_repl_linfo(f::Any, repl::REPL.LineEditREPL)
    @ REPL /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:462
 [18] display(d::REPL.REPLDisplay, mime::MIME{Symbol("text/plain")}, x::Any)
    @ REPL /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:213
 [19] display(d::REPL.REPLDisplay, x::Any)
    @ REPL /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:225
 [20] display(x::Any)
    @ Base.Multimedia ./multimedia.jl:328
 [21] #invokelatest#2
    @ ./essentials.jl:708 [inlined]
 [22] invokelatest
    @ ./essentials.jl:706 [inlined]
 [23] print_response(errio::IO, response::Any, show_value::Bool, have_color::Bool, specialdisplay::Union{Nothing, AbstractDisplay})
    @ REPL /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:247
 [24] (::REPL.var"#40#41"{REPL.LineEditREPL, Pair{Any, Bool}, Bool, Bool})(io::Any)
    @ REPL /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:231
 [25] with_repl_linfo(f::Any, repl::REPL.LineEditREPL)
    @ REPL /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:462
 [26] print_response(repl::REPL.AbstractREPL, response::Any, show_value::Bool, have_color::Bool)
    @ REPL /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:229
 [27] (::REPL.var"#do_respond#61"{Bool, Bool, REPL.var"#72#82"{REPL.LineEditREPL, REPL.REPLHistoryProvider}, REPL.LineEditREPL, REPL.LineEdit.Prompt})(s::REPL.LineEdit.MIState, buf::Any, ok::Bool)
    @ REPL /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:798
 [28] #invokelatest#2
    @ ./essentials.jl:708 [inlined]
 [29] invokelatest
    @ ./essentials.jl:706 [inlined]
 [30] run_interface(terminal::REPL.Terminals.TextTerminal, m::REPL.LineEdit.ModalInterface, s::REPL.LineEdit.MIState)
    @ REPL.LineEdit /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/REPL/src/LineEdit.jl:2441
 [31] run_frontend(repl::REPL.LineEditREPL, backend::REPL.REPLBackendRef)
    @ REPL /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.6/REPL/src/REPL.jl:1126
 [32] (::REPL.var"#44#49"{REPL.LineEditREPL, REPL.REPLBackendRef})()
    @ REPL ./task.jl:411

Also my computer totally crashes when running the test command on the package (graphic bugs all over the screen, only fixed after reboot).
Any idea what’s going on?

I think the underlying ROCm (“AMD CUDA”) doesn’t support non-dedicated GPUs. See here for a list of supported GPUs. Probably it doesn’t make much sense to use it without a proper GPU anyway.

That’s a but sad but sounds plausible. I just wanted to try out GPU computing and get my hands on it, so actual speed would not have mattered anyways…

1 Like

@peteole, You’re simply missing libhipamd64_.so. Try installing AMDGPU@0.2.10 or above, it should ship with HIP_jll. I have AMD Ryzen 7 PRO 4750U with Radeon Graphics and I can run basic examples just fine!

Many thanks to @jpsamaroo for singlehandedly making this happen on AMD GPUs!

2 Likes

I also have this when using my laptop APU; try updating to a very recent Linux kernel (5.12 or so) and it should work far better. And of course, as @abulak pointed out, make sure to keep an eye on AMDGPU releases and use the latest one!

Actually one of the key considerations around HSA (ROCR) and HIP was supporting heterogeneous systems like APUs. The lack of good support for APUs in practice is due to the complexity of supporting all the different kinds of GPUs that AMD produces, with all their quirks and different features, and getting all of that code upstream into Linux and LLVM.

3 Likes

Hmm you are right. I wonder what happened to OpenCL by the way… it had the same intentions, but now it seems buried in the past like a maya temple.

OpenCL.jl still exists, but since it doesn’t compose well with other Julia code, it’s not often used.

This really fixed it, thanks! How does the package versioning work in julia? I am a bit confused since I installed the amdgpu package a few days ago so I expected it to be up to date… Is 5.11 a beta version and you normally get the stable one?

I was already on 5.13 :innocent: it crashed again when running the test command, but when just trying my stuff it seems stable now.

4 posts were split to a new topic: Using AMDGPU.jl with an AMD APU