我已经以多种方式在 Ubuntu 22.04 LTS 上运行了 nvidia 安装程序,但还是卡在编译器上。首先,我可以运行“gcc -v”来检查安装了哪个版本的编译器。我得到的结果如下:
gcc version 11.4.0 (Ubuntu 11.4.0-1ubuntu1-22.04)
接下来,当我运行 nvidia 安装程序时,我输入了 CC=gcc-11.4.0 ./pathToInstaller,日志显示以下内容:
(Answer: Continue installation)
-> Performing CC sanity check with CC="gcc-11.4".
-> Performing CC check.
ERROR: The CC sanity check failed:
The C compiler 'gcc-11.4' does not appear to be able to
create object files. Please make sure you have
your Linux distribution's libc development package
installed and that 'gcc-11.4' is a valid C compiler
name.
我尝试运行 nvidia 安装程序,并将编译器也设置为 12.4,得到了相同的结果。
另外,有人说首先尝试运行这个:export cc=/usr/bin/gcc-11.4,结果如下:
Warning: Compiler version check failed:
The major and minor number of the compiler used to
compile the kernel:
x86_64-linux-gnu-gcc-12 (Ubuntu 12.3.0-1ubuntu1~22.04) 12.3.0, GNU ld (GNU Binutils for Ubuntu) 2.38
does not match the compiler used here:
cc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
Copyright (C) 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
另外我应该提到我尝试了这个命令:sudo apt-get install build-essential 结果是:
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.
答案1
ubfan1 刚刚发了那篇帖子,真是巧合。我来这里是为了更新我刚刚从 ppa 存储库中获取它。如果您对 Nvidia 图形驱动程序有任何问题,请参见此处:https://easylinuxtipsproject.blogspot.com/p/nvidia.html#ID1所讨论的驱动程序发生的情况是,我可以安装它,但它完成时出现 libglvnd 库错误。导致无法以任何方式启动 x 或 gui。错误是“无法确定安装 libglvnd EGL 供应商库配置文件的路径。请检查您是否有 pkg-config 和 libglvnd 开发库或指定路径...”