Syllo / nvtop

GPU & Accelerator process monitoring for AMD, Apple, Huawei, Intel, NVIDIA and Qualcomm
Other
8.1k stars 293 forks source link

Cannot find GPUs #122

Closed nasyxx closed 3 years ago

nasyxx commented 3 years ago

Hi, I successfully build the nvtop but it cannot find my GPUs.

I'm not sure which part should I provide here.

nvidia-smi works fine:

Screen Shot 2021-09-30 at 02 05 14 PM Screen Shot 2021-09-30 at 02 05 53 PM
Syllo commented 3 years ago

Hi,

This is likely a problem related to ldconfig (shared library runtime binding). You can check with ldconfig -p | grep libnvidia-ml If the output is empty this means that you need to add the /usr/lib/x86_64-linux-gnu/ directory to the config under /etc/ld.so.conf or a in a new file under /etc/ld.so.conf.d depending on your distribution.

nasyxx commented 3 years ago

Hi,

This is likely a problem related to ldconfig (shared library runtime binding). You can check with ldconfig -p | grep libnvidia-ml If the output is empty this means that you need to add the /usr/lib/x86_64-linux-gnu/ directory to the config under /etc/ld.so.conf or a in a new file under /etc/ld.so.conf.d depending on your distribution.

Hi,

I use nix-shell -p cmake ncurses to install the nvtop, which does not support ldconfig -p (nix does not support it). Thus, I now manually install it outside nix. And fixed it. Thanks!

# In nix-shell:

> ldconfig -p
ldconfig: Can't open cache file /nix/store/73k2knwhv4zzizsjr1g1dqjvzkamx8bd-glibc-2.33-49/etc/ld.so.cache
: No such file or directory

# But
> /sbin/ldconfig -p | grep libnvidia-ml
        libnvidia-ml.so.1 (libc6,x86-64) => /usr/lib/x86_64-linux-gnu/libnvidia-ml.so.1

Thanks!

ryantm commented 3 years ago

@nasyxx I had the same problem on NixOS and the solution was to do

hardware.opengl.enable = true;

which populates /run/opengl-driver/lib

$ objdump -x ./result/bin/nvtop | grep RUNPATH
  RUNPATH              /run/opengl-driver/lib:/nix/store/jzjqfff4cldlm2wpld313a2s1v6r3ycb-ncurses-6.2/lib:/nix/store/mij848h2x5wiqkwhg027byvmf9x3gx7y-glibc-2.33-50/lib