ROCgdb icon indicating copy to clipboard operation
ROCgdb copied to clipboard

[Issue]: Cannot find libamdpython.so in rocm-terminal image

Open Naraenda opened this issue 1 year ago • 4 comments

Problem Description

Either the packaged rocGDB in the ROCm stack isn't linked to the right library, i.e. libpython3.8.so. Or libamdpython.so isn't correctly bundled.

Operating System

Ubuntu 20.04.6

CPU

AMD EPYC 9474F

GPU

MI210

ROCm Version

ROCm 6.3.1

ROCm Component

ROCgdb

Steps to Reproduce

Running the following command

docker run --device=/dev/kfd --device=/dev/dri --security-opt seccomp=unconfined --cap-add=SYS_PTRACE -it rocm/rocm-terminal:6.3.1 rocgdb

Results in the following error:

rocgdb: error while loading shared libraries: libamdpython.so: cannot open shared object file: No such file or directory

(Optional for Linux users) Output of /opt/rocm/bin/rocminfo --support

No response

Additional Information

No response

Naraenda avatar Jan 13 '25 12:01 Naraenda

My current workaround on ubuntu is to create a link to libpython3.8.so.

# Find libpython3.8
dpkg -L libpython3.8 | grep .so

# Create link for missing dep. on shared lib
sudo ln -s /usr/lib/python3.8/config-3.8-x86_64-linux-gnu/libpython3.8.so /opt/rocm-6.3.1/lib/libamdpython.so

Naraenda avatar Jan 13 '25 12:01 Naraenda

I experience this problem too (Ubuntu 24.04 container, ROCm 6.3.1 installed via apt).

$ rocgdb
rocgdb: error while loading shared libraries: libamdpython.so: cannot open shared object file: No such file or directory

Searching the filesystem I see a broken symlink in root (/libamdpython.so -> /opt/rocm-6.3.1/lib/libamdpython.so)

rouseabout avatar Jan 20 '25 16:01 rouseabout

Hi,

This is a packaging issue. The packaging team has been notified and should provide a fix.

In the meantime, @Naraenda's workaround is valid.

@rouseabout, you should be able to workaround the issue by doing:

$ sudo rm /libamdpython.so  /opt/rocm-6.3.1/lib/libamdpython.so
$ sudo ln -s /usr/lib/python*/config-*-x86_64-linux-gnu/libpython*.so /opt/rocm-6.3.1/lib/libamdpython.so

lancesix avatar Jan 20 '25 16:01 lancesix

@lancesix the workaround works for me, thanks

rouseabout avatar Jan 20 '25 20:01 rouseabout