AMDGPU error on Fedora 40

When I run using AMDGPU I get the error message

: CommandLine Error: Option 'disassemble' registered more than once!
LLVM ERROR: inconsistency in registered CommandLine options

[10292] signal (6.-6): Aborted
in expression starting at REPL[1]:1
__pthread_kill_implementation at /lib64/libc.so.6 (unknown line)
gsignal at /lib64/libc.so.6 (unknown line) 
abort at /lib64/libc.so.6 (unknown line)

followed by a few screenfuls and finishing with```
: CommandLine Error: Option ‘disassemble’ registered more than once!
LLVM ERROR: inconsistency in registered CommandLine options

[10292] signal (6.-6): Aborted
in expression starting at REPL[1]:1
__pthread_kill_implementation at /lib64/libc.so.6 (unknown line)
gsignal at /lib64/libc.so.6 (unknown line)
abort at /lib64/libc.so.6 (unknown line)

followed by a few screenfuls and finishing with

jl_apply at /cache/build/builder-amdci4-4/julialang/julia-release-1-dot-10/src/julia.h:1982 [inlined]
true_main at /cache/build/builder-amdci4-4/julialang/julia-release-1-dot-10/src/jlapi.c:582
jl_repl_entrypoint at /cache/build/builder-amdci4-4/julialang/julia-release-1-dot-10/src/jlapi.c:731
main at /cache/build/builder-amdci4-4/julialang/julia-release-1-dot-10/cli/loader_exe.c:58
__libc_start_call_main at /lib64/libc.so.6 (unknown line)
__libc_start_main at /lib64/libc.so.6 (unknown line)
unknown function (ip: 0x4010b8)
Allocations: 1447137 (Pool: 1446180; Big: 957); GC: 2
Aborted (core dumped)```

I have installed the Fedora ROCm packages and can run pytorch on my rX 6600 XT
(with HSA_OVERRIDE_GFX_VERSION=10.3.0). Output from rocminfo,
rocm-clinfo and rocm-smi all seems as expected. After installing Ubuntu 24.04 on
another partition and installing the Ubuntu ROCm packages, AMDGPU worked fine:```
julia> AMDGPU.versioninfo()
[ Info: AMDGPU versioninfo
┌───────────┬──────────────────┬───────────┬──────────────────────────────────────────
│ Available │ Name │ Version │ Path ⋯
├───────────┼──────────────────┼───────────┼──────────────────────────────────────────
│ + │ LLD │ - │ /opt/rocm/llvm/bin/ld.lld ⋯
│ + │ Device Libraries │ - │ /home/bill/.julia/artifacts/5ad5ecb46e3 ⋯
│ + │ HIP │ 6.2.41134 │ /opt/rocm-6.2.1/lib/libamdhip64.so ⋯
│ + │ rocBLAS │ 4.2.1 │ /opt/rocm-6.2.1/lib/librocblas.so ⋯
│ + │ rocSOLVER │ 3.26.0 │ /opt/rocm-6.2.1/lib/librocsolver.so ⋯
│ + │ rocALUTION │ - │ /opt/rocm-6.2.1/lib/librocalution.so ⋯
│ + │ rocSPARSE │ - │ /opt/rocm-6.2.1/lib/librocsparse.so ⋯
│ + │ rocRAND │ 2.10.5 │ /opt/rocm-6.2.1/lib/librocrand.so ⋯
│ + │ rocFFT │ 1.0.27 │ /opt/rocm-6.2.1/lib/librocfft.so ⋯
│ + │ MIOpen │ 3.2.0 │ /opt/rocm-6.2.1/lib/libMIOpen.so ⋯
└───────────┴──────────────────┴───────────┴──────────────────────────────────────────
1 column omitted

[ Info: AMDGPU devices
┌────┬───────────────────────┬──────────┬───────────┬───────────┐
│ Id │ Name │ GCN arch │ Wavefront │ Memory │
├────┼───────────────────────┼──────────┼───────────┼───────────┤
│ 1 │ AMD Radeon RX 6600 XT │ gfx1030 │ 32 │ 7.984 GiB │
└────┴───────────────────────┴──────────┴───────────┴───────────┘

This is because one of ROCm libraries on Fedora 40 links LLVM statically in itself, which it shouldn’t do and because Julia has its own LLVM and it conflicts with it.
Pytorch won’t have this issue because of that.

And since Ubuntu is officially supported it “correctly” build them, without linking LLVM statically.
You can try latest master branch of AMDGPU it may help, but if not then the only way is to rebuild without statically linking LLVM.

Thanks for your explanation. Do you know which Fedora package is to blame?

I think it might be rocBLAS or MIOpen. You can use libtree to see if it’s linking against ROCm LLVM