Skip to content

amdgpu openmp refuses to compile without rocm device libs, doesn't actually use rocm device libs #106403

@JonChesterfield

Description

@JonChesterfield

If you don't have rocm device libs installed somewhere clang can find them, clang -fopenmp for amdgpu returns:

clang: error: cannot find ROCm device library; provide its path via '--rocm-path' or '--rocm-device-lib-path', or pass '-nogpulib' to build without ROCm device library

If you pass nogpulib, it doesn't link the openmp device runtime. If you pass rocm-path to somewhere with a collection of empty bitcode stubs I think it should succeed, but I haven't managed to guess the directory structure either option expects.

This issue is to add a flag "norocmlib" or "norocmgpulib" or similar which disables the error on failing to find rocm device libs and doesn't try to automatically link them into the program, but leaves the non-rocm gpu libraries alone. In particular, it shouldn't disable the openmp runtime bitcode.

I think the points to edit are RocmInstallationDetector::checkCommonBitcodeLibs and AMDGPUOpenMPToolChain::getDeviceLibs and ROcm.h allGenericLibsValid(). That's sufficient to let me build and run openmp programs without rocm device libs installed at least, may have missed some.

Tagging Joseph, I can see libc also wanting a concise way to say "I want GPU libs (such as libc) but not the rocm device libs"

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions