🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.debian.bugs.dist
2 messages
2 total messages Started by Francesco Poli Fri, 23 Oct 2026 16:20
Bug#1151662: libggml0-backend-hip: HIP backend fails with `ROCm error: invalid device function`
#1818
Author: Francesco Poli
Date: Fri, 23 Oct 2026 16:20
135 lines
7407 bytes
--Sig_/qIxOHZ7OVUuwRgzhXPPTVZc
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

On Thu, 22 Oct 2026 15:12:52 -0600 Cordell Bloor wrote:

[...]
> Hi Francesco,

Hello Cordell,
thanks a lot for your kind reply!

>=20
> On 2026-10-22 12:23, Francesco Poli (frx) wrote:
> > $ llama-bench -hf MaziyarPanahi/Mistral-7B-Instruct-v0.3-GGUF
[...]
> > ROCm error: invalid device function
[...]
>=20
> The "invalid device function" error that you're seeing is the current=20
> ROCm way of saying "the library you're trying to use was not built
> for your GPU."=C2=A0The gfx90c architecture is not currently on the list
> of GPUs supported by ROCm math libraries in Unstable or Forky,
> because the "fallback architecture" patch we were using to enable
> gfx90c in ROCm 5 could not easily be carried over into ROCm 6 or
> later.

So, just to be sure I am understanding correctly: there's no variant of
libggml0-backend-hip built to target the gfx90c GPUs in the Debian
package, since the ROCm math libraries cannot (in current Debian
testing/unstable) made to support gfx90c architecture.

Does this also mean that I cannot (currently) use this integrated GPU
for GPGPU computations? I haven't yet tried...

> This was=20
> mentioned briefly in the NEWS for rocm-hipamd 6.4.3-1 [1]. There is a=20
> suggested workaround on the Supported GPU wiki page [2] (which also=20
> reminds me that the wiki has not yet been updated for Forky or
> current Unstable). For posterity, I'll repeat the suggestion here:
> try setting `export HSA_OVERRIDE_GFX_VERSION=3D9.0.0` in your
> environment to use the code objects built for gfx900 on your gfx90c
> GPU.

It works:

```
$ export HSA_OVERRIDE_GFX_VERSION=3D9.0.0
$ llama-bench -hf MaziyarPanahi/Mistral-7B-Instruct-v0.3-GGUF
ggml_cuda_init: found 1 ROCm devices (Total VRAM: 13977 MiB):
  Device 0: AMD Radeon Graphics, gfx900:xnack+ (0x900), VMM: no, Wave Size:=
 64, VRAM: 13977 MiB
load_backend: loaded ROCm backend from /usr/lib/x86_64-linux-gnu/ggml/backe=
nds0/libggml-hip.so
load_backend: loaded CPU backend from /usr/lib/x86_64-linux-gnu/ggml/backen=
ds0/libggml-cpu-haswell.so
| model                          |       size |     params | backend    | n=
gl |            test |                  t/s |
| ------------------------------ | ---------: | ---------: | ---------- | -=
-: | --------------: | -------------------: |
| llama 7B Q4_K - Medium         |   4.07 GiB |     7.25 B | ROCm       |  =
-1 |           pp512 |         53.19 =C2=B1 0.06 |
| llama 7B Q4_K - Medium         |   4.07 GiB |     7.25 B | ROCm       |  =
-1 |           tg128 |          6.90 =C2=B1 0.01 |

build: Debian (11669)
```

>=20
> I'm hoping we'll be able to get gfx90c working without needing those=20
> sorts of hacks for Forky, but I cannot make any hard promises. All I
> can say is that I will do my best. However, I'd be surprised if the
> HIP backend performs better than the vulkan implementation on gfx90c
> even if I get it working.

Your guess seems to be confirmed by the actual numbers.
It seems that the Vulkan backend performs better.

> I don't think upstream has done much rocblas kernel=20
> tuning for gfx90c=C2=A0(if any), but tuned kernels are vital for achievin=
g=20
> optimal performance on the ROCm BLAS stack.
>=20
> Sincerely,
> Cory Bloor
>=20
> [1]:=20
> https://salsa.debian.org/rocm-team/rocm-hipamd/-/blob/debian/6.4.3-1/debi=
an/NEWS?ref_type=3Dtags
> [2]:=20
> https://salsa.debian.org/rocm-team/community/team-project/-/wikis/Support=
ed-GPU-list#gfx90c


Thank you so much for your insight.
I am looking forward to hearing back from you (especially regarding my
question about GPGPU)!

Also, if you have anything to comment about my comparison of Vulkan and
CPU backends (why is `pp512` performance almost double, while `tg128`
is only very slightly better), I would be very interested in hearing
your take on that...

Thanks again for you time and patience!   :-)



--=20
 https://...?
 There's not a second to spare! To the laboratory!
..................................................... Francesco Poli .
 GnuPG key fpr =3D=3D CA01 1147 9CD2 EFDF FB82  3925 3E1C 27E1 1F69 BFFE

--Sig_/qIxOHZ7OVUuwRgzhXPPTVZc
Content-Type: application/pgp-signature
Content-Description: OpenPGP digital signature

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEygERR5zS79/7gjklPhwn4R9pv/4FAmrbhq0ACgkQPhwn4R9p
v/7dGA//fmh8N9ttmo9sIm01aCTt5yBs4xAB74ulF9tBxvCrBN+0AgxJEny3DGDg
71x5GZgn/dPAf5+uLGzOp8knV+WVxRkoMMSEUpg0jE2gwXKk4QEWgWdt+HjLkCNE
L9v+6pH3bZyS1FfsxCe3YdhKRXf+fw3k2T3YcxdnrkN8VXqzjVtwuitGFD/Law7w
5/WA6VlUmyM5bTM0Xe0OS+vWFIRG7ZDS3fzRwg26x6E1A4pUdkFlFWO9TWWsQyzb
XqEu4ENiw9E5dlIIWOvx/fkTpJZZAfAylwHn6SDSjQzPVgN9CrAjx4bu0mSEOUhr
imjIDIVtuipeb93nVGcOgsIkmPSuIN1vNJRIWpMvUiq5qBhlGnsp35KJ5Oe/zPj1
2JXSeJNUkfqp68odKkZwuMN25HeaotHOIbItmO5JZqUIhLVYBauYPdov3JSJ3dlN
+HH2G2XdI169CCM+WYc+yrSAkbROeedDxjeRtUd5AsMQa1ZdMfdtXtlLOCYKzq/R
lS3vxWNQwYcW0pavG1xyyMMx01u+feuiZDKFZDd1209RksmGMQCSMxUnE4yj4ZN/
E5UN37peBayU4ZwwCqc+VBi1t/sO7ZmhVlrFfarys2JuuPqK8N8JRYNINT0fdgTt
xD+k7LaC+nVJH7WSoO0w4Aaq9tKWd5yMZViAEREX78HJLIsaryc=
=+as/
-----END PGP SIGNATURE-----

--Sig_/qIxOHZ7OVUuwRgzhXPPTVZc--
Bug#1151662: libggml0-backend-hip: HIP backend fails with `ROCm error: invalid device function`
#1885
Author: Cordell Bloor
Date: Fri, 23 Oct 2026 21:00
66 lines
5576 bytes
Hi Francesco,

On 2026-10-23 10:09, Francesco Poli wrote:
> Does this also mean that I cannot (currently) use this integrated GPU
> for GPGPU computations? I haven't yet tried...

You can use your integrated GPU for GPGPU computations, though it may be 
more difficult. You have to build the code yourself rather than relying 
on Debian's prebuilt packages. That means no use of the rocblas, 
rocsparse, rocsolver, or rocrand packages. The rocfft and hipfft 
packages are purely based on run-time compilation, so they probably 
work. Similarly, header-only libraries like rocprim, rocthrust, and 
hipcub might be usable.

When libraries are built for the HIP language, the GPU code generated by 
the compiler is /native machine code/. This is unlike other GPU 
computational frameworks like Vulkan, OpenGL, or OpenCL, where 
application binaries generally either depend on run-time compilation 
(RTC) of shader sources, or ship an intermediate representation of the 
shaders (such as SPIR-V) and then JIT to native GPU code on the user's 
machine.

The HIP toolchain and runtime in Debian Testing and Unstable can build 
and run GPGPU programs and libraries for gfx90c. However, the prebuilt 
library and program packages included in Debian are not built for 
gfx90c. If the prebuilt libggml0-backend-hip and librocblas4 packages 
contained gfx90c machine code, then they would run on your system.

In any case, there are two main reasons why we don't build the Debian 
packages for gfx90c:

1. Upstream libraries like rocblas include a lot of compile-time and 
run-time if/else cases that branch on the detected gfx architecture, but 
the code is not written to handle gfx90c (as it is not on their official 
support list). To successfully build, we'd need to develop and maintain 
patches providing fallback code paths. I'd like to do that, but my time 
is limited.

2. The AMD ROCm packages are enormous on disk and they take an extremely 
long time to compile. Both size-on-disk and time-to-compile scale 
linearly with the number of architectures you build for. We're building 
for less than half of the potential architectures we could target but 
we're already running up against various limits in our tools and 
infrastructure.

> Your guess seems to be confirmed by the actual numbers.
> It seems that the Vulkan backend performs better.

Thank you for sharing. It's always nice to see actual benchmarks to 
confirm my suspicions.

> Also, if you have anything to comment about my comparison of Vulkan and
> CPU backends (why is `pp512` performance almost double, while `tg128`
> is only very slightly better), I would be very interested in hearing
> your take on that...

I'm afraid that I don't know enough to do anything but speculate. My 
suspicion would be that token generation gets little benefit from the 
APU hardware because it is memory-bound and it cannot be significantly 
optimized for that reason. Prompt processing, on the other hand, is 
compute-bound and there's more room for the Vulkan implementation to 
distinguish itself by making more efficient use of the APU hardware. 
However, this is nothing more than a guess.

Sincerely,
Cory Bloor
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads