Repository navigation
[Issue]: Legacy ROCm 6.4.2 OpenCL packaging shadows Ubuntu ROCm 7.1 HSA runtime via ldconfig #9562
Description
Problem Description
I encountered a shared-library resolution conflict between legacy AMD ROCm 6.4.2 packages and the ROCm 7.1 packages supplied by Ubuntu 26.04.1 LTS.
The legacy AMD rocm-opencl package, originally built for Ubuntu 24.04, registers /opt/rocm-6.4.2/lib globally through /etc/ld.so.conf.d/10-rocm-opencl.conf.
Consequently, Ubuntu's HIP 7.1 installation resolved libhsa-runtime64.so.1 from ROCm 6.4.2 instead of the distribution-provided HSA runtime.
Compiling a HIP application targeting gfx1010 failed at the linking stage:
undefined reference to hsa_amd_memory_get_preferred_copy_engine@ROCR_1
The required symbol was present in Ubuntu's HSA runtime but absent from the older ROCm 6.4.2 runtime.
The package's installation script contains:
echo ${INSTALL_PATH}/lib > /etc/ld.so.conf.d/10-rocm-opencl.conf && ldconfigAfter disabling the legacy global library-path configuration and running ldconfig, the HIP application compiled and executed successfully:
HIP devices: 1
GPU: AMD Radeon RX 5700 XT
GPU result: 42
The legacy OpenCL implementation also remained functional after configuring its ICD with an absolute path to /opt/rocm-6.4.2/lib/libamdocl64.so:
GPU: gfx1010:xnack-
OpenCL result: 42
Both computational tests succeeded after the workaround on Ubuntu's 7.0.0-42-generic kernel and on a separately tested Linux 7.2.10 kernel.
I understand that mixing ROCm packages intended for different Ubuntu releases may be unsupported. This report is intended to clarify whether the global library registration performed by legacy OpenCL packages is expected, and whether current ROCm packaging offers a mechanism to prevent older HSA runtimes from shadowing distribution-provided libraries.
I am not reporting this as a confirmed issue in current TheRock packages or as a Linux kernel regression.
Related: #6716 (dynamic-loader registration, different failure mode).
Operating System
Ubuntu 26.04.1 LTS (Resolute Raccoon), Linux 7.0.0-42-generic
CPU
Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
GPU
AMD Radeon RX 5700 XT (Navi 10, gfx1010, RDNA 1)
ROCm Version
AMD ROCm 6.4.2 (legacy OpenCL) + Ubuntu ROCm 7.1 (HIP/HSA)
Installation Method
Package manager
Installed ROCm Packages / Versions
Installation method: Debian packages managed through APT/dpkg.
The system contains both legacy AMD ROCm 6.4.2 packages originally built for Ubuntu 24.04 and Ubuntu-provided ROCm 7.1 components on Ubuntu 26.04.1 LTS.
Legacy AMD packages:
rocm-core 6.4.2.60402-120~24.04
rocm-opencl 2.0.0.60402-120~24.04
rocm-opencl-runtime 6.4.2.60402-120~24.04
hsa-rocr 1.15.0.60402-120~24.04
hip-runtime-amd 6.4.43484.60402-120~24.04
hip-dev 6.4.43484.60402-120~24.04
rocm-llvm 19.0.0.25224.60402-120~24.04
amdgpu-core 1:6.4.60402-2187269.24.04
Ubuntu-provided packages:
rocm 7.1.0-0ubuntu6
rocm-dev 7.1.0-0ubuntu6
hipcc 7.1.1+dfsg-0ubuntu1
libamdhip64-7 7.1.0-0ubuntu2
libamdhip64-dev 7.1.0-0ubuntu2
libhsa-runtime64-1 7.1.0+dfsg-0ubuntu9
libhsa-runtime-dev 7.1.0+dfsg-0ubuntu9
libhsakmt1 7.1.0+dfsg-0ubuntu9
Additional AMD installer packages:
amdgpu-install 31.60.0.0.31600000-2407772.26.04
amdgpu-dkms-firmware 1:31.60.0.0.31600000-2407772.26.04
Additional HIP libraries, including both legacy AMD and Ubuntu-provided components, are installed. A complete package inventory can be provided.
The original failure was traced to the older HSA runtime being selected through the global dynamic-linker configuration installed by rocm-opencl. After disabling that configuration, Ubuntu's HSA runtime was selected and the HIP test executed successfully.
ROCm Component
No response
Steps to Reproduce
Original environment
-
An existing AMD ROCm 6.4.2 installation, packaged for Ubuntu 24.04, was retained alongside Ubuntu 26.04.1 LTS packages providing HIP 7.1 and ROCr/HSA 7.1.
-
The legacy
rocm-openclpackage registered the following directory through/etc/ld.so.conf.d/10-rocm-opencl.conf:/opt/rocm-6.4.2/lib -
The dynamic linker consequently selected the legacy HSA runtime for Ubuntu's HIP library:
/opt/rocm-6.4.2/lib/libhsa-runtime64.so.1 -
Compiling a HIP test application targeting the Navi 10 GPU with:
hipcc --offload-arch=gfx1010 /tmp/test-gfx1010.hip -o /tmp/test-gfx1010
failed with:
undefined reference to hsa_amd_memory_get_preferred_copy_engine@ROCR_1
Diagnostic
Temporarily prioritising Ubuntu's library directory allowed the HIP application to link:
LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu hipcc --offload-arch=gfx1010 /tmp/test-gfx1010.hip -o /tmp/test-gfx1010Verified workaround
The obsolete global ROCm library configuration was disabled, followed by sudo ldconfig.
The HSA library then resolved to:
/usr/lib/x86_64-linux-gnu/libhsa-runtime64.so.1
The HIP test compiled and executed successfully:
HIP devices: 1
GPU: AMD Radeon RX 5700 XT
GPU result: 42
The legacy OpenCL ICD was configured to reference its implementation using an absolute library path. A separate OpenCL kernel also executed successfully and returned 42.
Note: These steps document the original failure and the verified workaround. The failure has not been deliberately reproduced again on the corrected system. The legacy library configuration should not be re-enabled on a working installation solely to reproduce this issue.
(Optional for Linux users) Output of rocminfo --support
The following rocminfo --support output was collected on Ubuntu 7.0.0-42-generic after applying the library-path workaround.
rocminfo --support output
ïŋ―[37mROCk module is loadedïŋ―[0m
=====================
HSA System Attributes
=====================
Runtime Version: 1.1
Runtime Ext Version: 1.14
System Timestamp Freq.: 1000.000000MHz
Sig. Max Wait Duration: 18446744073709551615 (0xFFFFFFFFFFFFFFFF) (timestamp count)
Machine Model: LARGE
System Endianness: LITTLE
Mwaitx: DISABLED
XNACK enabled: NO
DMAbuf Support: YES
VMM Support: YES
==========
HSA Agents
==========
*******
Agent 1
*******
Name: Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
Uuid: CPU-XX
Marketing Name: Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
Vendor Name: CPU
Feature: None specified
Profile: FULL_PROFILE
Float Round Mode: NEAR
Max Queue Number: 0(0x0)
Queue Min Size: 0(0x0)
Queue Max Size: 0(0x0)
Queue Type: MULTI
Node: 0
Device Type: CPU
Cache Info:
L1: 32768(0x8000) KB
Chip ID: 0(0x0)
ASIC Revision: 0(0x0)
Cacheline Size: 64(0x40)
Max Clock Freq. (MHz): 5000
BDFID: 0
Internal Node ID: 0
Compute Unit: 16
SIMDs per CU: 0
Shader Engines: 0
Shader Arrs. per Eng.: 0
WatchPts on Addr. Ranges:1
Memory Properties:
Features: None
Pool Info:
Pool 1
Segment: GLOBAL; FLAGS: FINE GRAINED
Size: 63387956(0x3c73934) KB
Allocatable: TRUE
Alloc Granule: 4KB
Alloc Recommended Granule:4KB
Alloc Alignment: 4KB
Accessible by all: TRUE
Pool 2
Segment: GLOBAL; FLAGS: EXTENDED FINE GRAINED
Size: 63387956(0x3c73934) KB
Allocatable: TRUE
Alloc Granule: 4KB
Alloc Recommended Granule:4KB
Alloc Alignment: 4KB
Accessible by all: TRUE
Pool 3
Segment: GLOBAL; FLAGS: KERNARG, FINE GRAINED
Size: 63387956(0x3c73934) KB
Allocatable: TRUE
Alloc Granule: 4KB
Alloc Recommended Granule:4KB
Alloc Alignment: 4KB
Accessible by all: TRUE
Pool 4
Segment: GLOBAL; FLAGS: COARSE GRAINED
Size: 63387956(0x3c73934) KB
Allocatable: TRUE
Alloc Granule: 4KB
Alloc Recommended Granule:4KB
Alloc Alignment: 4KB
Accessible by all: TRUE
ISA Info:
*******
Agent 2
*******
Name: gfx1010
Uuid: GPU-XX
Marketing Name: AMD Radeon RX 5700 XT
Vendor Name: AMD
Feature: KERNEL_DISPATCH
Profile: BASE_PROFILE
Float Round Mode: NEAR
Max Queue Number: 128(0x80)
Queue Min Size: 64(0x40)
Queue Max Size: 131072(0x20000)
Queue Type: MULTI
Node: 1
Device Type: GPU
Cache Info:
L1: 16(0x10) KB
L2: 4096(0x1000) KB
Chip ID: 29471(0x731f)
ASIC Revision: 2(0x2)
Cacheline Size: 128(0x80)
Max Clock Freq. (MHz): 2100
BDFID: 768
Internal Node ID: 1
Compute Unit: 40
SIMDs per CU: 2
Shader Engines: 2
Shader Arrs. per Eng.: 2
WatchPts on Addr. Ranges:4
Coherent Host Access: FALSE
Memory Properties:
Features: KERNEL_DISPATCH
Fast F16 Operation: TRUE
Wavefront Size: 32(0x20)
Workgroup Max Size: 1024(0x400)
Workgroup Max Size per Dimension:
x 1024(0x400)
y 1024(0x400)
z 1024(0x400)
Max Waves Per CU: 40(0x28)
Max Work-item Per CU: 1280(0x500)
Grid Max Size: 4294967295(0xffffffff)
Grid Max Size per Dimension:
x 2147483647(0x7fffffff)
y 65535(0xffff)
z 65535(0xffff)
Max fbarriers/Workgrp: 32
Packet Processor uCode:: 157
SDMA engine uCode:: 35
IOMMU Support:: None
Pool Info:
Pool 1
Segment: GLOBAL; FLAGS: COARSE GRAINED
Size: 8372224(0x7fc000) KB
Allocatable: TRUE
Alloc Granule: 4KB
Alloc Recommended Granule:2048KB
Alloc Alignment: 4KB
Accessible by all: FALSE
Pool 2
Segment: GLOBAL; FLAGS: EXTENDED FINE GRAINED
Size: 8372224(0x7fc000) KB
Allocatable: TRUE
Alloc Granule: 4KB
Alloc Recommended Granule:2048KB
Alloc Alignment: 4KB
Accessible by all: FALSE
Pool 3
Segment: GROUP
Size: 64(0x40) KB
Allocatable: FALSE
Alloc Granule: 0KB
Alloc Recommended Granule:0KB
Alloc Alignment: 0KB
Accessible by all: FALSE
ISA Info:
ISA 1
Name: amdgcn-amd-amdhsa--gfx1010:xnack-
Machine Models: HSA_MACHINE_MODEL_LARGE
Profiles: HSA_PROFILE_BASE
Default Rounding Mode: NEAR
Default Rounding Mode: NEAR
Fast f16: TRUE
Workgroup Max Size: 1024(0x400)
Workgroup Max Size per Dimension:
x 1024(0x400)
y 1024(0x400)
z 1024(0x400)
Grid Max Size: 4294967295(0xffffffff)
Grid Max Size per Dimension:
x 2147483647(0x7fffffff)
y 65535(0xffff)
z 65535(0xffff)
FBarrier Max Size: 32
ISA 2
Name: amdgcn-amd-amdhsa--gfx10-1-generic:xnack-
Machine Models: HSA_MACHINE_MODEL_LARGE
Profiles: HSA_PROFILE_BASE
Default Rounding Mode: NEAR
Default Rounding Mode: NEAR
Fast f16: TRUE
Workgroup Max Size: 1024(0x400)
Workgroup Max Size per Dimension:
x 1024(0x400)
y 1024(0x400)
z 1024(0x400)
Grid Max Size: 4294967295(0xffffffff)
Grid Max Size per Dimension:
x 2147483647(0x7fffffff)
y 65535(0xffff)
z 65535(0xffff)
FBarrier Max Size: 32
*** Done ***
Additional Information
Package ownership and library resolution
The legacy rocm-opencl package owns:
/etc/ld.so.conf.d/10-rocm-opencl.conf
Its package maintenance script contains:
echo ${INSTALL_PATH}/lib > /etc/ld.so.conf.d/10-rocm-opencl.conf && ldconfigAfter the workaround, the following Ubuntu libraries are selected:
libhsa-runtime64.so.1 => /usr/lib/x86_64-linux-gnu/libhsa-runtime64.so.1
libhsakmt.so.1 => /usr/lib/x86_64-linux-gnu/libhsakmt.so.1
libdrm.so.2 => /usr/lib/x86_64-linux-gnu/libdrm.so.2
libdrm_amdgpu.so.1 => /usr/lib/x86_64-linux-gnu/libdrm_amdgpu.so.1
No active /etc/ld.so.conf.d/*.conf entry currently references /opt/rocm or /opt/amdgpu.
HIP and OpenCL kernel execution were verified after the workaround on both Linux 7.2.10 and Ubuntu's 7.0.0-42-generic kernel.
Clarification requested
I understand that AMD ROCm 6.4.2 packages built for Ubuntu 24.04 may not be supported on Ubuntu 26.04.1 LTS.
I would appreciate clarification on whether the legacy global library registration is an expected packaging limitation and how current TheRock packages handle library isolation when distribution-provided ROCm components are also installed.
Related issue: #6716 (different dynamic-loader registration problem).
.
Drafting assistance: This issue was prepared with AI-assisted writing. All technical observations, package versions, diagnostic commands and test results were independently verified by me on my local system.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsTODO
Activity