ROCm / triton

Development repository for the Triton language and compiler
MIT License
80 stars 22 forks source link

HIP: Add RUNPATH to compiled so files. #510

Closed xinyazhang closed 3 months ago

xinyazhang commented 4 months ago

Fix a problem reported by Pytorch CentOS docker creation failed due to Triton compilation, ImportError: libamdhip64.so.6

Analysis of this problem:

  1. Some Triton libraries do not have /opt/rocm/lib in their RUNPATH. This leaves ld with only two options to find the libamdhip64.so.6 file: LD_LIBRARY_PATH and /etc/ld.so.conf.
  2. LD_LIBRARY_PATH may not contain /opt/rocm/lib
  3. /etc/ld.so.conf.d/* files are being deprecated by ROCM and not reliable. RUNPATH is the new preferred way by ROCM to locate ROCM libraries, to support parallel installations.
jayfurmanek commented 3 months ago

I wonder if we need this upstream as well. This section upstream: https://github.com/openai/triton/blob/main/python/triton/runtime/build.py#L42-L47 Doesn't have this is_hip section, though..

zhanglx13 commented 3 months ago

We'll need if upstream has the same problem in the ticket