Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add RPATH to tests to point to private libraries. #200

Merged
merged 4 commits into from
Jun 25, 2024

Conversation

ahsan-ca
Copy link
Contributor

No description provided.

Comment on lines +224 to +226
set_property(TARGET ${TARGET} APPEND PROPERTY INSTALL_RPATH "$ORIGIN/../../../../lib")
# Adding RPATH to public tests to point to private libraries.
set_property(TARGET ${TARGET} APPEND PROPERTY INSTALL_RPATH "$ORIGIN/../../../../lib/${PROJECT_NAME}/lib")
Copy link
Contributor Author

@ahsan-ca ahsan-ca Jun 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pfultz2 I found that the tests are installed at /opt/rocm/libexec/installed-tests/migraphx/bin, so I modified the relative path to $ORIGIN/../../../../lib from $ORIGIN/../../../lib (backtracking 4 directory levels instead of 3). I am not sure why we were stepping out of 3 directories only, before my change.

Below is the output of ldd for test_verify (stepping out of 4 l:

ldd /opt/rocm/libexec/installed-tests/migraphx/bin/test_verify
        linux-vdso.so.1 (0x00007ffe90ddf000)
        libmigraphx_ref.so.2010000 => /opt/rocm/libexec/installed-tests/migraphx/bin/../../../../lib/migraphx/lib/libmigraphx_ref.so.2010000 (0x00007f72b14bc000)
        libmigraphx_cpu.so.2010000 => /opt/rocm/libexec/installed-tests/migraphx/bin/../../../../lib/migraphx/lib/libmigraphx_cpu.so.2010000 (0x00007f72b0cff000)
        libdnnl.so.1 => /usr/local/lib/libdnnl.so.1 (0x00007f72aeb42000)
        libomp.so => /opt/rocm-6.0.2/lib/llvm/lib/libomp.so (0x00007f72aea4f000)
        libmigraphx_gpu.so.2010000 => /opt/rocm/libexec/installed-tests/migraphx/bin/../../../../lib/migraphx/lib/libmigraphx_gpu.so.2010000 (0x00007f72a5a88000)
        librocblas.so.4 => /opt/rocm/libexec/installed-tests/migraphx/bin/../../../../lib/librocblas.so.4 (0x00007f7273941000)
        libMIOpen.so.1 => /opt/rocm/libexec/installed-tests/migraphx/bin/../../../../lib/libMIOpen.so.1 (0x00007f723c58d000)
        libamdhip64.so.6 => /opt/rocm/libexec/installed-tests/migraphx/bin/../../../../lib/libamdhip64.so.6 (0x00007f723aade000)
        libmigraphx.so.2010000 => /opt/rocm/libexec/installed-tests/migraphx/bin/../../../../lib/migraphx/lib/libmigraphx.so.2010000 (0x00007f72382a7000)
        libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f7238072000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f7237f8b000)
        libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f7237f6b000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f7237d42000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f72b178a000)
        libmigraphx_device.so.2010000 => /opt/rocm/libexec/installed-tests/migraphx/bin/../../../../lib/migraphx/lib/../lib/libmigraphx_device.so.2010000 (0x00007f7236a7a000)
        libamd_comgr.so.2 => /opt/rocm/libexec/installed-tests/migraphx/bin/../../../../lib/libamd_comgr.so.2 (0x00007f722e16c000)
        libroctx64.so.4 => /opt/rocm/libexec/installed-tests/migraphx/bin/../../../../lib/libroctx64.so.4 (0x00007f722e167000)
        libhsa-runtime64.so.1 => /opt/rocm/libexec/installed-tests/migraphx/bin/../../../../lib/libhsa-runtime64.so.1 (0x00007f722dea3000)
        libnuma.so.1 => /lib/x86_64-linux-gnu/libnuma.so.1 (0x00007f722de96000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f722de7a000)
        libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x00007f722de46000)
        libelf.so.1 => /lib/x86_64-linux-gnu/libelf.so.1 (0x00007f722de28000)
        libdrm.so.2 => /lib/x86_64-linux-gnu/libdrm.so.2 (0x00007f722de12000)
        libdrm_amdgpu.so.1 => /lib/x86_64-linux-gnu/libdrm_amdgpu.so.1 (0x00007f722de06000)
        

Do you think my change for relative path is correct or am I missing something here?

@ahsan-ca ahsan-ca requested a review from umangyadav June 14, 2024 20:31
@ahsan-ca
Copy link
Contributor Author

readelf -d /opt/rocm/libexec/installed-tests/migraphx/bin/test_verify

Dynamic section at offset 0xab1200 contains 37 entries:
  Tag        Type                         Name/Value
 0x000000000000001d (RUNPATH)            Library runpath: [/code/AMDMIGraphX/libs-issue/AMDMIGraphX/deps/lib:$ORIGIN/../../../../lib:$ORIGIN/../../../../lib/migraphx/lib:/opt/rocm-6.0.2/lib/llvm/lib]
 0x0000000000000001 (NEEDED)             Shared library: [libmigraphx_ref.so.2010000]
 0x0000000000000001 (NEEDED)             Shared library: [libmigraphx_cpu.so.2010000]
 0x0000000000000001 (NEEDED)             Shared library: [libdnnl.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libomp.so]
 0x0000000000000001 (NEEDED)             Shared library: [libmigraphx_gpu.so.2010000]
 0x0000000000000001 (NEEDED)             Shared library: [librocblas.so.4]
 0x0000000000000001 (NEEDED)             Shared library: [libMIOpen.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libamdhip64.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libmigraphx.so.2010000]
 0x0000000000000001 (NEEDED)             Shared library: [libstdc++.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libm.so.6]
 0x0000000000000001 (NEEDED)             Shared library: [libgcc_s.so.1]
 0x0000000000000001 (NEEDED)             Shared library: [libc.so.6]

@ahsan-ca
Copy link
Contributor Author

@cgmb @lawruble13 This PR is needed to fix an issue that breaks MIGraphX. Since Paul is away on parental leave, can you please help to merge in the changes?

@lawruble13 lawruble13 merged commit dfaa4dd into develop Jun 25, 2024
16 checks passed
ahsan-ca added a commit that referenced this pull request Jun 25, 2024
* Add RPATH to tests to point to private libraries.

* Fix relative path to lib

---------

Co-authored-by: Lauren Wrubleski <Lauren.Wrubleski@amd.com>
amd-aakash pushed a commit that referenced this pull request Jul 9, 2024
* Add flag to move libraries under project name (#188)

Co-authored-by: Paul Fultz II <pfultz2@yahoo.com>

* Turn ROCM_SYMLINK_LIBS OFF by default (#199)

* Update RPATH to binaries for PRIVATE lib changes (#197)

* Update RPATHs

* Remove debug messages and re-indent comments

* Use CMP0095 NEW policy for paths and update BIN_INSTALL_DIR paths for private binaries

* Remove setting CMP0095 to NEW

* Add RPATH to tests to point to private libraries. (#200)

* Add RPATH to tests to point to private libraries.

* Fix relative path to lib

---------

Co-authored-by: Lauren Wrubleski <Lauren.Wrubleski@amd.com>

---------

Co-authored-by: Paul Fultz II <pfultz2@yahoo.com>
Co-authored-by: Lauren Wrubleski <Lauren.Wrubleski@amd.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update RPATH for rocm_install_test
4 participants