# AMDGPU-error

**URL:** https://discourse.julialang.org/t/amdgpu-error/64990
**Category:** General Usage
**Tags:** gpu, bug, linux
**Created:** [July 20, 2021, 3:13pm UTC](https://discourse.julialang.org/t/amdgpu-error/64990 "2021-07-20T15:13:13Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![peteole](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/peteole/32/209790_2.png) [@peteole](https://discourse.julialang.org/u/peteole)
#### Post date: [July 20, 2021, 3:13pm UTC](https://discourse.julialang.org/t/amdgpu-error/64990/1 "2021-07-20T15:13:13Z")

</div>

Hi,

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

```julia
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?

---

<div class="post-metadata">

### Author: ![maxfreu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maxfreu/32/17468_2.png) [@maxfreu](https://discourse.julialang.org/u/maxfreu)
#### Post date: [July 20, 2021, 3:46pm UTC](https://discourse.julialang.org/t/amdgpu-error/64990/2 "2021-07-20T15:46:18Z")

</div>

I think the underlying ROCm (“AMD CUDA”) doesn’t support non-dedicated GPUs. See [here](https://github.com/RadeonOpenCompute/ROCm#Supported-GPUs) for a list of supported GPUs. Probably it doesn’t make much sense to use it without a proper GPU anyway.

---

<div class="post-metadata">

### Author: ![peteole](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/peteole/32/209790_2.png) [@peteole](https://discourse.julialang.org/u/peteole)
#### Post date: [July 21, 2021, 6:37am UTC](https://discourse.julialang.org/t/amdgpu-error/64990/3 "2021-07-21T06:37:58Z")

</div>

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…

---

<div class="post-metadata">

### Author: ![abulak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/abulak/32/28314_2.png) [@abulak](https://discourse.julialang.org/u/abulak)
#### Post date: [July 21, 2021, 5:16pm UTC](https://discourse.julialang.org/t/amdgpu-error/64990/4 "2021-07-21T17:16:05Z")

</div>

@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](https://github.com/JuliaGPU/AMDGPU.jl/graphs/contributors) making this happen on AMD GPUs!

---

<div class="post-metadata">

### Author: ![jpsamaroo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jpsamaroo/32/46804_2.png) [@jpsamaroo](https://discourse.julialang.org/u/jpsamaroo)
#### Post date: [July 21, 2021, 5:47pm UTC](https://discourse.julialang.org/t/amdgpu-error/64990/5 "2021-07-21T17:47:48Z")

</div>

> [@peteole](#):
>
> Also my computer totally crashes when running the test command on the package (graphic bugs all over the screen, only fixed after reboot).

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!

---

<div class="post-metadata">

### Author: ![jpsamaroo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jpsamaroo/32/46804_2.png) [@jpsamaroo](https://discourse.julialang.org/u/jpsamaroo)
#### Post date: [July 21, 2021, 5:49pm UTC](https://discourse.julialang.org/t/amdgpu-error/64990/6 "2021-07-21T17:49:45Z")

</div>

> [@maxfreu](#):
>
> Probably it doesn’t make much sense to use it without a proper GPU anyway.

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.

---

<div class="post-metadata">

### Author: ![maxfreu](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/maxfreu/32/17468_2.png) [@maxfreu](https://discourse.julialang.org/u/maxfreu)
#### Post date: [July 21, 2021, 7:37pm UTC](https://discourse.julialang.org/t/amdgpu-error/64990/7 "2021-07-21T19:37:45Z")

</div>

> [@jpsamaroo](#):
>
> Actually one of the key considerations around HSA (ROCR) and HIP was supporting heterogeneous systems like APUs.

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.

---

<div class="post-metadata">

### Author: ![jpsamaroo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jpsamaroo/32/46804_2.png) [@jpsamaroo](https://discourse.julialang.org/u/jpsamaroo)
#### Post date: [July 21, 2021, 10:05pm UTC](https://discourse.julialang.org/t/amdgpu-error/64990/8 "2021-07-21T22:05:39Z")

</div>

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

---

<div class="post-metadata">

### Author: ![peteole](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/peteole/32/209790_2.png) [@peteole](https://discourse.julialang.org/u/peteole)
#### Post date: [July 22, 2021, 11:32am UTC](https://discourse.julialang.org/t/amdgpu-error/64990/9 "2021-07-22T11:32:47Z")

</div>

> [@abulak](#):
>
> You’re simply missing `libhipamd64_.so` . Try installing `AMDGPU@0.2.10` or above, it should ship with `HIP_jll` .

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?

---

<div class="post-metadata">

### Author: ![peteole](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/peteole/32/209790_2.png) [@peteole](https://discourse.julialang.org/u/peteole)
#### Post date: [July 22, 2021, 11:34am UTC](https://discourse.julialang.org/t/amdgpu-error/64990/10 "2021-07-22T11:34:40Z")

</div>

> [@jpsamaroo](#):
>
> try updating to a very recent Linux kernel (5.12 or so) and it should work far better.

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

---

<div class="post-metadata">

### Author: ![mbauman](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mbauman/32/31082_2.png) [@mbauman](https://discourse.julialang.org/u/mbauman)
#### Post date: [June 2, 2022, 1:59pm UTC](https://discourse.julialang.org/t/amdgpu-error/64990/11 "2022-06-02T13:59:03Z")

</div>

4 posts were split to a new topic: [Using AMDGPU.jl with an AMD APU](https://discourse.julialang.org/t/using-amdgpu-jl-with-an-amd-apu/82134)
