Skip to content

rust-cuda sha2_crates_io example crashes with LLVM IR verification error: "Attribute 'align 16' applied to incompatible type" on __multi3 #562

@stevefan1999-personal

Description

@stevefan1999-personal

zluda_trace logs (tarball/zip file)

No response

Description

When attempting to run the sha2_crates_io example from rust-cuda with ZLUDA, the application crashes with a panic in the PTX compilation phase. The error indicates issues with LLVM IR generation:

  • Invalid align attribute applied to __multi3 function pointer
  • Terminator found in the middle of a basic block

Expected behavior: The sha2_crates_io example should compile and run successfully using ZLUDA as a CUDA replacement.

Actual behavior: The application panics during PTX module loading with LLVM verification errors, specifically:

Attribute 'align 16' applied to incompatible type!
ptr @__multi3
Terminator found in the middle of a basic block!
label "9978"

The panic originates from ptx/src/pass/llvm/emit.rs:76:13 during module load (cuModuleLoadDataEx).

Steps to reproduce

  1. Clone rust-cuda repository: git clone https://github.com/Rust-GPU/rust-cuda.git
  2. Navigate to the directory: cd rust-cuda
  3. Build ZLUDA from source or download the latest release
  4. Set LD_LIBRARY_PATH to point to ZLUDA libraries
  5. Run the sha2 example:
    LD_LIBRARY_PATH="/path/to/ZLUDA/target/debug:$LD_LIBRARY_PATH" cargo run -p sha2_crates_io
  6. The application crashes with the error shown above

ZLUDA version

master

Operating System

Rocky Linux 9 (with CUDA 12 and ROCm 6.4.3)

GPU

RX 6600 XT

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions