Skip to content

[AMDGPU] error running program when compiled with asan #127241

@zyx-billy

Description

@zyx-billy

I'm working on adding asan when emitting for amd gpus using the upstream llvm backend. Right now I'm doing these things:

  • Add +xnack to target features
  • Enable AddressSanitizerPass in the llvm pipeline

And when running the program, I explicitly link the asan libraries, and enable xnack:

LD_PRELOAD=/opt/rocm/lib/llvm/lib/clang/18/lib/linux/libclang_rt.asan-x86_64.so:/opt/rocm/lib/asan/libamdhip64.so
ASAN_OPTIONS=detect_leaks=0
HSA_XNACK=1

But I run into this error when trying to invoke a kernel:

hipErrorNoBinaryForGpu (no kernel image is available for execution on the device)

Removing the asan llvm pass makes the program run fine (but of course, it won't detect any errors), indicating that everything else seems to work. I also tried linking asanrtl.bc, ocml.bc, & ockl.bc into the IR before running llvm passes (following the impl here), but got the same error.

My questions are:

  • Are there any other configs that should be set when compiling?
  • Is there any way to tell what exactly is incompatible when running? That'll help narrow down what to do.

Happy to provide more context. Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions