ROCm / hcc

HCC is an Open Source, Optimizing C++ Compiler for Heterogeneous Compute currently for the ROCm GPU Computing Platform
https://github.com/RadeonOpenCompute/hcc/wiki
Other
430 stars 108 forks source link

Incorrect package dependencies, libtinfo5 missing? #964

Open baryluk opened 5 years ago

baryluk commented 5 years ago
# /opt/rocm/bin/hipconfig --full
HIP version  : 1.5.18442

== hipconfig
HIP_PATH     : /opt/rocm
HIP_PLATFORM : hcc
CPP_CONFIG   :  -D__HIP_PLATFORM_HCC__=   -I/opt/rocm/include -I/opt/rocm/hcc/include

== hcc
HSA_PATH     : /opt/rocm/hsa
HCC_HOME     : /opt/rocm/hcc
/opt/rocm/hcc/bin/hcc: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
/opt/rocm/hcc/bin/llc: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
HCC-cxxflags :  -hc -std=c++amp -I/opt/rocm/hcc/include -I/opt/rocm/includeHCC-ldflags  :  -hc -std=c++amp -L/opt/rocm/hcc/lib -Wl,--rpath=/opt/rocm/hcc/lib -ldl -lm -lpthread -lhc_am -Wl,--whole-archive -lmcwamp -Wl,--no-whole-archive

=== Environment Variables
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

== Linux Kernel
Hostname     : debian
Linux debian 4.18.0-2-amd64 #1 SMP Debian 4.18.10-2 (2018-11-02) x86_64 GNU/Linux
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux testing (buster)
Release:    testing
Codename:   buster

Installing libtinfo5 packages solved the problem.

root@debian:~# ldd /opt/rocm/hcc/bin/hcc
    linux-vdso.so.1 (0x00007ffda17ed000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f2b3fb5c000)
    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f2b3f93e000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f2b3f939000)
    libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 (0x00007f2b3f90d000)
    libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f2b3f78a000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f2b3f5f6000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f2b3f5da000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f2b3f41d000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f2b3fbba000)

Also the binary looks to be compiled against libtinfo5, but should be compiled with libtinfo6 and linked against libtinfo6, because libtinfo5 is not longer supported and developer. libtinfo6 is source compatible with version 5.

libtinfo5 - shared low-level terminfo library (legacy version)
libtinfo6 - shared low-level terminfo library for terminal handling
baryluk commented 5 years ago

And yes, it is used directly by hcc binary:

$ objdump -R /opt/rocm/hcc/bin/hcc | grep -i tinf
00000000043a1228 R_X86_64_JUMP_SLOT  set_curterm@NCURSES_TINFO_5.0.19991023
00000000043a1370 R_X86_64_JUMP_SLOT  del_curterm@NCURSES_TINFO_5.0.19991023
00000000043a14a0 R_X86_64_JUMP_SLOT  tigetnum@NCURSES_TINFO_5.0.19991023
00000000043a18d8 R_X86_64_JUMP_SLOT  setupterm@NCURSES_TINFO_5.0.19991023
preda commented 3 years ago

I have the same issue with ROCm 3.10, on Ubuntu 20.04, Linux kernel 5.9.12. I installed rocm-opencl3.10.0, set up groups (video & render), set up kfd rights, set up LD_LIBRARY_PATH: export LD_LIBRARY_PATH=/opt/rocm-3.10.0/opencl/lib

Now when I run

~$ /usr/bin/clinfo 
dlerror: libtinfo.so.5: cannot open shared object file: No such file or directory

~$ /opt/rocm-3.10.0/opencl/bin/clinfo 
dlerror: libtinfo.so.5: cannot open shared object file: No such file or directory
ERROR: clGetPlatformIDs(-1001)

I tried to install manually on ubuntu libtinfo-dev, but that installed /usr/lib/x86_64-linux-gnu/libtinfo.so.6 and did not fix the problem.

Unless I'm doing something wrong, this seems a serious issue, affecting one of the supported OSes (Ubuntu 20.04). I'd like to have at least a workaround.

baryluk commented 3 years ago

I have the same issue with ROCm 3.10, on Ubuntu 20.04, Linux kernel 5.9.12. I installed rocm-opencl3.10.0, set up groups (video & render), set up kfd rights, set up LD_LIBRARY_PATH: export LD_LIBRARY_PATH=/opt/rocm-3.10.0/opencl/lib

Now when I run

~$ /usr/bin/clinfo 
dlerror: libtinfo.so.5: cannot open shared object file: No such file or directory

~$ /opt/rocm-3.10.0/opencl/bin/clinfo 
dlerror: libtinfo.so.5: cannot open shared object file: No such file or directory
ERROR: clGetPlatformIDs(-1001)

I tried to install manually on ubuntu libtinfo-dev, but that installed /usr/lib/x86_64-linux-gnu/libtinfo.so.6 and did not fix the problem.

Unless I'm doing something wrong, this seems a serious issue, affecting one of the supported OSes (Ubuntu 20.04). I'd like to have at least a workaround.

You need to install libinfo5 from Ubuntu. I explained it in the first post. just sudo apt install libtinfo5 and it should start working. You don't need libtinfo-dev (you can remove it if you like).

However, your issue is not with hcc, but something else, so you should go to different issue tracker. You can run strace -f /opt/rocm-3.10.0/opencl/bin/clinfo, to find out more maybe.

baryluk commented 3 years ago

Also, It appears that rocm-dev does depend on rocm-gdb which depend on libtinfo5, which is nice, but that is for ROCgdb.

I am not sure if the issue with hcc package got fixed.

baryluk commented 3 years ago

@preda Also, I don't think it is a good github issue tracker for your issue. You are reporting issue with clinfo. This repo is for hcc, which is not even distributed with ROCm 3.10 anymore.

Please go to main ROCm issue tracker https://github.com/RadeonOpenCompute/ROCm and report the problem there.

preda commented 3 years ago

Thanks, opened https://github.com/RadeonOpenCompute/ROCm/issues/1324

On Wed, 9 Dec 2020 at 11:36, Witold Baryluk notifications@github.com wrote:

@preda https://github.com/preda Also, I don't think it is a good github issue tracker for your issue. You are reporting issue with clinfo. This repo is for hcc, which is not even distributed with ROCm 3.10 anymore.

Please go to main ROCm issue tracker https://github.com/RadeonOpenCompute/ROCm and report the problem there.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/RadeonOpenCompute/hcc/issues/964#issuecomment-741323776, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFMO6SPYQMEJGITB5LP3ODST3BARANCNFSM4GKDB7KA .