当前位置:   article > 正文

ubuntu安装nvidia显卡驱动提示An error occurred while performing the step: “Building kernel modules“._error: the nvidia kernel module was not created. e

error: the nvidia kernel module was not created. error: installation has fai

错误提示:

ERROR An error occurred while performing the step: "Building kernel modules". See /var/log/nvidia-installer.log for details. 
  • 1
ERROR: The nvidia kernel module was not created.
  • 1
ERROR: Installation has failed.  Please see the file
         '/var/log/nvidia-installer.log' for details.  You may find            
         suggestions on fixing installation problems in the README available   
         on the Linux driver download page at www.nvidia.com.
  • 1
  • 2
  • 3
  • 4

错误图下图:
在这里插入图片描述

通过检查/var/log/nvidia-installer.log文件发现,其中930行到940行说了错误的原因是gcc版本不匹配
在这里插入图片描述
使用gcc -v指令查看当前系统中gcc的版本,可以发现确实是gcc-11,那么接下来就安装gcc-12
在这里插入图片描述

使用指令

sudo apt install gcc-12
  • 1

来安装gcc-12
安装好后使用gcc -v会发现gcc版本没切换过来,一定要手动切换,参考这篇Ubuntu 切换GCC版本来切换gcc版本即可

切换完后大功告成

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/897479
推荐阅读
相关标签
  

闽ICP备14008679号