在尝试安装 CUDA 时,我不知何故破坏了我的 NVIDIA 驱动程序 - 或者可能是 dist-upgrade,我不知道。
我现在已经清除并删除了与 NVIDIA 相关的所有内容
sudo apt-get remove --purge '^nvidia-.*'
sudo apt-get autoremove
但当我尝试安装 NVIDIA 驱动程序时,我得到了
应用更改时出错
pk-client-error-quark:安装软件包时出错:已安装 nvidia-dkms-418 软件包,安装后脚本子进程返回错误退出状态 10(313)
这是删除所有内容并按照以下操作后的输出CUDA 指令安装cuda viaapt-get
想安装所需的NVIDIA驱动但是安装失败:
$ sudo apt-get -y install cuda
Reading package lists... Done
Building dependency tree
Reading state information... Done
cuda is already the newest version (10.1.243-1).
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
7 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up nvidia-dkms-418 (418.87.00-0ubuntu1) ...
update-initramfs: deferring update (trigger activated)
A modprobe blacklist file has been created at /etc/modprobe.d to prevent Nouveau
from loading. This can be reverted by deleting the following file:
/etc/modprobe.d/nvidia-graphics-drivers.conf
A new initrd image has also been created. To revert, please regenerate your
initrd by running the following command after deleting the modprobe.d file:
`/usr/sbin/initramfs -u`
*****************************************************************************
*** Reboot your computer and verify that the NVIDIA graphics driver can ***
*** be loaded. ***
*****************************************************************************
INFO:Enable nvidia
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/dell_latitude
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/put_your_quirks_here
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/lenovo_thinkpad
Removing old nvidia-418.87.00 DKMS files...
------------------------------
Deleting module version: 418.87.00
completely from the DKMS tree.
------------------------------
Done.
Loading new nvidia-418.87.00 DKMS files...
Building for 5.4.0-21-generic
Building for architecture x86_64
Building initial module for 5.4.0-21-generic
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/nvidia-kernel-source-418.0.crash'
Error! Bad return status for module build on kernel: 5.4.0-21-generic (x86_64)
Consult /var/lib/dkms/nvidia/418.87.00/build/make.log for more information.
dpkg: error processing package nvidia-dkms-418 (--configure):
installed nvidia-dkms-418 package post-installation script subprocess returned error exit status 10
dpkg: dependency problems prevent configuration of nvidia-driver-418:
nvidia-driver-418 depends on nvidia-dkms-418 (= 418.87.00-0ubuntu1); however:
Package nvidia-dkms-418 is not configured yet.
dpkg: error processing package nvidia-driver-418 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of cuda-drivers:
cuda-drivers depends on nvidia-dkms-418 (>= 418.87.00); however:
Package nvidia-dkms-418 is not configured yet.
cuda-drivers depends on nvidia-driver-418 (>= 418.87.00); however:
Package nvidia-driver-418 is not configured yet.
dpkg: error processing package cuda-drivers (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of cuda-runtime-10-1:
cuda-runtime-10-1 depends on cuda-drivers (>= 418.87); however:
Package cuda-drivers is not configured yet.
dpkg: error processing package cuda-runtime-10-1 (--configure):
dependency problems - leaving unconfigured
dpkgNo apport report written because the error message indicates its a followup error from a previous failure.
No apport report written because the error message indicates its a followup error from a previous failure.
No apport report written because MaxReports is reached already
No apport report written because MaxReports is reached already
No apport report written because MaxReports is reached already
No apport report written because MaxReports is reached already
: dependency problems prevent configuration of cuda-demo-suite-10-1:
cuda-demo-suite-10-1 depends on cuda-runtime-10-1; however:
Package cuda-runtime-10-1 is not configured yet.
dpkg: error processing package cuda-demo-suite-10-1 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of cuda-10-1:
cuda-10-1 depends on cuda-runtime-10-1 (>= 10.1.243); however:
Package cuda-runtime-10-1 is not configured yet.
cuda-10-1 depends on cuda-demo-suite-10-1 (>= 10.1.243); however:
Package cuda-demo-suite-10-1 is not configured yet.
dpkg: error processing package cuda-10-1 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of cuda:
cuda depends on cuda-10-1 (>= 10.1.243); however:
Package cuda-10-1 is not configured yet.
dpkg: error processing package cuda (--configure):
dependency problems - leaving unconfigured
Processing triggers for initramfs-tools (0.136ubuntu2) ...
update-initramfs: Generating /boot/initrd.img-5.4.0-21-generic
Errors were encountered while processing:
nvidia-dkms-418
nvidia-driver-418
cuda-drivers
cuda-runtime-10-1
cuda-demo-suite-10-1
cuda-10-1
cuda
E: Sub-process /usr/bin/dpkg returned an error code (1)
我发现了一个错误报告看起来与此类似,但涉及不同的驱动程序版本。
进一步研究/var/lib/dkms/nvidia/418.87.00/build/make.log
:
$ cat /var/lib/dkms/nvidia/418.87.00/build/make.log
DKMS make.log for nvidia-418.87.00 for kernel 5.4.0-21-generic (x86_64)
Sat 04 Apr 2020 11:54:26 AM CEST
make[1]: Entering directory '/usr/src/linux-headers-5.4.0-21-generic'
test -e include/generated/autoconf.h -a -e include/config/auto.conf || ( \
echo >&2; \
echo >&2 " ERROR: Kernel configuration is invalid."; \
echo >&2 " include/generated/autoconf.h or include/config/auto.conf are missing.";\
echo >&2 " Run 'make oldconfig && make prepare' on kernel src to fix it."; \
echo >&2 ; \
/bin/false)
make -f ./scripts/Makefile.build obj=/var/lib/dkms/nvidia/418.87.00/build \
single-build= \
need-builtin=1 need-modorder=1
ln -sf /var/lib/dkms/nvidia/418.87.00/build/nvidia/nv-kernel.o_binary /var/lib/dkms/nvidia/418.87.00/build/nvidia/nv-kernel.o
ln -sf /var/lib/dkms/nvidia/418.87.00/build/nvidia-modeset/nv-modeset-kernel.o_binary /var/lib/dkms/nvidia/418.87.00/build/nvidia-modeset/nv-modeset-kernel.o
The Module.symvers file is missing, or does not contain any
symbols exported from the kernel. This could cause the NVIDIA
kernel modules to be built against a configuration that does
not accurately reflect the actual target kernel.
The Module.symvers file check can be disabled by setting the
environment variable IGNORE_MISSING_MODULE_SYMVERS to 1.
make[2]: *** [/var/lib/dkms/nvidia/418.87.00/build/Kbuild:182: module_symvers_sanity_check] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [Makefile:1719: /var/lib/dkms/nvidia/418.87.00/build] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.4.0-21-generic'
make: *** [Makefile:81: modules] Error 2
我怎样才能解决这个问题?
更新
它适用于最新的驱动程序(nvidia-driver-440
)。但是,我需要nvidia-driver-418
在我的计算机上运行 CUDA。