Installing nvtop on xavier running Ubuntu 18.04

I have a Jetson Xavier with a custom base image (have not used Jetpack/SDKManager to flash it).
I have manually installed the nvidia drivers and cuda.

I am trying to get nvtop to run.
I have compiled from source but am hitting a missing library ‘libnvidia-ml.so.1’ which I don’t have.

Searches suggest the driver should be part of nvidia-XXX package but I don’t see those packages available.

What package do I need to install to get this library and how can I installed said package (+ dependencies) manually.

You might need a minor version name change, but basically look here:

/usr/local/cuda/targets/aarch64-linux/lib/stubs/libnvidia-ml.so

If you didn’t install CUDA, then this would be missing. I have not tried nvtop, so I don’t know what else might be needed, but that is a start.

Thanks linuxdev. I do see this file

/usr/local/cuda/targets/aarch64-linux/lib/stubs/libnvidia-ml.so

but I’m not sure what this stub is - I’m expecting to see libnvidia-ml.so or .so.1 in /usr/lib or similar.

If I symlink to this so and run nvtop I see:

# nvtop

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
WARNING:

You should always run with libnvidia-ml.so that is installed with your
NVIDIA Display Driver. By default it's installed in /usr/lib and /usr/lib64.
libnvidia-ml.so in GDK package is a stub library that is attached only for
build purposes (e.g. machine that you build your application doesn't have
to have Display Driver installed).
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Impossible to initialize nvidia nvml : 
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
WARNING:

You should always run with libnvidia-ml.so that is installed with your
NVIDIA Display Driver. By default it's installed in /usr/lib and /usr/lib64.
libnvidia-ml.so in GDK package is a stub library that is attached only for
build purposes (e.g. machine that you build your application doesn't have
to have Display Driver installed).
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

NVIDIA would have to answer that, I’m not sure what the purpose was. It is a good question, I just don’t know which packages provide what. There is probably a particular package still needed (even if all that package does is add a path to the linker).