Skip to content

System and Configuration

Checking the installation

AMDGPU.versioninfo() prints a full report of detected ROCm libraries, their versions, and the available devices. AMDGPU.functional() returns whether AMDGPU.jl can run at all, and AMDGPU.functional(component) queries an individual ROCm component (see FAQ for the component list). has_rocm_gpu() additionally requires that a GPU device is present.

AMDGPU.versioninfo Function
julia
versioninfo(io::IO=stdout)

Print a report of the AMDGPU.jl setup: detected ROCm libraries and their versions, tool paths, and the available GPU devices. Useful as a first diagnostic when something is missing or not working.

source
AMDGPU.functional Function
julia
functional() -> Bool

Returns true if AMDGPU is nominally functional; "functional" currently means that HSA, HIP, lld, and device libraries are available (although it does not imply that usages of these components will be successful).

Packages may use the result of this query to determine whether it is safe to:

  • Use AMDGPU to compile code

  • Query devices, queues, and other runtime state

  • Launch compiled kernels on a device

  • Wait on launched kernels to complete

  • Utilize external ROCm libraries (rocBLAS et. al)

If the full compilation and launch pipeline is desired, then this query should be sufficient for most packages and applications. This query combines sub-queries of multiple components; a failing sub-query will propagate to a false return value. For more fine-grained queries, use functional(::Symbol).

This query should never throw.

source
julia
functional(component::Symbol) -> Bool

Returns true if the ROCm component component is configured and expected to function correctly. Available component values are:

  • :hip - Queries HIP library availability

  • :lld - Queries ld.lld tool availability

  • :device_libs - Queries ROCm device libraries availability

  • :rocblas - Queries rocBLAS library availability

  • :rocsolver - Queries rocSOLVER library availability

  • :rocsparse - Queries rocSPARSE library availability

  • :rocrand - Queries rocRAND library availability

  • :rocfft - Queries rocFFT library availability

  • :MIOpen - Queries MIOpen library availability

  • :all - Queries all above components

This query should never throw for valid component values.

source
AMDGPU.has_rocm_gpu Function
julia
has_rocm_gpu() -> Bool

Return true if HIP is functional and at least one GPU device is present. Use this to guard code that specifically requires GPU hardware; for a general "can AMDGPU.jl run here" check prefer AMDGPU.functional.

source

Configuration preferences

Several behaviours are configured through Preferences.jl and persist across sessions (they are written to your project's LocalPreferences.toml):

PreferenceSet viaEffect
nonblocking_synchronizepreferenceUse non-blocking stream synchronization (default true); disable for slightly lower latency. See Streams.
eager_gcAMDGPU.eager_gc!(::Bool)Trigger GC before allocations under memory pressure. See Memory Allocation and Intrinsics.
hard_memory_limitAMDGPU.hard_memory_limit!("8 GiB")Hard cap on GPU memory, checked before every allocation.
soft_memory_limitAMDGPU.soft_memory_limit!("6 GiB")Advisory limit for the memory pool.

Debugging kernel launches

Set the environment variable HIP_LAUNCH_BLOCKING=1 (or toggle AMDGPU.LAUNCH_BLOCKING[] = true at runtime) to make kernel launches synchronous. This makes errors surface at the offending launch rather than at a later synchronization point, which is invaluable when tracking down a crashing or misbehaving kernel.