• Failed to initialize NVML: Driver/library version mismatch


    As @etal said, rebooting can solve this problem, but I think a procedure without rebooting will help.

    For Chinese, check my blog -> 中文版

    The error message

    NVML: Driver/library version mismatch

    tell us the Nvidia driver kernel module (kmod) have a wrong version, so we should unload this driver, and then load the correct version of kmod

    How to do that ?

    First, we should know which drivers are loaded.

    lsmod | grep nvidia

    you may get

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

    our final goal is to unload nvidia mod, so we should unload the module depend on nvidia

    sudo rmmod nvidia_drm
    sudo rmmod nvidia_modeset
    sudo rmmod nvidia_uvm

    then, unload nvidia

    sudo rmmod nvidia

    Troubleshooting

    if you get an error like rmmod: ERROR: Module nvidia is in use, which indicates that the kernel module is in use, you should kill the process that using the 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

  • 相关阅读:
    BOM-DOM
    JavaScript
    CSS(2)
    CSS(1)
    HTML5
    索引
    数据库多表查询
    数据操作
    数据库表操作
    初识Java
  • 原文地址:https://www.cnblogs.com/imoon22/p/16128029.html
Copyright © 2020-2023  润新知