This is an archive of the discontinued LLVM Phabricator instance.

AMDGPU: Search for new ROCm bitcode library structure
ClosedPublic

Authored by arsenm on Apr 10 2020, 10:02 AM.

Details

Summary

The current install situation is a mess, but I'm working on fixing
it. Search for the target layout instead of one of the N options that
exist today.

Diff Detail

Event Timeline

arsenm created this revision.Apr 10 2020, 10:02 AM
arsenm updated this revision to Diff 256598.Apr 10 2020, 10:04 AM

Forgot to commit part

yaxunl added a comment.EditedApr 15 2020, 7:39 AM

If we really want to do this, device lib change and hipcc change need to be ready. Since once this is committed without corresponding device lib and hipcc change, HIP will break.

On ROCM, device lib is currently installed at /opt/rocm/lib with extension .amdgcn.bc. This change requires device libs to be installed to /opt/rocm/amdgcn/bitcode and with extension .bc (drop amdgcn in extension). Also in hipcc -device-lib-path option needs to point to /opt/rocm/amdgcn/bitcode or dropped.

On Windows, device lib Makefiles need to be changed to drop amdgcn in extension.

Another issue: is /opt/rocm/amdgcn/bitcode the right installation path for device lib? Shouldn't it be /opt/rocm/lib/amdgcn/bitcode or /opt/rocm/lib/amdgcn ?

If we really want to do this, device lib change and hipcc change need to be ready. Since once this is committed without corresponding device lib and hipcc change, HIP will break.

The library change is also waiting for review

On ROCM, device lib is currently installed at /opt/rocm/lib with extension .amdgcn.bc. This change requires device libs to be installed to /opt/rocm/amdgcn/bitcode and with extension .bc (drop amdgcn in extension). Also in hipcc -device-lib-path option needs to point to /opt/rocm/amdgcn/bitcode or dropped.

HIP is fixed/merged with the CL handling in D76957

On Windows, device lib Makefiles need to be changed to drop amdgcn in extension.

Another issue: is /opt/rocm/amdgcn/bitcode the right installation path for device lib? Shouldn't it be /opt/rocm/lib/amdgcn/bitcode or /opt/rocm/lib/amdgcn ?

These aren't host libraries, so I don't think these belong under /lib. CUDA installs the functionally equivalent in /usr/local/cuda/nvvm/libdevice/*.bc

yaxunl added inline comments.Apr 15 2020, 11:00 AM
clang/lib/Driver/ToolChains/AMDGPU.cpp
75

with your change, the structure becomes

${ROCM_ROOT}/amdgcn/bitcode/*.bc

Does the toolchain support ${OPENCL_ROOT} ?

arsenm marked an inline comment as done.May 12 2020, 6:51 AM
arsenm added inline comments.
clang/lib/Driver/ToolChains/AMDGPU.cpp
75

This is just pseudocode and no environment variable is read. This corresponds to --rocm-path

arsenm accepted this revision.May 12 2020, 6:56 AM

Device library change submitted. 123bee602a260150ff55c74287f583a67ee78f36

This revision is now accepted and ready to land.May 12 2020, 6:56 AM
arsenm closed this revision.May 12 2020, 6:56 AM