IT

NVIDIA NVML 드라이버 / 라이브러리 버전 불일치

lottoking 2020. 5. 25. 22:20
반응형

NVIDIA NVML 드라이버 / 라이브러리 버전 불일치


실행할 때 nvidia-smi다음 메시지가 나타납니다.

Failed to initialize NVML: Driver/library version mismatch

한 시간 전에 동일한 메시지를 수신하고 cuda 라이브러리를 제거 nvidia-smi했으며 다음과 같은 결과를 얻을 수있었습니다 .

엔비디아 스미 결과

그 후 공식 NVIDIA 페이지cuda-repo-ubuntu1604-8-0-local-ga2_8.0.61-1_amd64.deb 에서 다운로드 한 다음 간단히

sudo dpkg -i cuda-repo-ubuntu1604-8-0-local-ga2_8.0.61-1_amd64.deb
sudo apt-get update
sudo apt-get install cuda
export PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}}

이제 cuda가 설치되었지만 언급 된 불일치 오류가 발생합니다.


잠재적으로 유용한 정보 :

실행 cat /proc/driver/nvidia/version내가 얻을 :

NVRM version: NVIDIA UNIX x86_64 Kernel Module  378.13  Tue Feb  7 20:10:06 PST 2017
GCC version:  gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4)

Ubuntu 16.04.2 LTS를 실행 중입니다.

커널 릴리즈는 4.4.0-66-generic입니다.

감사!


놀랍게도 재부팅하면 문제가 해결되었습니다 (이미 시도했다고 생각합니다).

의견에 언급 된 Robert Crovella는 다른 사람에게도 유용 할 수 있습니다. 왜냐하면 내가 처음으로 문제를 해결하기 위해했던 것과 매우 비슷하기 때문입니다.


@etal이 말했듯이 재부팅하면이 문제를 해결할 수 있지만 재부팅하지 않은 절차가 도움이 될 것이라고 생각합니다.

중국어의 경우 내 블로그를 확인하십시오-> 中文 版

오류 메시지

NVML : 드라이버 / 라이브러리 버전 불일치

Nvidia 드라이버 커널 모듈 (kmod)의 버전이 잘못되었으므로이 드라이버를 언로드 한 다음 올바른 kmod 버전을로드해야합니다.

그렇게하는 방법 ?

먼저, 어떤 드라이버가로드되었는지 알아야합니다.

lsmod | 그렙 엔비디아

당신은 얻을 수 있습니다

nvidia_uvm            634880  8
nvidia_drm             53248  0
nvidia_modeset        790528  1 nvidia_drm
nvidia              12312576  86 nvidia_modeset,nvidia_uvm

마지막 목표는 nvidia모드 를 언로드하는 것이므로 모듈을 언로드해야합니다.nvidia

sudo rmmod nvidia_drm
sudo rmmod nvidia_modeset
sudo rmmod nvidia_uvm

그런 다음 언로드 nvidia

sudo rmmod 엔비디아

문제 해결

rmmod: ERROR: Module nvidia is in use커널 모듈이 사용 중임을 나타내는 오류가 발생 하면 kmod를 사용하는 프로세스를 종료해야합니다.

sudo lsof /dev/nvidia*

and then kill those process, then continue to unload the kmods

Test

confirm you successfully unload those kmods

lsmod | grep nvidia

you should get nothing, then confirm you can load the correct driver

nvidia-smi

you should get the correct output


So I was having this problem, none of the other remedies worked. The error message was opaque, but checking dmesg was key:

[   10.118255] NVRM: API mismatch: the client has the version 410.79, but
           NVRM: this kernel module has the version 384.130.  Please
           NVRM: make sure that this kernel module and all NVIDIA driver
           NVRM: components have the same version.

However I had completely removed the 384 version, and removed any remaining kernel drivers nvidia-384*. But even after reboot, I was still getting this. Seeing this meant that the kernel was still compiled to reference 384, but was only finding 410. So I recompiled my kernel:

# uname -a # find the kernel it's using
Linux blah 4.13.0-43-generic #48~16.04.1-Ubuntu SMP Thu May 17 12:56:46 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux
# update-initramfs -c -k 4.13.0-43-generic #recompile it
# reboot

And then it worked.

After removing 384, I still had 384 files in: /var/lib/dkms/nvidia-XXX/XXX.YY/4.13.0-43-generic/x86_64/module /lib/modules/4.13.0-43-generic/kernel/drivers

I recommend using the locate command (not installed by default) rather than searching the filesystem every time.


I got the error failed to initialize NVML: Driver/Library version mismatch from my nvidia-gpu-temperature-indicator. And nvidia-smi failed to print any info. I tried to find if there were other versions of nvidia driver installed in my ubuntu. But I just found nvidia-driver-390. In the end, reboot helped me solve the problem.


This also happened to me on Ubuntu 16.04 using the nvidia-348 package (latest nvidia version on Ubuntu 16.04).

However I could resolve the problem by installing nvidia-390 through the Proprietary GPU Drivers PPA.

So a solution to the described problem on Ubuntu 16.04 is doing this:

  • sudo add-apt-repository ppa:graphics-drivers/ppa
  • sudo apt-get update
  • sudo apt-get install nvidia-390

Note: This guide assumes a clean Ubuntu install. If you have previous drivers installed a reboot migh be needed to reload all the kernel modules.


The top-2 answers can't solve my problem. I found a solution at the Nvidia official forum solved my problem. The below error info may cause by installing two different versions of the driver by different approaches. For example, install Nvidia driver by the apt and the official installer.

Failed to initialize NVML: Driver/library version mismatch

To solve this problem, only need to execute one of the following two commands.

sudo apt-get --purge remove "*nvidia*"
sudo /usr/bin/nvidia-uninstall

Had the issue too. (I'm running ubuntu 18.04)

What I did:

dpkg -l | grep -i nvidia

Then sudo apt-get remove --purge nvidia-381 (and every duplicate version, in my case I had 381, 384 and 387)

Then sudo ubuntu-drivers devices to list what's available

And I choose sudo apt install nvidia-driver-430

그 후, nvidia-smi올바른 출력을 제공했습니다 (재부팅 할 필요 없음). 그러나 확실하지 않은 경우 재부팅 할 수 있다고 가정합니다.

또한 이 설치따라 cuda + cudnn을 다시 설치 했습니다.


필자의 경우, nvidia 드라이버를 설치 한 다음 cuda를 설치했습니다. cuda를 설치하여 해결할 수 있다는 것을 알았습니다. https://developer.nvidia.com/cuda-toolkit

참고 URL : https://stackoverflow.com/questions/43022843/nvidia-nvml-driver-library-version-mismatch

반응형