AMDGPU.jl icon indicating copy to clipboard operation
AMDGPU.jl copied to clipboard

Not working on RDNA4 / gfx1201

Open aaruni96 opened this issue 6 months ago • 17 comments

Questionnaire

  1. Does ROCm works for you outside of Julia, e.g. C/C++/Python?

Yes

  1. Post output of rocminfo.
ROCk module is loaded
=====================    
HSA System Attributes    
=====================    
Runtime Version:         1.1
Runtime Ext Version:     1.7
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:                    AMD Ryzen 9 7900 12-Core Processor 
  Uuid:                    CPU-XX                             
  Marketing Name:          AMD Ryzen 9 7900 12-Core Processor 
  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):   5485                               
  BDFID:                   0                                  
  Internal Node ID:        0                                  
  Compute Unit:            24                                 
  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:                    31940948(0x1e76154) 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:                    31940948(0x1e76154) 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:                    31940948(0x1e76154) 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:                    31940948(0x1e76154) KB             
      Allocatable:             TRUE                               
      Alloc Granule:           4KB                                
      Alloc Recommended Granule:4KB                                
      Alloc Alignment:         4KB                                
      Accessible by all:       TRUE                               
  ISA Info:                
*******                  
Agent 2                  
*******                  
  Name:                    gfx1201                            
  Uuid:                    GPU-27a7a7d52ee60cbb               
  Marketing Name:          AMD Radeon RX 9070 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:                      32(0x20) KB                        
    L2:                      8192(0x2000) KB                    
    L3:                      65536(0x10000) KB                  
  Chip ID:                 30032(0x7550)                      
  ASIC Revision:           1(0x1)                             
  Cacheline Size:          256(0x100)                         
  Max Clock Freq. (MHz):   2400                               
  BDFID:                   768                                
  Internal Node ID:        1                                  
  Compute Unit:            64                                 
  SIMDs per CU:            2                                  
  Shader Engines:          4                                  
  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:        32(0x20)                           
  Max Work-item Per CU:    1024(0x400)                        
  Grid Max Size:           4294967295(0xffffffff)             
  Grid Max Size per Dimension:
    x                        4294967295(0xffffffff)             
    y                        4294967295(0xffffffff)             
    z                        4294967295(0xffffffff)             
  Max fbarriers/Workgrp:   32                                 
  Packet Processor uCode:: 1012                               
  SDMA engine uCode::      838                                
  IOMMU Support::          None                               
  Pool Info:               
    Pool 1                   
      Segment:                 GLOBAL; FLAGS: COARSE GRAINED      
      Size:                    16695296(0xfec000) KB              
      Allocatable:             TRUE                               
      Alloc Granule:           4KB                                
      Alloc Recommended Granule:2048KB                             
      Alloc Alignment:         4KB                                
      Accessible by all:       FALSE                              
    Pool 2                   
      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--gfx1201         
      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                        4294967295(0xffffffff)             
        y                        4294967295(0xffffffff)             
        z                        4294967295(0xffffffff)             
      FBarrier Max Size:       32                                 
    ISA 2                    
      Name:                    amdgcn-amd-amdhsa--gfx12-generic   
      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                        4294967295(0xffffffff)             
        y                        4294967295(0xffffffff)             
        z                        4294967295(0xffffffff)             
      FBarrier Max Size:       32                                 
*******                  
Agent 3                  
*******                  
  Name:                    gfx1036                            
  Uuid:                    GPU-XX                             
  Marketing Name:          AMD Radeon Graphics                
  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:                    2                                  
  Device Type:             GPU                                
  Cache Info:              
    L1:                      16(0x10) KB                        
    L2:                      256(0x100) KB                      
  Chip ID:                 5710(0x164e)                       
  ASIC Revision:           1(0x1)                             
  Cacheline Size:          128(0x80)                          
  Max Clock Freq. (MHz):   2200                               
  BDFID:                   6656                               
  Internal Node ID:        2                                  
  Compute Unit:            2                                  
  SIMDs per CU:            2                                  
  Shader Engines:          1                                  
  Shader Arrs. per Eng.:   1                                  
  WatchPts on Addr. Ranges:4                                  
  Coherent Host Access:    FALSE                              
  Memory Properties:       APU
  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:        32(0x20)                           
  Max Work-item Per CU:    1024(0x400)                        
  Grid Max Size:           4294967295(0xffffffff)             
  Grid Max Size per Dimension:
    x                        4294967295(0xffffffff)             
    y                        4294967295(0xffffffff)             
    z                        4294967295(0xffffffff)             
  Max fbarriers/Workgrp:   32                                 
  Packet Processor uCode:: 22                                 
  SDMA engine uCode::      9                                  
  IOMMU Support::          None                               
  Pool Info:               
    Pool 1                   
      Segment:                 GLOBAL; FLAGS: COARSE GRAINED      
      Size:                    15970472(0xf3b0a8) 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:                    15970472(0xf3b0a8) 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--gfx1036         
      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                        4294967295(0xffffffff)             
        y                        4294967295(0xffffffff)             
        z                        4294967295(0xffffffff)             
      FBarrier Max Size:       32                                 
    ISA 2                    
      Name:                    amdgcn-amd-amdhsa--gfx10-3-generic 
      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                        4294967295(0xffffffff)             
        y                        4294967295(0xffffffff)             
        z                        4294967295(0xffffffff)             
      FBarrier Max Size:       32                                 
*** Done ***             

  1. Post output of AMDGPU.versioninfo() if possible.
julia> AMDGPU.versioninfo()
[ Info: AMDGPU versioninfo
:0:/usr/src/debug/hip-runtime/hip-runtime-clr/hipamd/src/hip_global.cpp:158 : 5486189594 us:  Module not initialized

[85700] signal 6 (-6): Aborted
in expression starting at REPL[4]:1
unknown function (ip: 0x7f5e8d5ec74c)
gsignal at /usr/lib/libc.so.6 (unknown line)
abort at /usr/lib/libc.so.6 (unknown line)
unknown function (ip: 0x7f5de667921e)
unknown function (ip: 0x7f5de6870db3)
unknown function (ip: 0x7f5de68345c1)
unknown function (ip: 0x7f5de683a9da)
unknown function (ip: 0x7f5dade183a2)
rocsparse_create_handle at /opt/rocm/lib/librocsparse.so (unknown line)
macro expansion at /home/aaruni/.julia/packages/AMDGPU/wH6SV/src/sparse/error.jl:80 [inlined]
rocsparse_create_handle at /home/aaruni/.julia/packages/AMDGPU/wH6SV/src/sparse/librocsparse.jl:7
create_handle at /home/aaruni/.julia/packages/AMDGPU/wH6SV/src/sparse/rocSPARSE.jl:31 [inlined]
#5 at /home/aaruni/.julia/packages/AMDGPU/wH6SV/src/cache.jl:115 [inlined]
pop! at /home/aaruni/.julia/packages/AMDGPU/wH6SV/src/cache.jl:49
new_state at /home/aaruni/.julia/packages/AMDGPU/wH6SV/src/cache.jl:114
#9 at /home/aaruni/.julia/packages/AMDGPU/wH6SV/src/cache.jl:127 [inlined]
get! at ./dict.jl:458
library_state at /home/aaruni/.julia/packages/AMDGPU/wH6SV/src/cache.jl:127
lib_state at /home/aaruni/.julia/packages/AMDGPU/wH6SV/src/sparse/rocSPARSE.jl:37 [inlined]
handle at /home/aaruni/.julia/packages/AMDGPU/wH6SV/src/sparse/rocSPARSE.jl:41 [inlined]
version at /home/aaruni/.julia/packages/AMDGPU/wH6SV/src/sparse/rocSPARSE.jl:46
_ver at /home/aaruni/.julia/packages/AMDGPU/wH6SV/src/utils.jl:5 [inlined]
versioninfo at /home/aaruni/.julia/packages/AMDGPU/wH6SV/src/utils.jl:6
unknown function (ip: 0x7f5e0df41a3f)
jl_apply at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/src/julia.h:2157 [inlined]
do_call at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/src/interpreter.c:126
eval_value at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/src/interpreter.c:223
eval_stmt_value at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/src/interpreter.c:174 [inlined]
eval_body at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/src/interpreter.c:666
jl_interpret_toplevel_thunk at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/src/interpreter.c:824
jl_toplevel_eval_flex at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/src/toplevel.c:943
jl_toplevel_eval_flex at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/src/toplevel.c:886
ijl_toplevel_eval_in at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/src/toplevel.c:994
eval at ./boot.jl:430 [inlined]
eval_user_input at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/usr/share/julia/stdlib/v1.11/REPL/src/REPL.jl:261
repl_backend_loop at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/usr/share/julia/stdlib/v1.11/REPL/src/REPL.jl:368
#start_repl_backend#59 at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/usr/share/julia/stdlib/v1.11/REPL/src/REPL.jl:343
start_repl_backend at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/usr/share/julia/stdlib/v1.11/REPL/src/REPL.jl:340
#run_repl#76 at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/usr/share/julia/stdlib/v1.11/REPL/src/REPL.jl:500
run_repl at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/usr/share/julia/stdlib/v1.11/REPL/src/REPL.jl:486
jfptr_run_repl_10123.1 at /home/aaruni/.julia/juliaup/julia-1.11.5+0.x64.linux.gnu/share/julia/compiled/v1.11/REPL/u0gqU_4x0TT.so (unknown line)
#1150 at ./client.jl:446
jfptr_YY.1150_14797.1 at /home/aaruni/.julia/juliaup/julia-1.11.5+0.x64.linux.gnu/share/julia/compiled/v1.11/REPL/u0gqU_4x0TT.so (unknown line)
jl_apply at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/src/julia.h:2157 [inlined]
jl_f__call_latest at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/src/builtins.c:875
#invokelatest#2 at ./essentials.jl:1055 [inlined]
invokelatest at ./essentials.jl:1052 [inlined]
run_main_repl at ./client.jl:430
repl_main at ./client.jl:567 [inlined]
_start at ./client.jl:541
jfptr__start_73430.1 at /home/aaruni/.julia/juliaup/julia-1.11.5+0.x64.linux.gnu/lib/julia/sys.so (unknown line)
jl_apply at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/src/julia.h:2157 [inlined]
true_main at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/src/jlapi.c:900
jl_repl_entrypoint at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/src/jlapi.c:1059
main at /cache/build/tester-amdci5-12/julialang/julia-release-1-dot-11/cli/loader_exe.c:58
unknown function (ip: 0x7f5e8d57c6b4)
__libc_start_main at /usr/lib/libc.so.6 (unknown line)
unknown function (ip: 0x4010b8)
Allocations: 40378658 (Pool: 40374356; Big: 4302); GC: 48
[1]    85700 IOT instruction (core dumped)  julia +release --project=./

Reproducing the bug

  1. Describe what's not working.

Does not work at all with RX 9070 XT / gfx1201 . Possibly needs newer rocm libraries. Support for this GPU was added in rocm 6.4

  1. Provide MWE to reproduce it (if possible).

On an RX 9070 XT,

julia> using AMDGPU

julia> AMDGPU.zeros(1)
'gfx1201' is not a recognized processor for this target (ignoring processor)
'gfx1201' is not a recognized processor for this target (ignoring processor)
'gfx1201' is not a recognized processor for this target (ignoring processor)
'gfx1201' is not a recognized processor for this target (ignoring processor)
'gfx1201' is not a recognized processor for this target (ignoring processor)
'gfx1201' is not a recognized processor for this target (ignoring processor)
'gfx1201' is not a recognized processor for this target (ignoring processor)
'gfx1201' is not a recognized processor for this target (ignoring processor)
'gfx1201' is not a recognized processor for this target (ignoring processor)
'gfx1201' is not a recognized processor for this target (ignoring processor)
'gfx1201' is not a recognized processor for this target (ignoring processor)
'gfx1201' is not a recognized processor for this target (ignoring processor)
'gfx1201' is not a recognized processor for this target (ignoring processor)
'gfx1201' is not a recognized processor for this target (ignoring processor)
'gfx1201' is not a recognized processor for this target (ignoring processor)
'gfx1201' is not a recognized processor for this target (ignoring processor)
'gfx1201' is not a recognized processor for this target (ignoring processor)
'gfx1201' is not a recognized processor for this target (ignoring processor)
'gfx1201' is not a recognized processor for this target (ignoring processor)
'gfx1201' is not a recognized processor for this target (ignoring processor)
'gfx1201' is not a recognized processor for this target (ignoring processor)
'gfx1201' is not a recognized processor for this target (ignoring processor)
'gfx1201' is not a recognized processor for this target (ignoring processor)
'gfx1201' is not a recognized processor for this target (ignoring processor)
'gfx1201' is not a recognized processor for this target (ignoring processor)
'gfx1201' is not a recognized processor for this target (ignoring processor)
'gfx1201' is not a recognized processor for this target (ignoring processor)
ERROR: LLVM error: Cannot select: 0x23a4ac70: ch = store<(store (s32) into %ir.17, !tbaa !137, addrspace 1)> # D:1 0x23caf7a0, 0x2360ec50, 0x237f2b40, undef:i64, /home/aaruni/.julia/packages/LLVM/2JPxT/src/interop/base.jl:39 @[ none:0 @[ none:0 @[ /home/aaruni/.julia/packages/LLVM/2JPxT/src/interop/pointer.jl:88 @[ /home/aaruni/.julia/packages/AMDGPU/wH6SV/src/device/gcn/array.jl:86 @[ /home/aaruni/.julia/packages/KernelAbstractions/C3nYQ/src/macros.jl:322 @[ none:0 ] ] ] ] ] ]
  0x2360ec50: i32,ch = load<(dereferenceable invariant load (s32) from %ir..kernarg.offset3.cast, align 8, addrspace 4)> 0x23caf7a0, 0x237f2de0, undef:i64
    0x237f2de0: i64 = add nuw 0x2360ee80, Constant:i64<136>
      0x2360ee80: i64,ch = CopyFromReg 0x23caf7a0, Register:i64 %0
        0x23664d20: i64 = Register %0
      0x2360e710: i64 = Constant<136>
    0x237f2ec0: i64 = undef
  0x237f2b40: i64 = add # D:1 0x237f32b0, Constant:i64<-4>, /home/aaruni/.julia/packages/LLVM/2JPxT/src/interop/base.jl:39 @[ none:0 @[ none:0 @[ /home/aaruni/.julia/packages/LLVM/2JPxT/src/interop/pointer.jl:88 @[ /home/aaruni/.julia/packages/AMDGPU/wH6SV/src/device/gcn/array.jl:86 @[ /home/aaruni/.julia/packages/KernelAbstractions/C3nYQ/src/macros.jl:322 @[ none:0 ] ] ] ] ] ]
    0x237f32b0: i64 = add # D:1 0x23664c40, 0x237f2ad0, /home/aaruni/.julia/packages/LLVM/2JPxT/src/interop/base.jl:39 @[ none:0 @[ none:0 @[ /home/aaruni/.julia/packages/LLVM/2JPxT/src/interop/pointer.jl:88 @[ /home/aaruni/.julia/packages/AMDGPU/wH6SV/src/device/gcn/array.jl:86 @[ /home/aaruni/.julia/packages/KernelAbstractions/C3nYQ/src/macros.jl:322 @[ none:0 ] ] ] ] ] ]
      0x23664c40: i64 = shl # D:1 0x237f3320, Constant:i32<2>
        0x237f3320: i64,ch = CopyFromReg # D:1 0x23caf7a0, Register:i64 %1
          0x2360f270: i64 = Register %1
        0x237f3390: i32 = Constant<2>
      0x237f2ad0: i64 = bitcast 0x237f2bb0
        0x237f2bb0: v2i32,ch = load<(dereferenceable invariant load (s64) from %ir..kernarg.offset1.cast + 8, basealign 16, addrspace 4)> 0x23caf7a0, 0x237f3010, undef:i64
          0x237f3010: i64 = add 0x2360ee80, Constant:i64<120>
            0x2360ee80: i64,ch = CopyFromReg 0x23caf7a0, Register:i64 %0
              0x23664d20: i64 = Register %0
            0x2360eef0: i64 = Constant<120>
          0x237f2ec0: i64 = undef
    0x237f3080: i64 = Constant<-4>
  0x237f2ec0: i64 = undef
In function: _Z16gpu_fill_kernel_16CompilerMetadataI11DynamicSize12DynamicCheckv16CartesianIndicesILi1E5TupleI5OneToI5Int64EEE7NDRangeILi1ES0_S0_S8_S8_EE14ROCDeviceArrayI7Float32Li1ELi1EESD_
Stacktrace:
  [1] handle_error(reason::Cstring)
    @ LLVM ~/.julia/packages/LLVM/2JPxT/src/core/context.jl:194
  [2] LLVMTargetMachineEmitToMemoryBuffer(T::LLVM.TargetMachine, M::LLVM.Module, codegen::LLVM.API.LLVMCodeGenFileType, ErrorMessage::Base.RefValue{…}, OutMemBuf::Base.RefValue{…})
    @ LLVM.API ~/.julia/packages/LLVM/2JPxT/lib/16/libLLVM.jl:11138
  [3] emit(tm::LLVM.TargetMachine, mod::LLVM.Module, filetype::LLVM.API.LLVMCodeGenFileType)
    @ LLVM ~/.julia/packages/LLVM/2JPxT/src/targetmachine.jl:118
  [4] mcgen(job::GPUCompiler.CompilerJob, mod::LLVM.Module, format::LLVM.API.LLVMCodeGenFileType)
    @ GPUCompiler ~/.julia/packages/GPUCompiler/Emuht/src/mcgen.jl:75
  [5] macro expansion
    @ ~/.julia/packages/Tracy/GcShf/src/tracepoint.jl:158 [inlined]
  [6] macro expansion
    @ ~/.julia/packages/GPUCompiler/Emuht/src/driver.jl:404 [inlined]
  [7] macro expansion
    @ ~/.julia/packages/Tracy/GcShf/src/tracepoint.jl:158 [inlined]
  [8] macro expansion
    @ ~/.julia/packages/GPUCompiler/Emuht/src/driver.jl:401 [inlined]
  [9] emit_asm(job::GPUCompiler.CompilerJob, ir::LLVM.Module, format::LLVM.API.LLVMCodeGenFileType)
    @ GPUCompiler ~/.julia/packages/GPUCompiler/Emuht/src/utils.jl:116
 [10] compile_unhooked(output::Symbol, job::GPUCompiler.CompilerJob; kwargs::@Kwargs{})
    @ GPUCompiler ~/.julia/packages/GPUCompiler/Emuht/src/driver.jl:115
 [11] compile_unhooked
    @ ~/.julia/packages/GPUCompiler/Emuht/src/driver.jl:80 [inlined]
 [12] compile(target::Symbol, job::GPUCompiler.CompilerJob; kwargs::@Kwargs{})
    @ GPUCompiler ~/.julia/packages/GPUCompiler/Emuht/src/driver.jl:67
 [13] compile
    @ ~/.julia/packages/GPUCompiler/Emuht/src/driver.jl:55 [inlined]
 [14] #40
    @ ~/.julia/packages/AMDGPU/wH6SV/src/compiler/codegen.jl:194 [inlined]
 [15] JuliaContext(f::AMDGPU.Compiler.var"#40#41"{GPUCompiler.CompilerJob{GPUCompiler.GCNCompilerTarget, AMDGPU.Compiler.HIPCompilerParams}}; kwargs::@Kwargs{})
    @ GPUCompiler ~/.julia/packages/GPUCompiler/Emuht/src/driver.jl:34
 [16] JuliaContext(f::Function)
    @ GPUCompiler ~/.julia/packages/GPUCompiler/Emuht/src/driver.jl:25
 [17] hipcompile(job::GPUCompiler.CompilerJob)
    @ AMDGPU.Compiler ~/.julia/packages/AMDGPU/wH6SV/src/compiler/codegen.jl:193
 [18] actual_compilation(cache::Dict{…}, src::Core.MethodInstance, world::UInt64, cfg::GPUCompiler.CompilerConfig{…}, compiler::typeof(AMDGPU.Compiler.hipcompile), linker::typeof(AMDGPU.Compiler.hiplink))
    @ GPUCompiler ~/.julia/packages/GPUCompiler/Emuht/src/execution.jl:245
 [19] cached_compilation(cache::Dict{…}, src::Core.MethodInstance, cfg::GPUCompiler.CompilerConfig{…}, compiler::Function, linker::Function)
    @ GPUCompiler ~/.julia/packages/GPUCompiler/Emuht/src/execution.jl:159
 [20] macro expansion
    @ ~/.julia/packages/AMDGPU/wH6SV/src/compiler/codegen.jl:161 [inlined]
 [21] macro expansion
    @ ./lock.jl:273 [inlined]
 [22] hipfunction(f::GPUArrays.var"#gpu_fill_kernel!#3", tt::Type{Tuple{…}}; kwargs::@Kwargs{})
    @ AMDGPU.Compiler ~/.julia/packages/AMDGPU/wH6SV/src/compiler/codegen.jl:155
 [23] hipfunction(f::GPUArrays.var"#gpu_fill_kernel!#3", tt::Type{Tuple{KernelAbstractions.CompilerMetadata{…}, AMDGPU.Device.ROCDeviceVector{…}, Float32}})
    @ AMDGPU.Compiler ~/.julia/packages/AMDGPU/wH6SV/src/compiler/codegen.jl:154
 [24] macro expansion
    @ ~/.julia/packages/AMDGPU/wH6SV/src/highlevel.jl:155 [inlined]
 [25] (::KernelAbstractions.Kernel{…})(::ROCArray{…}, ::Vararg{…}; ndrange::Tuple{…}, workgroupsize::Nothing)
    @ AMDGPU.ROCKernels ~/.julia/packages/AMDGPU/wH6SV/src/ROCKernels.jl:91
 [26] fill!(A::ROCArray{Float32, 1, AMDGPU.Runtime.Mem.HIPBuffer}, x::Float32)
    @ GPUArrays ~/.julia/packages/GPUArrays/uiVyU/src/host/construction.jl:22
 [27] zeros
    @ ~/.julia/packages/AMDGPU/wH6SV/src/array.jl:245 [inlined]
 [28] zeros(dims::Int64)
    @ AMDGPU ~/.julia/packages/AMDGPU/wH6SV/src/array.jl:244
 [29] top-level scope
    @ REPL[2]:1
Some type information was truncated. Use `show(err)` to see complete types.

aaruni96 avatar Jun 12 '25 10:06 aaruni96

Can you post the output of AMDGPU.versioninfo()? And are you on Julia 1.11?

luraess avatar Jun 12 '25 10:06 luraess

I did post the output of AMDGPU.versioninfo() (the first big error paste above). Yes, this was done on Julia 1.11

aaruni96 avatar Jun 12 '25 10:06 aaruni96

You probably should try Julia 1.12 as it has newer LLVM version which might work with RDNA4

pxl-th avatar Jun 12 '25 10:06 pxl-th

I did post the output of AMDGPU.versioninfo() (the first big error paste above). Yes, this was done on Julia 1.11

Sorry, I overlooked this. As @pxl-th suggests, can you try Julia 1.12. And we may potentially need to not use lib device from artifacts.

luraess avatar Jun 12 '25 11:06 luraess

Using Julia 1.12 helps, but not completely. AMDGPU.zeros(1) now returns a good value :

julia> a = AMDGPU.zeros(1)
1-element ROCArray{Float32, 1, AMDGPU.Runtime.Mem.HIPBuffer}:
 0.0

julia> typeof(a)
ROCArray{Float32, 1, AMDGPU.Runtime.Mem.HIPBuffer}

However, this does not completely fix problems, as we immediately crash on trying to test :


julia> Pkg.test("AMDGPU")
     Testing AMDGPU
      Status `/tmp/jl_OOZuOL/Project.toml`
  [21141c5a] AMDGPU v1.3.3
  [79e6a3ab] Adapt v4.3.0
  [7a1cc6ca] FFTW v1.9.0
  [1a297f60] FillArrays v1.13.0
  [f6369f11] ForwardDiff v1.0.1
  [0c68f7d7] GPUArrays v11.2.2
  [61eb1bfa] GPUCompiler v1.5.2
  [63c18a36] KernelAbstractions v0.9.35
  [929cbde3] LLVM v9.4.0
  [08abe8d2] PrettyTables v2.4.0
  [817f1d60] ReTestItems v1.31.0
  [276daf66] SpecialFunctions v2.5.1
  [90137ffa] StaticArrays v1.9.13
  [10745b16] Statistics v1.11.1
  [8ba89e20] Distributed v1.11.0
  [b77e0a4c] InteractiveUtils v1.11.0
  [37e2e46d] LinearAlgebra v1.12.0
  [44cfe95a] Pkg v1.12.0
  [9a3f8284] Random v1.11.0
  [2f01184e] SparseArrays v1.12.0
  [fa267f1f] TOML v1.0.3
  [8dfed614] Test v1.11.0
      Status `/tmp/jl_OOZuOL/Manifest.toml`
  [21141c5a] AMDGPU v1.3.3
  [621f4979] AbstractFFTs v1.5.0
  [6a4ca0a5] AcceleratedKernels v0.4.1
  [79e6a3ab] Adapt v4.3.0
  [dce04be8] ArgCheck v2.5.0
  [a9b6321e] Atomix v1.1.1
  [fa961155] CEnum v0.5.0
  [bbf7d656] CommonSubexpressions v0.3.1
  [a8cc5b0e] Crayons v4.1.1
  [9a962f9c] DataAPI v1.16.0
  [e2d170a0] DataValueInterfaces v1.0.0
  [163ba53b] DiffResults v1.1.0
  [b552c78f] DiffRules v1.15.1
  [ffbed154] DocStringExtensions v0.9.5
  [e2ba6199] ExprTools v0.1.10
  [7a1cc6ca] FFTW v1.9.0
  [1a297f60] FillArrays v1.13.0
  [f6369f11] ForwardDiff v1.0.1
  [0c68f7d7] GPUArrays v11.2.2
  [46192b85] GPUArraysCore v0.2.0
  [61eb1bfa] GPUCompiler v1.5.2
  [096a3bc2] GPUToolbox v0.2.0
  [076d061b] HashArrayMappedTries v0.2.0
  [92d709cd] IrrationalConstants v0.2.4
  [82899510] IteratorInterfaceExtensions v1.0.0
  [692b3bcd] JLLWrappers v1.7.0
  [63c18a36] KernelAbstractions v0.9.35
  [929cbde3] LLVM v9.4.0
  [b964fa9f] LaTeXStrings v1.4.0
  [2ab3a3ac] LogExpFunctions v0.3.29
  [1914dd2f] MacroTools v0.5.16
  [77ba4419] NaNMath v1.1.3
  [bac558e1] OrderedCollections v1.8.1
  [aea7be01] PrecompileTools v1.3.2
  [21216c6a] Preferences v1.4.3
  [08abe8d2] PrettyTables v2.4.0
  [74087812] Random123 v1.7.1
  [e6cf234a] RandomNumbers v1.6.0
  [817f1d60] ReTestItems v1.31.0
  [189a3867] Reexport v1.2.2
  [ae029012] Requires v1.3.1
  [7e506255] ScopedValues v1.3.0
  [6c6a2e73] Scratch v1.2.1
  [276daf66] SpecialFunctions v2.5.1
  [90137ffa] StaticArrays v1.9.13
  [1e83bf80] StaticArraysCore v1.4.3
  [10745b16] Statistics v1.11.1
  [892a3eda] StringManipulation v0.4.1
  [3783bdb8] TableTraits v1.0.1
  [bd369af6] Tables v1.12.1
  [1e6cf692] TestEnv v1.102.1
  [e689c965] Tracy v0.1.4
  [013be700] UnsafeAtomics v0.3.0
  [f5851436] FFTW_jll v3.3.11+0
  [1d5cc7b8] IntelOpenMP_jll v2025.0.4+0
  [dad2f222] LLVMExtra_jll v0.0.36+0
⌅ [86de99a1] LLVM_jll v18.1.7+4
  [ad6e5548] LibTracyClient_jll v0.9.1+6
  [856f044c] MKL_jll v2025.0.1+1
  [efe28fd5] OpenSpecFun_jll v0.5.6+0
⌅ [873c0968] ROCmDeviceLibs_jll v6.2.1+0
  [1317d2d5] oneTBB_jll v2022.0.0+0
  [0dad84c5] ArgTools v1.1.2
  [56f22d72] Artifacts v1.11.0
  [2a0f44e3] Base64 v1.11.0
  [ade2ca70] Dates v1.11.0
  [8ba89e20] Distributed v1.11.0
  [f43a241f] Downloads v1.6.0
  [7b1f6079] FileWatching v1.11.0
  [b77e0a4c] InteractiveUtils v1.11.0
  [ac6e5ff7] JuliaSyntaxHighlighting v1.12.0
  [4af54fe1] LazyArtifacts v1.11.0
  [b27032c2] LibCURL v0.6.4
  [76f85450] LibGit2 v1.11.0
  [8f399da3] Libdl v1.11.0
  [37e2e46d] LinearAlgebra v1.12.0
  [56ddb016] Logging v1.11.0
  [d6f4376e] Markdown v1.11.0
  [ca575930] NetworkOptions v1.3.0
  [44cfe95a] Pkg v1.12.0
  [de0858da] Printf v1.11.0
  [9a3f8284] Random v1.11.0
  [ea8e919c] SHA v0.7.0
  [9e88b42a] Serialization v1.11.0
  [6462fe0b] Sockets v1.11.0
  [2f01184e] SparseArrays v1.12.0
  [f489334b] StyledStrings v1.11.0
  [fa267f1f] TOML v1.0.3
  [a4e569a6] Tar v1.10.0
  [8dfed614] Test v1.11.0
  [cf7118a7] UUIDs v1.11.0
  [4ec0a83e] Unicode v1.11.0
  [e66e0078] CompilerSupportLibraries_jll v1.3.0+1
  [d55e3150] LLD_jll v18.1.7+3
  [deac9b47] LibCURL_jll v8.11.1+1
  [e37daf67] LibGit2_jll v1.9.0+0
  [29816b5a] LibSSH2_jll v1.11.3+1
  [14a3606d] MozillaCACerts_jll v2025.5.20
  [4536629a] OpenBLAS_jll v0.3.29+0
  [05823500] OpenLibm_jll v0.8.5+0
  [458c3c95] OpenSSL_jll v3.5.0+0
  [bea87d4a] SuiteSparse_jll v7.8.3+2
  [83775a58] Zlib_jll v1.3.1+2
  [8f36deef] libLLVM_jll v18.1.7+4
  [8e850b90] libblastrampoline_jll v5.12.0+0
  [8e850ede] nghttp2_jll v1.64.0+1
  [3f19e933] p7zip_jll v17.5.0+2
        Info Packages marked with ⌅ have new versions available but compatibility constraints restrict them from upgrading.
     Testing Running tests...
Julia Version 1.12.0-beta4
Commit 600ac61d3d2 (2025-06-05 07:03 UTC)
Build Info:
  Official https://julialang.org release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 24 × AMD Ryzen 9 7900 12-Core Processor
  WORD_SIZE: 64
  LLVM: libLLVM-18.1.7 (ORCJIT, znver4)
  GC: Built with stock GC
Threads: 1 default, 1 interactive, 1 GC (on 24 virtual cores)
Environment:
  JULIA_DEPOT_PATH = ./
  JULIA_LOAD_PATH = @:/tmp/jl_OOZuOL
[ Info: AMDGPU versioninfo
:0:/usr/src/debug/hip-runtime/hip-runtime-clr/hipamd/src/hip_global.cpp:158 : 11557627746 us:  Module not initialized

[120985] signal 6 (-6): Aborted
in expression starting at /home/aaruni/Programs/git/GitHub/oscar-amd/packages/AMDGPU/wH6SV/test/runtests.jl:108
unknown function (ip: 0x7f115e78174c) at /usr/lib/libc.so.6
gsignal at /usr/lib/libc.so.6 (unknown line)
abort at /usr/lib/libc.so.6 (unknown line)
unknown function (ip: 0x7f110b47921e) at /opt/rocm/lib/libamdhip64.so
unknown function (ip: 0x7f110b670db3) at /opt/rocm/lib/libamdhip64.so
unknown function (ip: 0x7f110b6345c1) at /opt/rocm/lib/libamdhip64.so
unknown function (ip: 0x7f110b63a9da) at /opt/rocm/lib/libamdhip64.so
unknown function (ip: 0x7f0f9c2183a2) at /opt/rocm/lib/librocsparse.so
rocsparse_create_handle at /opt/rocm/lib/librocsparse.so (unknown line)
macro expansion at /home/aaruni/Programs/git/GitHub/oscar-amd/packages/AMDGPU/wH6SV/src/sparse/error.jl:80 [inlined]
rocsparse_create_handle at /home/aaruni/Programs/git/GitHub/oscar-amd/packages/AMDGPU/wH6SV/src/sparse/librocsparse.jl:7
create_handle at /home/aaruni/Programs/git/GitHub/oscar-amd/packages/AMDGPU/wH6SV/src/sparse/rocSPARSE.jl:31 [inlined]
#library_state##3 at /home/aaruni/Programs/git/GitHub/oscar-amd/packages/AMDGPU/wH6SV/src/cache.jl:115 [inlined]
pop! at /home/aaruni/Programs/git/GitHub/oscar-amd/packages/AMDGPU/wH6SV/src/cache.jl:49
new_state at /home/aaruni/Programs/git/GitHub/oscar-amd/packages/AMDGPU/wH6SV/src/cache.jl:114
#library_state##11 at /home/aaruni/Programs/git/GitHub/oscar-amd/packages/AMDGPU/wH6SV/src/cache.jl:127 [inlined]
get! at ./dict.jl:458
library_state at /home/aaruni/Programs/git/GitHub/oscar-amd/packages/AMDGPU/wH6SV/src/cache.jl:127
lib_state at /home/aaruni/Programs/git/GitHub/oscar-amd/packages/AMDGPU/wH6SV/src/sparse/rocSPARSE.jl:37 [inlined]
handle at /home/aaruni/Programs/git/GitHub/oscar-amd/packages/AMDGPU/wH6SV/src/sparse/rocSPARSE.jl:41 [inlined]
version at /home/aaruni/Programs/git/GitHub/oscar-amd/packages/AMDGPU/wH6SV/src/sparse/rocSPARSE.jl:46
_ver at /home/aaruni/Programs/git/GitHub/oscar-amd/packages/AMDGPU/wH6SV/src/utils.jl:5 [inlined]
versioninfo at /home/aaruni/Programs/git/GitHub/oscar-amd/packages/AMDGPU/wH6SV/src/utils.jl:6
unknown function (ip: 0x7f114812326f) at (unknown file)
jl_apply at /cache/build/builder-amdci5-3/julialang/julia-release-1-dot-12/src/julia.h:2369 [inlined]
do_call at /cache/build/builder-amdci5-3/julialang/julia-release-1-dot-12/src/interpreter.c:124
eval_value at /cache/build/builder-amdci5-3/julialang/julia-release-1-dot-12/src/interpreter.c:242
eval_stmt_value at /cache/build/builder-amdci5-3/julialang/julia-release-1-dot-12/src/interpreter.c:193 [inlined]
eval_body at /cache/build/builder-amdci5-3/julialang/julia-release-1-dot-12/src/interpreter.c:706
jl_interpret_toplevel_thunk at /cache/build/builder-amdci5-3/julialang/julia-release-1-dot-12/src/interpreter.c:897
jl_toplevel_eval_flex at /cache/build/builder-amdci5-3/julialang/julia-release-1-dot-12/src/toplevel.c:1038
jl_toplevel_eval_flex at /cache/build/builder-amdci5-3/julialang/julia-release-1-dot-12/src/toplevel.c:978
ijl_toplevel_eval at /cache/build/builder-amdci5-3/julialang/julia-release-1-dot-12/src/toplevel.c:1050
ijl_toplevel_eval_in at /cache/build/builder-amdci5-3/julialang/julia-release-1-dot-12/src/toplevel.c:1095
eval at ./boot.jl:489
include_string at ./loading.jl:2837
_include at ./loading.jl:2897
include at ./Base.jl:304
IncludeInto at ./Base.jl:305
jfptr_IncludeInto_110198.1 at /home/aaruni/.julia/juliaup/julia-1.12.0-beta4+0.x64.linux.gnu/lib/julia/sys.so (unknown line)
jl_apply at /cache/build/builder-amdci5-3/julialang/julia-release-1-dot-12/src/julia.h:2369 [inlined]
do_call at /cache/build/builder-amdci5-3/julialang/julia-release-1-dot-12/src/interpreter.c:124
eval_value at /cache/build/builder-amdci5-3/julialang/julia-release-1-dot-12/src/interpreter.c:242
eval_stmt_value at /cache/build/builder-amdci5-3/julialang/julia-release-1-dot-12/src/interpreter.c:193 [inlined]
eval_body at /cache/build/builder-amdci5-3/julialang/julia-release-1-dot-12/src/interpreter.c:706
jl_interpret_toplevel_thunk at /cache/build/builder-amdci5-3/julialang/julia-release-1-dot-12/src/interpreter.c:897
jl_toplevel_eval_flex at /cache/build/builder-amdci5-3/julialang/julia-release-1-dot-12/src/toplevel.c:1038
jl_toplevel_eval_flex at /cache/build/builder-amdci5-3/julialang/julia-release-1-dot-12/src/toplevel.c:978
ijl_toplevel_eval at /cache/build/builder-amdci5-3/julialang/julia-release-1-dot-12/src/toplevel.c:1050
ijl_toplevel_eval_in at /cache/build/builder-amdci5-3/julialang/julia-release-1-dot-12/src/toplevel.c:1095
eval at ./boot.jl:489
exec_options at ./client.jl:287
_start at ./client.jl:554
jfptr__start_59381.1 at /home/aaruni/.julia/juliaup/julia-1.12.0-beta4+0.x64.linux.gnu/lib/julia/sys.so (unknown line)
jl_apply at /cache/build/builder-amdci5-3/julialang/julia-release-1-dot-12/src/julia.h:2369 [inlined]
true_main at /cache/build/builder-amdci5-3/julialang/julia-release-1-dot-12/src/jlapi.c:959
jl_repl_entrypoint at /cache/build/builder-amdci5-3/julialang/julia-release-1-dot-12/src/jlapi.c:1126
main at /cache/build/builder-amdci5-3/julialang/julia-release-1-dot-12/cli/loader_exe.c:58
unknown function (ip: 0x7f115e7116b4) at /usr/lib/libc.so.6
__libc_start_main at /usr/lib/libc.so.6 (unknown line)
unknown function (ip: 0x4010b8) at /workspace/srcdir/glibc-2.17/csu/../sysdeps/x86_64/start.S
Allocations: 8439987 (Pool: 8439851; Big: 136); GC: 9
ERROR: Package AMDGPU errored during testing (received signal: 6)
Stacktrace:
  [1] pkgerror(msg::String)
    @ Pkg.Types ~/.julia/juliaup/julia-1.12.0-beta4+0.x64.linux.gnu/share/julia/stdlib/v1.12/Pkg/src/Types.jl:68
  [2] test(ctx::Pkg.Types.Context, pkgs::Vector{…}; coverage::Bool, julia_args::Cmd, test_args::Cmd, test_fn::Nothing, force_latest_compatible_version::Bool, allow_earlier_backwards_compatible_versions::Bool, allow_reresolve::Bool)
    @ Pkg.Operations ~/.julia/juliaup/julia-1.12.0-beta4+0.x64.linux.gnu/share/julia/stdlib/v1.12/Pkg/src/Operations.jl:2365
  [3] test
    @ ~/.julia/juliaup/julia-1.12.0-beta4+0.x64.linux.gnu/share/julia/stdlib/v1.12/Pkg/src/Operations.jl:2220 [inlined]
  [4] test(ctx::Pkg.Types.Context, pkgs::Vector{…}; coverage::Bool, test_fn::Nothing, julia_args::Cmd, test_args::Cmd, force_latest_compatible_version::Bool, allow_earlier_backwards_compatible_versions::Bool, allow_reresolve::Bool, kwargs::@Kwargs{…})
    @ Pkg.API ~/.julia/juliaup/julia-1.12.0-beta4+0.x64.linux.gnu/share/julia/stdlib/v1.12/Pkg/src/API.jl:486
  [5] test(pkgs::Vector{PackageSpec}; io::IOContext{IO}, kwargs::@Kwargs{})
    @ Pkg.API ~/.julia/juliaup/julia-1.12.0-beta4+0.x64.linux.gnu/share/julia/stdlib/v1.12/Pkg/src/API.jl:164
  [6] test(pkgs::Vector{PackageSpec})
    @ Pkg.API ~/.julia/juliaup/julia-1.12.0-beta4+0.x64.linux.gnu/share/julia/stdlib/v1.12/Pkg/src/API.jl:153
  [7] test(pkgs::Vector{String}; kwargs::@Kwargs{})
    @ Pkg.API ~/.julia/juliaup/julia-1.12.0-beta4+0.x64.linux.gnu/share/julia/stdlib/v1.12/Pkg/src/API.jl:152
  [8] test
    @ ~/.julia/juliaup/julia-1.12.0-beta4+0.x64.linux.gnu/share/julia/stdlib/v1.12/Pkg/src/API.jl:152 [inlined]
  [9] test(pkg::String)
    @ Pkg.API ~/.julia/juliaup/julia-1.12.0-beta4+0.x64.linux.gnu/share/julia/stdlib/v1.12/Pkg/src/API.jl:151
 [10] top-level scope
    @ REPL[11]:1
Some type information was truncated. Use `show(err)` to see complete types.

And we may potentially need to not use lib device from artifacts.

I don't understand this suggestion, can you please elaborate ?

aaruni96 avatar Jun 12 '25 11:06 aaruni96

And we may potentially need to not use lib device from artifacts.

This is not needed, since AMDGPU.zeros compiles fine.

What OS are you on? I've seen this issue on non ubuntu/debian distros, but haven't looked into it yet. I suspect that things outside of tests should work fine (to some extent)

pxl-th avatar Jun 12 '25 11:06 pxl-th

That might be it. I am on Arch linux, with rocm installed via official repos.

aaruni96 avatar Jun 12 '25 11:06 aaruni96

I'll create a PR in a bit that might help although I have no means of verifying it, so would be great if you can try it.

pxl-th avatar Jun 12 '25 11:06 pxl-th

@aaruni96, can you try this PR? https://github.com/JuliaGPU/AMDGPU.jl/pull/777

It initializes HIP runtime early, maybe that will fix the issue.

pxl-th avatar Jun 12 '25 11:06 pxl-th

Still the same problem

aaruni96 avatar Jun 12 '25 12:06 aaruni96

Digging into the versioninfo function, the session crashes when trying to execute AMDGPU.rocSPARSE.version().

aaruni96 avatar Jun 12 '25 12:06 aaruni96

I have the same on Arch. Seems related to general Arch packaging according to some old issues.

ffrancesco94 avatar Jun 20 '25 12:06 ffrancesco94

i have a very similar problem on a freshly installed ROCm 6.4.1 on ubuntu 24.04 with gfx1103, all from official sources. pytorch works fine while AMDGPU.versioninfo() crashes with 'rocsparse_create_handle at /opt/rocm-6.4.1/lib/librocsparse.so (unknown line)' both when running on julia 1.11 and 1.12

some other notes:

  • the current driver freezes the system when loading on kernel 6.11.0-29, but works fine on 6.11.0-17
  • AMDGPU.zeros(1) works fine for me

dudalev avatar Jul 13 '25 17:07 dudalev

oh, rocsparse_create_handle is likely a red herring, as now i see this:

julia> AMDGPU.zeros(2,2)
2×2 ROCArray{Float32, 2, AMDGPU.Runtime.Mem.HIPBuffer}:
 0.0  0.0
 0.0  0.0

julia> AMDGPU.randn(2,2)
:0:/longer_pathname_so_that_rpms_can_support_packaging_the_debug_info_for_all_os_profiles/src/clr/hipamd/src/hip_global.cpp:158 : 7116212374 us:  Module not initialized

[19067] signal 6 (-6): Aborted
in expression starting at REPL[5]:1
pthread_kill at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
gsignal at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
abort at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x7817992ba876)
unknown function (ip: 0x78179925b6ab)
unknown function (ip: 0x7817994a158f)
unknown function (ip: 0x78179946096d)
unknown function (ip: 0x781799472760)
unknown function (ip: 0x781662216474)
unknown function (ip: 0x78166221337d)
macro expansion at /home/qwe/.julia/packages/AMDGPU/maWzW/src/utils.jl:122 [inlined]
rocrand_initialize_generator at /home/qwe/.julia/packages/AMDGPU/maWzW/src/rand/librocrand.jl:78 [inlined]

dudalev avatar Jul 13 '25 17:07 dudalev

I am still facing this problem, even after uninstalling rocm from default repos and installing opencl-amd-dev from the AUR (as suggested in https://github.com/JuliaGPU/AMDGPU.jl/pull/802 ) .

I talked to @vchuravy , and he suggested trying a sparse or a random function in pytorch-rocm, just to compare. This appears to work in python, but still crashes in Julia / AMDGPU.jl

Installed package :

$ yay -Ss opencl-amd | grep 'Installed'
aur/opencl-amd-dev 1:6.4.2-1 (+9 0.04) (Installed)
aur/opencl-amd 1:6.4.2-1 (+133 0.31) (Installed)

Experiments in python

>>> import torch
>>> torch.cuda.is_available()
True
>>> print(f"PyTorch Version: {torch.__version__}")
PyTorch Version: 2.8.0+rocm6.3
>>> if torch.cuda.is_available():
...    print(f"Current CUDA Device: {torch.cuda.current_device()}")
...    print(f"Device Name: {torch.cuda.get_device_name(torch.cuda.current_device())}")
...    
Current CUDA Device: 0
Device Name: AMD Radeon RX 9070 XT
>>> x = torch.rand(5, 3)
>>> x
tensor([[0.8204, 0.3024, 0.1219],
        [0.6968, 0.3254, 0.2637],
        [0.4649, 0.2115, 0.2231],
        [0.1243, 0.5868, 0.7212],
        [0.9388, 0.9513, 0.6609]])
>>> a = torch.tensor([[0, 2.], [3, 0]])
>>> a
tensor([[0., 2.],
        [3., 0.]])
>>> a.to_sparse()
tensor(indices=tensor([[0, 1],
                       [1, 0]]),
       values=tensor([2., 3.]),
       size=(2, 2), nnz=2, layout=torch.sparse_coo)

Crash in Julia

Just as a reminder, here is the crash (again) in Julia. I am using Julia 1.12.0-rc1 (2025-07-12)

julia> using AMDGPU

(amdtmp) pkg> status AMDGPU
Status `~/Desktop/amdtmp/Project.toml`
  [21141c5a] AMDGPU v2.0.1

julia> AMDGPU.zeros(0)
0-element ROCArray{Float32, 1, AMDGPU.Runtime.Mem.HIPBuffer}

julia> AMDGPU.rand(5)
:0:/longer_pathname_so_that_rpms_can_support_packaging_the_debug_info_for_all_os_profiles/src/clr/hipamd/src/hip_global.cpp:158 : 4813446782 us:  Module not initialized

[17569] signal 6 (-6): Aborted
in expression starting at REPL[4]:1
unknown function (ip: 0x7f29c609894c) at /usr/lib/libc.so.6
gsignal at /usr/lib/libc.so.6 (unknown line)
abort at /usr/lib/libc.so.6 (unknown line)
unknown function (ip: 0x7f29742bf776) at /opt/rocm/lib/libamdhip64.so
unknown function (ip: 0x7f297425b51b) at /opt/rocm/lib/libamdhip64.so
unknown function (ip: 0x7f29744a294f) at /opt/rocm/lib/libamdhip64.so
unknown function (ip: 0x7f29744618ad) at /opt/rocm/lib/libamdhip64.so
unknown function (ip: 0x7f29744736a0) at /opt/rocm/lib/libamdhip64.so
unknown function (ip: 0x7f27f6416474) at /opt/rocm/lib/librocrand.so
unknown function (ip: 0x7f27f641337d) at /opt/rocm/lib/librocrand.so
macro expansion at /home/aaruni/Desktop/amdtmp/packages/AMDGPU/JCgBw/src/utils.jl:122 [inlined]
rocrand_initialize_generator at /home/aaruni/Desktop/amdtmp/packages/AMDGPU/JCgBw/src/rand/librocrand.jl:78
seed! at /home/aaruni/Desktop/amdtmp/packages/AMDGPU/JCgBw/src/rand/random.jl:25 [inlined]
seed! at /home/aaruni/Desktop/amdtmp/packages/AMDGPU/JCgBw/src/rand/random.jl:23
#lib_state##4 at /home/aaruni/Desktop/amdtmp/packages/AMDGPU/JCgBw/src/rand/rocRAND.jl:34 [inlined]
new_state at /home/aaruni/Desktop/amdtmp/packages/AMDGPU/JCgBw/src/cache.jl:124
#library_state##11 at /home/aaruni/Desktop/amdtmp/packages/AMDGPU/JCgBw/src/cache.jl:127 [inlined]
get! at ./dict.jl:458
library_state at /home/aaruni/Desktop/amdtmp/packages/AMDGPU/JCgBw/src/cache.jl:127
lib_state at /home/aaruni/Desktop/amdtmp/packages/AMDGPU/JCgBw/src/rand/rocRAND.jl:29 [inlined]
handle at /home/aaruni/Desktop/amdtmp/packages/AMDGPU/JCgBw/src/rand/rocRAND.jl:37 [inlined]
rocrand_rng at /home/aaruni/Desktop/amdtmp/packages/AMDGPU/JCgBw/src/random.jl:19 [inlined]
rand! at /home/aaruni/Desktop/amdtmp/packages/AMDGPU/JCgBw/src/random.jl:39 [inlined]
rand at /home/aaruni/Desktop/amdtmp/packages/AMDGPU/JCgBw/src/random.jl:67
unknown function (ip: 0x7f2996009795) at (unknown file)
jl_apply at /cache/build/tester-amdci4-11/julialang/julia-release-1-dot-12/src/julia.h:2374 [inlined]
do_call at /cache/build/tester-amdci4-11/julialang/julia-release-1-dot-12/src/interpreter.c:123
eval_value at /cache/build/tester-amdci4-11/julialang/julia-release-1-dot-12/src/interpreter.c:243
eval_stmt_value at /cache/build/tester-amdci4-11/julialang/julia-release-1-dot-12/src/interpreter.c:194 [inlined]
eval_body at /cache/build/tester-amdci4-11/julialang/julia-release-1-dot-12/src/interpreter.c:707
jl_interpret_toplevel_thunk at /cache/build/tester-amdci4-11/julialang/julia-release-1-dot-12/src/interpreter.c:898
jl_toplevel_eval_flex at /cache/build/tester-amdci4-11/julialang/julia-release-1-dot-12/src/toplevel.c:1035
__repl_entry_eval_expanded_with_loc at /cache/build/tester-amdci4-11/julialang/julia-release-1-dot-12/usr/share/julia/stdlib/v1.12/REPL/src/REPL.jl:302
jl_apply at /cache/build/tester-amdci4-11/julialang/julia-release-1-dot-12/src/julia.h:2374 [inlined]
jl_f_invokelatest at /cache/build/tester-amdci4-11/julialang/julia-release-1-dot-12/src/builtins.c:875
toplevel_eval_with_hooks at /cache/build/tester-amdci4-11/julialang/julia-release-1-dot-12/usr/share/julia/stdlib/v1.12/REPL/src/REPL.jl:309
toplevel_eval_with_hooks at /cache/build/tester-amdci4-11/julialang/julia-release-1-dot-12/usr/share/julia/stdlib/v1.12/REPL/src/REPL.jl:313
toplevel_eval_with_hooks at /cache/build/tester-amdci4-11/julialang/julia-release-1-dot-12/usr/share/julia/stdlib/v1.12/REPL/src/REPL.jl:306 [inlined]
eval_user_input at /cache/build/tester-amdci4-11/julialang/julia-release-1-dot-12/usr/share/julia/stdlib/v1.12/REPL/src/REPL.jl:331
repl_backend_loop at /cache/build/tester-amdci4-11/julialang/julia-release-1-dot-12/usr/share/julia/stdlib/v1.12/REPL/src/REPL.jl:453
#start_repl_backend#41 at /cache/build/tester-amdci4-11/julialang/julia-release-1-dot-12/usr/share/julia/stdlib/v1.12/REPL/src/REPL.jl:428
start_repl_backend at /cache/build/tester-amdci4-11/julialang/julia-release-1-dot-12/usr/share/julia/stdlib/v1.12/REPL/src/REPL.jl:425 [inlined]
#run_repl#50 at /cache/build/tester-amdci4-11/julialang/julia-release-1-dot-12/usr/share/julia/stdlib/v1.12/REPL/src/REPL.jl:654
run_repl at /cache/build/tester-amdci4-11/julialang/julia-release-1-dot-12/usr/share/julia/stdlib/v1.12/REPL/src/REPL.jl:640
jfptr_run_repl_21000.1 at /home/aaruni/.julia/juliaup/julia-1.12.0-rc1+0.x64.linux.gnu/share/julia/compiled/v1.12/REPL/u0gqU_3QOfR.so (unknown line)
run_std_repl at ./client.jl:482
jfptr_run_std_repl_78608.1 at /home/aaruni/.julia/juliaup/julia-1.12.0-rc1+0.x64.linux.gnu/lib/julia/sys.so (unknown line)
jl_apply at /cache/build/tester-amdci4-11/julialang/julia-release-1-dot-12/src/julia.h:2374 [inlined]
jl_f_invokelatest at /cache/build/tester-amdci4-11/julialang/julia-release-1-dot-12/src/builtins.c:875
run_main_repl at ./client.jl:503
repl_main at ./client.jl:590 [inlined]
_start at ./client.jl:565
jfptr__start_76350.1 at /home/aaruni/.julia/juliaup/julia-1.12.0-rc1+0.x64.linux.gnu/lib/julia/sys.so (unknown line)
jl_apply at /cache/build/tester-amdci4-11/julialang/julia-release-1-dot-12/src/julia.h:2374 [inlined]
true_main at /cache/build/tester-amdci4-11/julialang/julia-release-1-dot-12/src/jlapi.c:971
jl_repl_entrypoint at /cache/build/tester-amdci4-11/julialang/julia-release-1-dot-12/src/jlapi.c:1139
main at /cache/build/tester-amdci4-11/julialang/julia-release-1-dot-12/cli/loader_exe.c:58
unknown function (ip: 0x7f29c6027674) at /usr/lib/libc.so.6
__libc_start_main at /usr/lib/libc.so.6 (unknown line)
unknown function (ip: 0x4010b8) at /workspace/srcdir/glibc-2.17/csu/../sysdeps/x86_64/start.S
Allocations: 47014373 (Pool: 47012409; Big: 1964); GC: 24
[1]    17569 IOT instruction (core dumped)  JULIA_DEPOT_PATH=./ julia +1.12 --project=./ -t 1

aaruni96 avatar Aug 06 '25 10:08 aaruni96

Given that sparse and random hit into rocSPARSE and rocRAND, there may still be an issue with interactions of these libs and AMDGPU on Arch.

luraess avatar Aug 07 '25 20:08 luraess