RADV/radeonsi: GPU init fails (VK_ERROR_INITIALIZATION_FAILED / AC_QUERY_GPU_INFO_FAIL)
when an amdgpu_query_sw_info() implementation older than libdrm 2.4.132 is used, e.g.
an older libdrm_amdgpu bundled by another vendor (here: the “sysdeps” layer of a ROCm
TheRock build; in general any ROCm/PyTorch wheel) that gets loaded into the process
before the system libdrm
Trigger conditions (all three required):
* Mesa >= 26.2 (the block below does not exist in 25.2 / 25.3 / 26.0 / 26.1;
it appears in 26.2.0)
* libdrm_amdgpu that predates 2.4.132 (amdgpu_sw_info_address_prt_wa_control_bit and
the matching case in amdgpu_query_sw_info() were added in libdrm 2.4.132; the copy
bundled here is 2.4.127)
* AMD GPU with has_smem_with_null_prt_bug
(gfx_level <= GFX12 && != GFX9 && family != CHIP_GFX1156), e.g. RDNA1-4,
Strix Point, Rembrandt - but not Vega (gfx9) and not gfx1156
Two ways to reach it:
(a) system libdrm is >= 2.4.132 and correct, but an older bundled copy is loaded
first and interposes - this report’s reproduction;
(b) the system libdrm itself is < 2.4.132 while Mesa is >= 26.2 - same message,
same failure, no vendor bundle involved.
=== Summary ===
On Strix Point (gfx1150), RADV refuses to create a physical device:
amdgpu: amdgpu_query_sw_info(amdgpu_sw_info_address_prt_wa_control_bit) failed.
ERROR: setup_loader_term_phys_devs: Call to 'vkEnumeratePhysicalDevices' in ICD
/usr/lib64/dri-freeworld/libvulkan_radeon.so failed with error code -3
ERROR: setup_loader_term_phys_devs: Failed to detect any valid GPUs in the current config
RADV then exposes no device at all, so any Vulkan application started that way
(e.g. llama.cpp with the ROCm backend loaded) sees no Vulkan GPU.
The system libdrm is fine. The failure happens because Mesa’s unversioned
reference to amdgpu_query_sw_info() is interposed by a *second* libdrm_amdgpu
that another component loaded into the process first: the libdrm bundled in the
ROCm sysdeps tree (/opt/rocm/lib/rocm_sysdeps/lib/librocm_sysdeps_drm_amdgpu.so.1).
That copy predates amdgpu_sw_info_address_prt_wa_control_bit and returns -EINVAL,
and Mesa 26.2.4 turns that into a hard failure of ac_query_gpu_info().
Reproduced on two different AMD GPUs (gfx1150 Strix Point iGPU and gfx1035 Rembrandt
iGPU) and on both machines the shadowing library is the very same one
(/opt/rocm/lib/rocm_sysdeps/lib/librocm_sysdeps_drm_amdgpu.so.1), returning the same
-EINVAL for info=1. It is the libdrm 2.4.127 pinned in the ROCm sysdeps layer (see
below), and that pin is still there in TheRock 7.14.0 - so this is not something a
newer ROCm build fixes by itself. The variable is the software stack, not the hardware
generation (any GPU in the has_smem_with_null_prt_bug range is affected).
=== Environment ===
GPU : 1002:150e “AMD Radeon 890M Graphics (RADV STRIX1)” - Strix Point, gfx1150
Distro : Fedora 44
Kernel : 7.3.0-0.rc5.343.vanilla.fc44.x86_64 (no amdgpu/drm errors in the kernel log)
Mesa : 26.2.4 (radv, driverInfo “Mesa 26.2.4”)
reproduced with both Fedora’s mesa-vulkan-drivers and RPM Fusion’s
mesa-vulkan-drivers-freeworld; ICD paths below are the freeworld ones
libdrm : 2.4.134-1.fc44 (system, works correctly)
ROCm : /opt/rocm from a TheRock build (per-GPU family artifacts), version 7.12.0
(/opt/rocm/.info/version), not rpm-owned - every file checked there
belongs to no Fedora package. The sysdeps layer that comes with it
(/opt/rocm/lib/rocm_sysdeps/lib/, 71 entries, dated 2026-02-10) bundles
its own copies of libdrm, libdrm_amdgpu, libelf, libdw, libexpat, libz,
libzstd, liblzma, libbz2, libnuma, libsqlite3, libpciaccess, libva
(plus Mesa-derived libgallium_drv_video.so / radeonsi_drv_video.so).
Fedora rpm packages rocm-7.1.0-3.fc44.noarch / hipcc-20-13.rocm7.1.1.fc44
are a separate, unrelated installation.
Second machine, same failure - same cause, variant (a):
GPU : 1002:1681 Rembrandt [Radeon 680M] - RADV REMBRANDT, gfx1035
(Mesa reports “AMD Radeon 660M (RADV REMBRANDT)”)
Distro : Fedora 44
Mesa : 26.2.4 (same)
libdrm : 2.4.134-1.fc44 (system; it *does* implement the query, so variant (b)
is ruled out here as well)
ROCm : TheRock 7.14.0 - a newer build than the first machine’s 7.12.0, and yet
the sysdeps layer behaves identically (hook output below), so the bundled
libdrm there is still pre-2.4.132 as well
Evidence : 1) plain vulkaninfo (nothing loads ROCm into the process) enumerates
“AMD Radeon 660M (RADV REMBRANDT)” with no error at all, so the system
libdrm is correct on this machine too; the failure appears only in
processes where the ROCm runtime is loaded first.
2) the same hook.c shim gives an identical result here - identical
library, identical return values, on a different GPU generation:
$ LD_PRELOAD=$PWD/hook.so llama-cli --list-devices 2>&1 | grep HOOK
\[HOOK\] real amdgpu_query_sw_info is in:
/opt/rocm/lib/rocm_sysdeps/lib/librocm_sysdeps_drm_amdgpu.so.1
\[HOOK\] amdgpu_query_sw_info(dev=..., info=0) -> 0, value=0xffff8000
\[HOOK\] amdgpu_query_sw_info(dev=..., info=1) -> -22, value=0x0
(repeated - the query is re-issued on every gpu_info/winsys attempt,
so no attempt can ever succeed)
i.e. exactly the same interposition, same interposing library path and
same -EINVAL on info=1 as on the first machine.
How to tell (a) from (b) on any machine: run the attached ./drmprobe2.
A return of 0 with a plausible value (e.g. 0x2e) means the system libdrm is
correct and something else interposes; -EINVAL means the system libdrm itself
predates 2.4.132 and no vendor bundle is needed.
=== Minimal reproduction (no application code, no HIP initialisation) ===
Control - RADV alone works:
$ VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/radeon_icd.x86_64.json \\
vulkaninfo --summary 2>&1 | grep deviceName
deviceName = AMD Radeon 890M Graphics (RADV STRIX1)
Now make the ROCm copy of libdrm_amdgpu visible in the global scope first:
$ VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/radeon_icd.x86_64.json \\
LD_PRELOAD=/opt/rocm/lib/rocm_sysdeps/lib/librocm_sysdeps_drm_amdgpu.so.1 \\
vulkaninfo --summary
amdgpu: amdgpu_query_sw_info(amdgpu_sw_info_address_prt_wa_control_bit) failed.
ERROR: \[Loader Message\] Code 0 : setup_loader_term_phys_devs: Call to
'vkEnumeratePhysicalDevices' in ICD /usr/lib64/dri-freeworld/libvulkan_radeon.so
failed with error code -3
ERROR: \[Loader Message\] Code 0 : setup_loader_term_phys_devs:
Failed to detect any valid GPUs in the current config
(no devices listed)
The same thing happens organically (no LD_PRELOAD) whenever the process loads the
ROCm runtime before Vulkan, e.g. llama.cpp with its HIP backend:
$ VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/radeon_icd.x86_64.json llama-cli --list-devices
amdgpu: amdgpu_query_sw_info(amdgpu_sw_info_address_prt_wa_control_bit) failed.
Available devices:
ROCm0: AMD Radeon 890M Graphics (15542 MiB, 15101 MiB free)
(no Vulkan0)
Proof of which libdrm implementation RADV actually binds to - an LD_PRELOAD shim
that forwards amdgpu_query_sw_info() to the real symbol and reports it with
dladdr() (source attached: hook.c):
$ VK_ICD_FILENAMES=... LD_PRELOAD=/tmp/opencode/hook.so llama-cli --list-devices
\[HOOK\] real amdgpu_query_sw_info is in:
/opt/rocm/lib/rocm_sysdeps/lib/librocm_sysdeps_drm_amdgpu.so.1
\[HOOK\] amdgpu_query_sw_info(dev=..., info=0) -> 0, value=0xffff8000
\[HOOK\] amdgpu_query_sw_info(dev=..., info=1) -> -22, value=0x0
i.e. info=1 (amdgpu_sw_info_address_prt_wa_control_bit) returns -EINVAL (22),
because the called function is ROCm’s copy, not the system libdrm.
=== Why Mesa fails hard ===
Mesa asks for that value only on GPUs affected by the “SMEM with NULL PRT” bug
(gfx_level <= GFX12, != GFX9, family != GFX1156 - gfx1150/Strix Point qualifies).
mesa-26.2.4, src/amd/common/ac_gpu_info.c, lines 1789-1799:
if (info->compiler_info.has_smem_with_null_prt_bug) {
/\* Query the PRT control bit that determines whether a VA is in the
\* "LOW" or "HIGH" address space. This is needed to implement the SMEM
\* with NULL PRT workaround.
\*/
r = ac_drm_query_sw_info(dev, amdgpu_sw_info_address_prt_wa_control_bit, &info->address_prt_wa_control_bit);
if (r) {
fprintf(stderr, "amdgpu: amdgpu_query_sw_info(amdgpu_sw_info_address_prt_wa_control_bit) failed.\\n");
return AC_QUERY_GPU_INFO_FAIL; /\* <-- kills the winsys -> vkEnumeratePhysicalDevices = -3 \*/
}
}
Compare libdrm’s own documentation (amdgpu.h), which explicitly treats this query
as advisory:
/\*\* Query the PRT control bit when the half VA range is reserved for
\* PRT when the device is initialized. This depends on the GFX version.
\* A return value of \~0 should be ignored.
\*/
amdgpu_sw_info_address_prt_wa_control_bit = 1,
=== The two implementations differ ===
system libdrm (/usr/lib64/libdrm_amdgpu.so.1, libdrm-2.4.134-1.fc44) - implements
the new enum and returns success:
$ ./drmprobe2 # attached
amdgpu_device_initialize = 0
query_sw_info(prt_wa_control_bit) = 0 value=0x2e (bit 46, valid)
amdgpu_query_sw_info:
test %esi,%esi ; je <case 0>
cmp $0x1,%esi ; jne <return -EINVAL>
mov 0x4f0(%rdi),%eax ; mov %eax,(%rdx) ; xor %eax,%eax ; ret
ROCm sysdeps copy (/opt/rocm/lib/rocm_sysdeps/lib/librocm_sysdeps_drm_amdgpu.so.1) -
knows only address32_hi, so any other enum value is -EINVAL:
amdgpu_query_sw_info:
test %esi,%esi ; jne <return -EINVAL>
...
The symbol in the ROCm copy is versioned amdgpu_query_sw_info@@AMDROCM_SYSDEPS_1.0
and its SONAME is librocm_sysdeps_drm_amdgpu.so.1, but that does not prevent
interposition: RADV’s reference is unversioned, so the dynamic linker resolves it
to the first definition in the global scope - ROCm’s copy, which was loaded earlier
via libggml-hip.so → libamdhip64.so → libhsa-runtime64.so.
=== Where the interposing libdrm comes from ===
The /opt/rocm tree here is a TheRock build (version 7.12.0), installed as per-GPU
artifacts and owned by no package. TheRock ships a “sysdeps” layer of private
dependencies, and that layer contains its own libdrm:
/opt/rocm/lib/rocm_sysdeps/lib/librocm_sysdeps_drm_amdgpu.so.1 (SONAME
librocm_sysdeps_drm_amdgpu.so.1, DT_NEEDED librocm_sysdeps_drm.so.2)
/opt/rocm/lib/rocm_sysdeps/lib/librocm_sysdeps_drm.so.2
... 71 entries in total, including private libelf/libdw/libexpat/libz/libzstd/
liblzma/libbz2/libnuma/libsqlite3/libpciaccess/libva and Mesa-derived
libgallium_drv_video.so / radeonsi_drv_video.so
That libdrm is old, and the version is pinned right there in the sysdeps tree:
$ grep -H -i '^Version' /opt/rocm/lib/rocm_sysdeps/lib/pkgconfig/libdrm\*.pc
.../libdrm_amdgpu.pc:Version: 2.4.127
.../libdrm.pc:Version: 2.4.127
(the system .pc for comparison: 2.4.134)
2.4.127 predates the “PRT control bit” API, which was added in libdrm 2.4.132.
Independently confirmed by the exported symbol set:
symbol set diff against the system libdrm_amdgpu (2.4.134), amdgpu\_\* only:
< amdgpu_va_manager_query_sw_info (introduced in libdrm 2.4.132)
< amdgpu_va_manager_init2
(92 exported symbols in the system copy, 91 in the sysdeps copy)
which matches its runtime behaviour exactly: info=0 -> 0, info=1 -> -EINVAL.
This is a stale pin, not something that came in with one specific build: the
TheRock 7.12.0 machine and the TheRock 7.14.0 machine (i.e. two different ROCm
versions, installed for two different GPUs) fail identically, and the sysdeps .pc
makes the bundled version easy to check in advance:
grep -i '^Version' /opt/rocm/lib/rocm_sysdeps/lib/pkgconfig/libdrm_amdgpu.pc
(>= 2.4.132 = fixed, 2.4.127 = still broken)
Why the renamed SONAME does not help: every exported symbol in the sysdeps
libraries carries a *default* symbol version, i.e. it satisfies an unversioned
reference from any other library:
librocm_sysdeps_drm_amdgpu.so.1 : @@AMDROCM_SYSDEPS_1.0
librocm_sysdeps_drm.so.2 : @@AMDROCM_SYSDEPS_1.0
librocm_sysdeps_elf.so.1 : @@AMDROCM_SYSDEPS_1.0_ELFUTILS_1.0 ... 1.7
librocm_sysdeps_va.so.2 : @@AMDROCM_SYSDEPS_1.0, @@VA_API_0.33.0
(and likewise zstd/expat/z/... : @@AMDROCM_SYSDEPS_1.0)
These libraries are pulled into the process as plain DT_NEEDED dependencies, not
dlopen’d:
$ ldd /opt/rocm/lib/libhsa-runtime64.so.1 | grep rocm_sysdeps
librocm_sysdeps_elf.so.1 => /opt/rocm/lib/rocm_sysdeps/lib/...
librocm_sysdeps_drm.so.2 => /opt/rocm/lib/rocm_sysdeps/lib/...
librocm_sysdeps_drm_amdgpu.so.1 => /opt/rocm/lib/rocm_sysdeps/lib/...
librocm_sysdeps_numa.so.1 => ...
librocm_sysdeps_z.so.1 / zstd / liblzma / bz2 => ...
(libamdhip64.so has the same set, so any ROCm/HIP user gets them into the
global scope before the Vulkan loader dlopens the ICD)
So the hazard is not specific to libdrm_amdgpu: any of these 71 libraries can
interpose on its system counterpart the same way. It is just that for libdrm the
consequence happens to be fatal, because Mesa 26.2 turns a missing advisory query
into a hard failure.
Note the specificity of the trigger: preloading only the non-amdgpu
librocm_sysdeps_drm.so.2 does *not* break RADV (device enumerated normally) - it is
the libdrm_amdgpu copy that matters.
Both affected machines use such TheRock builds (one for gfx1150, one for gfx1035).
The sysdeps layer is common to the per-GPU artifacts, which is why both machines
show the very same interposing library path and the very same return values.
=== Why the other observations follow ===
* vulkaninfo / a plain Vulkan test program work: they do not load ROCm, so RADV
binds to the system libdrm (verified with any instance-extension/apiVersion/
pNext combination - not an instance-configuration issue).
* AMDVLK works: it does not use this libdrm VA-manager/PRT API.
* The kernel log is clean: failure is entirely in userspace, before any ioctl.
* Rebuilding Mesa from git does not help: any Mesa calls the same API, and the
mismatched library wins by load order.
* Mesa 26.2.4 treats the failure as fatal for input (only) from the “wrong” libdrm.
=== Workarounds (verified) ===
* Force the system libdrm into the process first - RADV device appears:
$ VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/radeon_icd.x86_64.json \\
LD_PRELOAD=/usr/lib64/libdrm_amdgpu.so.1 llama-cli --list-devices
Available devices:
ROCm0: AMD Radeon 890M Graphics (15542 MiB, 15321 MiB free)
Vulkan0: AMD Radeon 890M Graphics (RADV STRIX1) (16054 MiB, 5112 MiB free)
* Using AMDVLK for the Vulkan workload (no libdrm dependency for this API).
* Not loading the ROCm backend in the same process.
Note this affects any process mixing a ROCm runtime with RADV. Which bundled copy
is “old” has to be checked per component, not assumed by its version string: the
libdrm inside Ollama’s ROCm bundle is named libdrm_amdgpu.so.1.133.0 but does
implement the query (verified: it returns 0, so it is built from libdrm >= 2.4.132
and is *not* a trigger), while the ROCm sysdeps copy is. A one-liner classification
of every copy found on the system:
for f in $(find / -name 'libdrm_amdgpu\*.so\*' 2>/dev/null); do
printf '%-70s ' "$f"
LD_PRELOAD="$f" ./drmprobe2 2>/dev/null | sed -n 's/.\*prt_wa_control_bit) = //p'
done
=== Suggested fixes ===
-
ROCm / TheRock (the actual source here): the sysdeps layer must not interpose on
system libraries. Renaming the SONAME is not enough, because every symbol is
exported with a *default* version (@@AMDROCM_SYSDEPS_1.0), which satisfies
unversioned references from unrelated libraries. Options:
- update the bundled libdrm in sysdeps to >= 2.4.132 (it is pinned at 2.4.127
in TheRock 7.12.0/7.14.0; this fixes the symptom, but leaves the
interposition hazard for the other 70 libraries);
- or stop exporting these symbols globally: link the sysdeps libraries with a
version script that makes everything local except a rocm_-prefixed set, and
free the unprefixed names; or
- or load them with dlopen(…, RTLD_LOCAL|RTLD_DEEPBIND) instead of listing
them as DT_NEEDED of libhsa-runtime64/libamdhip64.
Venue: upstream ROCm/TheRock (GitHub - ROCm/TheRock: The HIP Environment and ROCm Kit - A lightweight open source build system for HIP and ROCm · GitHub). Not something Fedora can
fix: the tree is not rpm-owned (and Fedora’s own rocm packages are a separate
installation here).
-
Mesa (RADV): do not abort physical device creation when this advisory query
fails. libdrm documents the value as “should be ignored”; Mesa could degrade
gracefully (treat the PRT workaround bit as unavailable / disable the NULL PRT
workaround) instead of returning AC_QUERY_GPU_INFO_FAIL, or at least only fail
when sparse residency is actually requested. This is the part Fedora can act on.
-
Loader-side hardening (Vulkan-Loader / distro build): dlopen ICDs with
RTLD_DEEPBIND so an ICD prefers its own libdrm over an earlier copy from an
unrelated vendor library.
Upstream venues: Making sure you're not a bot! (radv/amdgpu),
GitHub - ROCm/TheRock: The HIP Environment and ROCm Kit - A lightweight open source build system for HIP and ROCm · GitHub and GitHub - ROCm/legacy-rocm-build: AMD ROCm™ Software - GitHub Home · GitHub (sysdeps layer exporting
unprefixed, default-versioned symbols into the global scope).