Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could NOT find NVML (missing: NVML_LIBRARIES) (found version "10") #45

Closed
bpinaya opened this issue Aug 22, 2019 · 18 comments
Closed

Could NOT find NVML (missing: NVML_LIBRARIES) (found version "10") #45

bpinaya opened this issue Aug 22, 2019 · 18 comments

Comments

@bpinaya
Copy link

bpinaya commented Aug 22, 2019

Under the lastest Jetpack version 4.2.1 for embedded devices like Xavier or TX2 I'm seeing this issue when trying to cmake:

cmake .. -DNVML_RETRIEVE_HEADER_ONLINE=True

I get the error:

-- The C compiler identification is GNU 7.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
CMake Error at /usr/local/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find NVML (missing: NVML_LIBRARIES) (found version "10")
Call Stack (most recent call first):
  /usr/local/share/cmake-3.15/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  cmake/modules/FindNVML.cmake:52 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:31 (find_package)


-- Configuring incomplete, errors occurred!
See also "/home/nvidia/Documents/nvtop/build/CMakeFiles/CMakeOutput.log".

It seems it finds NVML and doesn't find it in the download part where you look for:

https://raw.githubusercontent.com/NVIDIA/nvidia-settings/master/src/nvml.h

Any insight is appreciated!

@Syllo
Copy link
Owner

Syllo commented Sep 21, 2019

CMake complains because it cannot find the library (libnvml.so file), not the header.
Is the Nvidia proprietary driver installed?

@rmrao
Copy link

rmrao commented Nov 6, 2019

I'm getting the same issue on only one machine (mine says found version "9"). The driver is definitely installed and I can run nvidia-smi. I can't figure out what the difference is - I've installed it on two other machines with no problems. It looks like the file is located at /usr/lib/x86_64-linux-gnu/libnvidia-ml.so on all my machines.

@lamhoangtung
Copy link

I'm getting the same issue on only one machine (mine says found version "9"). The driver is definitely installed and I can run nvidia-smi. I can't figure out what the difference is - I've installed it on two other machines with no problems. It looks like the file is located at /usr/lib/x86_64-linux-gnu/libnvidia-ml.so on all my machines.

If you have a conda enable. Try to ‘conda deactivate’ first before you make nvtop (even if conda at base environment)

@rmrao
Copy link

rmrao commented Nov 6, 2019

Awesome this worked. I guess my compilers were set to the conda compilers on this one machine. Thanks for the suggestion!

@Syllo
Copy link
Owner

Syllo commented Nov 12, 2019

Thank you @lamhoangtung for providing a solution.

I added a comment about conda in the README, hopefully this will help.

@lamhoangtung
Copy link

Thank you @lamhoangtung for providing a solution.

I added a comment about conda in the README, hopefully this will help.

Thanks ^^. Looks like we can close the issue for now

@sytelus
Copy link

sytelus commented Nov 14, 2019

Here's the full script that takes care of deactivating conda and the reactivating it after install. It would be great to add this in git as something like install_ubuntu18.sh so people don't have to keep typing same stuff over and over.

sudo apt -y install cmake libncurses5-dev libncursesw5-dev git

# clone if not already exist
[ ! -d 'nvtop' ] && git clone https://github.com/Syllo/nvtop.git
mkdir -p nvtop/build && cd nvtop/build

# if conda environment then first deactivate it
env="${CONDA_DEFAULT_ENV}"
if [[ ! -z "${env}" ]]; then
    # https://github.com/conda/conda/issues/7980#issuecomment-524154596
    eval "$(conda shell.bash hook)"
    conda deactivate
fi
cmake ..

# If it errors with "Could NOT find NVML (missing: NVML_INCLUDE_DIRS)"
# try the following command instead, otherwise skip to the build with make.
cmake .. -DNVML_RETRIEVE_HEADER_ONLINE=True

make
sudo make install # You may need sufficient permission for that (root)

# reactivate conda environment
if [[ ! -z "${env}" ]]; then
    conda activate "${env}"
fi

@andviane
Copy link

For me did not: /bin/sh: 1: conda: not found . The library itself should be installed, because I run sudo apt-get install cuda-nvml-dev-10-1. It is also only on one machine. It can be observed when building on the docker image nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04 that should have all CUDA install (and can run apt-get install cuda-nvml-dev-10-1 without errors).

@pharpe
Copy link

pharpe commented Mar 10, 2020

I'm also getting
CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message): Could NOT find NVML (missing: NVML_LIBRARIES) (found version "10")

I have tried cmake .. -DNVML_RETRIEVE_HEADER_ONLINE=True and get the same error. I don't have conda installed. I also tried running the script that @sytelus posted and get the same error.

Here is the log;

CMakeOutput.log

@snafu123
Copy link

i see this too

@eriksneff
Copy link

eriksneff commented May 21, 2020

@pharpe I'm seeing the same thing - Could NOT find NVML (missing: NVML_LIBRARIES) (found version "10"). I'm on a stock install on the jetson xavier mx dev kit board. I don't have conda installed. Just looking for a quick way to montior gpu utilization as I test transcoding performance. Frustrating.

@Syllo
Copy link
Owner

Syllo commented May 22, 2020

The only thing I can think of at this point is adding more hints for CMake.

Can you please try with the version on the branch cmake_nvml_notfound.

If this does not work, can you please provide the path where the library is located and I will add it to the hint list.

@pharpe
Copy link

pharpe commented May 29, 2020

Removed the old git clone

sudo rm -rIf nvtop

cloned the cmake_nvml_notfound branch

git clone -b cmake_nvml_notfound --single-branch https://github.com/Syllo/nvtop.git

Created the build directory and cd to it

mkdir -p nvtop/build && cd nvtop/build

Ran cmake

user@server:~/nvtop/build$ cmake ..
-- The C compiler identification is GNU 7.5.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Setting build type to 'Release' as none was specified.
-- Could NOT find NVML (missing: NVML_INCLUDE_DIRS NVML_LIBRARIES)
CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find NVML (missing: NVML_INCLUDE_DIRS NVML_LIBRARIES)
Call Stack (most recent call first):
  /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  cmake/modules/FindNVML.cmake:52 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:33 (find_package)

I tried

cmake .. -DNVML_RETRIEVE_HEADER_ONLINE=True
user@server:~/nvtop/build$ cmake .. -DNVML_RETRIEVE_HEADER_ONLINE=True
-- Could NOT find NVML (missing: NVML_INCLUDE_DIRS NVML_LIBRARIES)
CMake Error at /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:137 (message):
  Could NOT find NVML (missing: NVML_INCLUDE_DIRS NVML_LIBRARIES)
Call Stack (most recent call first):
  /usr/share/cmake-3.10/Modules/FindPackageHandleStandardArgs.cmake:378 (_FPHSA_FAILURE_MESSAGE)
  cmake/modules/FindNVML.cmake:52 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:33 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/tom/nvtop/build/CMakeFiles/CMakeOutput.log".

@Syllo
Copy link
Owner

Syllo commented Jun 3, 2020

Thanks @pharpe, is your libnvidia-ml.so library installed in one of the following directories? /usr/lib64/nvidia*/ /usr/lib/nvidia*/ /usr/lib/*linux-gnu

@benroeder
Copy link

I am having the same issue, libnvidia-ml.so is installed in
/usr/local/cuda-10.2/targets/aarch64-linux/lib/stubs/libnvidia-ml.so

@Mistobaan
Copy link

fixed with my patch https://github.com/Mistobaan/nvtop#master and adding. This washappening building from an nvidia TensorRT container

cmake .. \
    -DNVML_INCLUDE_DIRS=/usr/local/cuda-10.1/targets/x86_64-linux/include/ \
    -DNVML_LIBRARIES=/usr/local/cuda-10.1/targets/x86_64-linux/lib/stubs/libnvidia-ml.so

@Syllo
Copy link
Owner

Syllo commented Aug 22, 2020

Alright, I added some hints to help CMake find the library in the patch 5fb0ab5.
This should help when cuda is installed under the /usr/local/cuda* hierarchy.

@Syllo
Copy link
Owner

Syllo commented Apr 18, 2022

Close as we don't rely on the nvml header anymore.

@Syllo Syllo closed this as completed Apr 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests