Closed qianzhang613 closed 4 years ago
Hi, You need at least the library installed to compile nvtop for the preprocessor and linker phases.
is it possible follow nccl implement ? the code is here: https://github.com/NVIDIA/nccl/blob/master/src/misc/nvmlwrap.cc#L48
As at production environment, there is builds-tools, it will be convenient if the build without nvidia driver dependency。
With docker you can use multi-stage builds to get rid of the unwanted stuff after compiling nvtop. Then, if the library is available at runtime, the dynamic linker should be able to do its job.
I don't find that relying on dlopen to load a library is something a binary should do unless it does stuff like creating function wrappers that end up calling the real function, jit-like compilation, etc.
thanks @Syllo , i copy a libnvidia-ml.so.1 from gpu server and put it into /usr/lib64/, now nvtop can build well.
we build docker images with only cpu compile machine, there is neither gpu or nvidia-docker. so nvml so can dynamic loaded ?