AMDGPU.versioninfo() trips an assertion in AMD's code

(workaround)

If no better solution is available,
you might want to try running Julia+ROCm in Docker.
The main advantage is that it makes testing different ROCm and Julia combinations much simpler.

Here’s my sample Dockerfile that you can adapt:

# Set base ROCm version - https://hub.docker.com/r/rocm/dev-ubuntu-22.04/tags
#FROM rocm/dev-ubuntu-22.04:6.3.1-complete
FROM rocm/dev-ubuntu-22.04:6.2.4-complete
RUN set -eux ; \
    apt-get update \
    && apt-get install -yqq --no-install-suggests --no-install-recommends \
        build-essential \
        sudo \
        time \
        wget \
        zstd \
    \
    && rm -rf /var/lib/apt/lists/* /tmp/*
# https://github.com/ROCm/ROCm/discussions/2631
# Radeon 780M (gfx1103) 
ENV HSA_OVERRIDE_GFX_VERSION=11.0.3
# For Julia 1.11 set JULIA_LLVM_ARGS="-opaque-pointers" to enable opaque pointers and use system-wide device libraries, instead of patched from artifacts.
ENV JULIA_LLVM_ARGS="-opaque-pointers"
#Some settings
ENV JULIA_NUM_THREADS: 4
ENV JULIA_AMDGPU_CORE_MUST_LOAD: "1"
ENV JULIA_AMDGPU_HIP_MUST_LOAD: "1"
ENV JULIA_AMDGPU_DISABLE_ARTIFACTS: "1"
# add zen4 cpu target
ENV JULIA_CPU_TARGET="generic;sandybridge,-xsaveopt,clone_all;haswell,-rdrnd,base(1);x86-64-v4,-rdrnd,base(1);znver4,-rdrnd,base(1)"
# set julia version
ENV JULIA_MAJOR=1.11
ENV JULIA_VERSION=1.11.3
ENV JULIA_SHA256=7d48da416c8cb45582a1285d60127ee31ef7092ded3ec594a9f2cf58431c07fd
ENV JULIA_DIR=/usr/local/julia
ENV JULIA_PATH=${JULIA_DIR}
ENV JULIA_DEPOT_PATH=${JULIA_PATH}/local/share/julia
# Install julia
RUN set -eux \
    && mkdir ${JULIA_DIR} \
    && cd /tmp  \
    && wget -q https://julialang-s3.julialang.org/bin/linux/x64/${JULIA_MAJOR}/julia-${JULIA_VERSION}-linux-x86_64.tar.gz \
    && echo "$JULIA_SHA256 julia-${JULIA_VERSION}-linux-x86_64.tar.gz" | sha256sum -c - \
    && tar xzf julia-${JULIA_VERSION}-linux-x86_64.tar.gz -C ${JULIA_DIR} --strip-components=1 \
    && rm /tmp/julia-${JULIA_VERSION}-linux-x86_64.tar.gz \
    && ln -fs ${JULIA_DIR}/bin/julia /usr/local/bin/julia \
    && julia -e 'using Pkg; Pkg.add(["AMDGPU", "CpuId", "CSV", "JSON3" ]);Pkg.precompile()' \
    && julia -e 'using CpuId, CSV, JSON3 ;' \
    && julia -e 'using InteractiveUtils; versioninfo()'

test

# build
docker build --progress=plain --network=host  -t julia-rocm .

# run 
alias drun='sudo docker run -it --network=host --device=/dev/kfd --device=/dev/dri --group-add=video --ipc=host --cap-add=SYS_PTRACE --security-opt seccomp=unconfined --shm-size 8G -v $HOME/dockerx:/dockerx -w /dockerx'

drun julia-rocm

julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.11.3 (2025-01-21)
 _/ |\__'_|_|_|\__'_|  |  Official https://julialang.org/ release
|__/                   |

julia> using AMDGPU; AMDGPU.versioninfo();
[ Info: AMDGPU versioninfo
┌───────────┬──────────────────┬───────────┬───────────────────────────────┐
│ Available │ Name             │ Version   │ Path                          │
├───────────┼──────────────────┼───────────┼───────────────────────────────┤
│     +     │ LLD              │ -         │ /opt/rocm/llvm/bin/ld.lld     │
│     +     │ Device Libraries │ -         │ /opt/rocm/amdgcn/bitcode      │
│     +     │ HIP              │ 6.2.41134 │ /opt/rocm/lib/libamdhip64.so  │
│     +     │ rocBLAS          │ 4.2.4     │ /opt/rocm/lib/librocblas.so   │
│     +     │ rocSOLVER        │ 3.26.2    │ /opt/rocm/lib/librocsolver.so │
│     +     │ rocSPARSE        │ -         │ /opt/rocm/lib/librocsparse.so │
│     +     │ rocRAND          │ 2.10.5    │ /opt/rocm/lib/librocrand.so   │
│     +     │ rocFFT           │ 1.0.27    │ /opt/rocm/lib/librocfft.so    │
│     +     │ MIOpen           │ 3.2.0     │ /opt/rocm/lib/libMIOpen.so    │
└───────────┴──────────────────┴───────────┴───────────────────────────────┘

[ Info: AMDGPU devices
┌────┬─────────────────────┬──────────┬───────────┬────────────┬───────────────┐
│ Id │                Name │ GCN arch │ Wavefront │     Memory │ Shared Memory │
├────┼─────────────────────┼──────────┼───────────┼────────────┼───────────────┤
│  1 │ AMD Radeon Graphics │  gfx1103 │        32 │ 14.826 GiB │    64.000 KiB │
└────┴─────────────────────┴──────────┴───────────┴────────────┴───────────────┘


julia> x = ROCArray([1.0])
1-element ROCArray{Float64, 1, AMDGPU.Runtime.Mem.HIPBuffer}:
 1.0

1 Like