FAQ
How do I check that AMDGPU.jl works?
AMDGPU.functional() returns true when the ROCm stack is available and a GPU can be used. For a full report of detected devices, libraries and versions, use AMDGPU.versioninfo().
using AMDGPU
AMDGPU.functional() # true if AMDGPU.jl can run on this machine
AMDGPU.versioninfo() # detailed diagnosticsHow should a package depend on AMDGPU.jl?
AMDGPU.jl loads on any machine, but only works when ROCm and a supported GPU are present. Code that should run with or without a GPU must therefore guard GPU use behind AMDGPU.functional() rather than assume it — importing the package is not enough.
using AMDGPU
if AMDGPU.functional()
x = AMDGPU.ones(Float32, 1024) # run on the GPU
else
x = ones(Float32, 1024) # CPU fallback
endFor a hard requirement of GPU hardware specifically, has_rocm_gpu() additionally checks that at least one device is present. For a heavier optional dependency, prefer a package extension that loads only when AMDGPU is available, following the pattern used by the wider Julia GPU ecosystem.
Which ROCm libraries are available?
Individual components are queried with AMDGPU.functional(component), useful when a feature depends on a specific library:
AMDGPU.functional(:rocblas) # dense linear algebra (rocBLAS)
AMDGPU.functional(:rocsolver) # factorizations (rocSOLVER)
AMDGPU.functional(:rocsparse) # sparse arrays (rocSPARSE)
AMDGPU.functional(:rocfft) # FFTs (rocFFT)
AMDGPU.functional(:rocrand) # random numbers (rocRAND)
AMDGPU.functional(:MIOpen) # deep-learning primitives (MIOpen)
AMDGPU.functional(:all) # true only if every component is availableMy GPU is not detected or a library is missing
Run AMDGPU.versioninfo(): its first line names the ROCm provider, and the table shows which components are functional. With the downloaded artifacts (the default), every component being unavailable means that no bundle was resolved for the GPUs detected on the host, which AMDGPU.jl also warns about when it loads: check that the GPU driver is loaded and the device accessible (on Linux, /dev/kfd), or pin the architecture with AMDGPU.set_rocm_version!(arch="gfx942"). With a local ROCm, a missing component means that its package is not installed or that ROCM_PATH does not point at the installation. See Installation for both.
AMDGPU.jl warns about libraries or variables from another ROCm
With the downloaded artifacts, a ROCm reachable through LD_LIBRARY_PATH (an environment module, a uenv, AMD's containers), or pointed to by LLVM_PATH, HIP_DEVICE_LIB_PATH or DEVICE_LIB_PATH, gets loaded next to the bundle's libraries, so two ROCm versions are live in one process. Compilation then fails or produces wrong results, usually reported as an unrelated error. AMDGPU.versioninfo() lists the foreign libraries and the redirecting variables. Unset them before starting Julia, or opt into that ROCm with AMDGPU.set_rocm_version!(local_rocm=true).
I installed ROCm 7.14 or newer but it isn't detected
This applies to a local ROCm installation. ROCm 7.14 changed its on-disk layout, installing libraries under a versioned core-<version> subdirectory (for example /opt/rocm/core-7.14/lib). AMDGPU.jl discovers this automatically, but if detection fails on a minimal or custom install, make sure ROCM_PATH points at the ROCm root (e.g. /opt/rocm) rather than at the versioned subdirectory. See Installation for details.
Can I use the integrated GPU of my Ryzen CPU?
The Radeon graphics of Ryzen 7000 and 9000 desktop CPUs (Raphael/Granite Ridge, gfx1036) works, even though ROCm does not officially support it (tested with ROCm 7.2 on Linux). It is small (2 compute units) and shares system memory, so it is mainly useful for development and testing. Kernels, arrays, rocBLAS, rocSOLVER, rocSPARSE, rocRAND, rocFFT and MIOpen work; hipTENSOR has no kernels for this architecture and is reported as unavailable.
On this GPU, kernel results can be silently lost when the host does not synchronize shortly after a launch: the GPU's idle clock gating discards data that is still in its L2 cache. The workaround is to make HIP write back the cache after every kernel ("system-scope fences"), at a small cost per launch. HIP reads this setting once, at initialization, and applies it to all GPUs used by the process, so it is controlled by the system_scope_fences preference:
"auto"(default): enabled when every AMD GPU in the system needs it, e.g., when the integrated GPU is your only AMD GPU. On systems that also have a dedicated AMD GPU, the workaround is not enabled, so as not to slow that GPU down, and AMDGPU.jl warns when you use the integrated GPU. GPUs hidden withROCR_VISIBLE_DEVICESorHIP_VISIBLE_DEVICESdon't count.trueorfalse: always or never enable the workaround, also on GPUs that AMDGPU.jl does not know to be affected.
Change it with AMDGPU.system_scope_fences!(true) (or false, "auto") and restart Julia. Setting the AMD_OPT_FLUSH environment variable overrides the preference: AMD_OPT_FLUSH=0 enables the workaround, other numbers disable it. The workaround is implemented by setting AMD_OPT_FLUSH=0 when AMDGPU.jl is loaded, so it is inherited by subprocesses, and it has no effect if another library initialized HIP before AMDGPU.jl was loaded.
If you also have a dedicated AMD GPU, see Installation on selecting a device with HIP_VISIBLE_DEVICES.
I'm on Arch Linux and ROCm isn't working
This applies to a local ROCm installation. For the last few ROCm releases, users have reported problems with the distro-provided ROCm builds and associated tools (#770, #696, #767). Some have had success with the opencl-amd-dev AUR package instead.
More recent official packages work: the full test suite passes with ROCm 7.2.4 from the Arch repositories, installed with pacman -S hip-runtime-amd plus the libraries you need (rocblas, rocsparse, rocsolver, rocrand, rocfft, miopen-hip).
How do I control GPU memory usage?
ROCArrays are managed by Julia's garbage collector, and a HIP memory pool caches freed allocations. You can free eagerly, cap usage, and query current usage — see the Memory Allocation and Intrinsics page for AMDGPU.unsafe_free!, memory limits, and the caching allocator.
Where can I get help?
Ask on the Julia Discourse GPU domain or the #gpu channel of the Julia Slack. Bug reports and feature requests are welcome on the issue tracker.