我昨天更新了我的 ubuntu lts 22.04,history.log 显示:
Start-Date: 2023-08-14 09:47:41
Commandline: aptdaemon role='role-commit-packages' sender=':1.1226'
Upgrade: libldap-common:amd64 (2.5.15+dfsg-0ubuntu0.22.04.1, 2.5.16+dfsg-0ubuntu0.22.04.1), libldap-2.5-0:amd64 (2.5.15+dfsg-0ubuntu0.22.04.1, 2.5.16+dfsg-0ubuntu0.22.04.1), intel-microcode:amd64 (3.20230214.0ubuntu0.22.04.1, 3.20230808.0ubuntu0.22.04.1)
Remove: nvidia-dkms-515:amd64 (515.65.01-0ubuntu1), nvidia-driver-515:amd64 (515.65.01-0ubuntu1), cuda-drivers:amd64 (515.65.01-1), nvidia-kernel-common-515:amd64 (515.65.01-0ubuntu1), cuda-drivers-515:amd64 (515.65.01-1), cuda-runtime-11-7:amd64 (11.7.1-1), cuda-demo-suite-11-7:amd64 (11.7.91-1), nvidia-kernel-source-515:amd64 (515.65.01-0ubuntu1)
End-Date: 2023-08-14 09:47:48
(END)
上述更新中的某些内容(假设删除了 Nvidia 驱动程序)导致重启时出现以下 BIOS 错误:
[0.386096] ACPI BIOS ERROR (bug): Failure creating named object [\ADBG], AE_ALREADY_EXIST (20221020/dswload2-326)
[0.386109] ACPI BIOS ERROR (bug): AE_ALREADY_EXIST, During name lookup/catalog (20221020/psobject-220)
[0.399915] ACPI BIOS ERROR (bug): Could not resolve symbol [\_SB.PC00.I2c1.TPL1], AE_NOT_FOUND (20221020/dswload2-162)
[0.399923] ACPI BIOS ERROR (bug): AE_NOT_FOUND, During name lookup/catalog (20221020/psobject-220)
/dev/nvme0n1p5: clean 2083851/26484738 files, 73464257/105933056 blocks
此错误在正常重启时发生。但是,我可以从恢复模式启动,但没有 nvidia 驱动程序(因为它们已被删除):
(base) nico@nico-Z690-AORUS-MASTER:~$ nvidia-smi
NVIDIA-SMI has failed because it couldn't communicate with the NVIDIA driver. Make sure that the latest NVIDIA driver is installed and running.
我尝试清除所有与 nvidia 相关的内容:
sudo apt-get --purge remove "*nvidia*"
sudo apt-get --purge remove "*cublas*" "cuda*" "nsight*"
sudo rm -rf /usr/local/cuda*
并使用以下命令重新安装所有内容:
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/11.7.1/local_installers/cuda-repo-ubuntu2004-11-7-local_11.7.1-515.65.01-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu2004-11-7-local_11.7.1-515.65.01-1_amd64.deb
sudo cp /var/cuda-repo-ubuntu2004-11-7-local/cuda-*-keyring.gpg /usr/share/keyrings/
sudo apt-get update
sudo apt-get -y install cuda
但这会导致这个问题:
INFO:Enable nvidia
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/dell_latitude
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/lenovo_thinkpad
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/put_your_quirks_here
Loading new nvidia-515.65.01 DKMS files...
Building for 6.2.0-26-generic
Building for architecture x86_64
Building initial module for 6.2.0-26-generic
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/nvidia-kernel-source-515.0.crash'
Error! Bad return status for module build on kernel: 6.2.0-26-generic (x86_64)
Consult /var/lib/dkms/nvidia/515.65.01/build/make.log for more information.
dpkg: error processing package nvidia-dkms-515 (--configure):
installed nvidia-dkms-515 package post-installation script subprocess returned error exit status 10
Setting up nsight-systems-2022.1.3 (2022.1.3.3-1c7b5f7) ...
update-alternatives: using /opt/nvidia/nsight-systems/2022.1.3/target-linux-x64/nsys to provide /usr/local/bin/nsys (nsys) in auto mode
update-alternatives: using /opt/nvidia/nsight-systems/2022.1.3/host-linux-x64/nsys-ui to provide /usr/local/bin/nsys-ui (nsys-ui) in auto mode
Setting up libxml2:i386 (2.9.13+dfsg-1ubuntu0.3) ...
Setting up libcufile-dev-11-7 (1.3.1.18-1) ...
Setting up cuda-libraries-11-7 (11.7.1-1) ...
Setting up libxcb-dri3-0:i386 (1.14-3ubuntu3) ...
dpkg: dependency problems prevent configuration of cuda-drivers-515:
cuda-drivers-515 depends on nvidia-dkms-515 (>= 515.65.01); however:
Package nvidia-dkms-515 is not configured yet.
dpkg: error processing package cuda-drivers-515 (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Setting up libx11-xcb1:i386 (2:1.7.5-1ubuntu0.2) ...
Setting up cuda-compiler-11-7 (11.7.1-1) ...
Setting up cuda-cupti-11-7 (11.7.101-1) ...
Setting up libxext6:i386 (2:1.3.4-1build1) ...
Setting up cuda-cupti-dev-11-7 (11.7.101-1) ...
Setting up libxxf86vm1:i386 (1:1.1.4-1build3) ...
Setting up libegl-mesa0:i386 (23.0.4-0ubuntu1~22.04.1) ...
Setting up libxfixes3:i386 (1:6.0.0-1) ...
dpkg: dependency problems prevent configuration of cuda-drivers:
cuda-drivers depends on cuda-drivers-515 (= 515.65.01-1); however:
Package cuda-drivers-515 is not configured yet.
dpkg: error processing package cuda-drivers (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
dpkg: dependency problems prevent configuration of nvidia-driver-515:
nvidia-driver-515 depends on nvidia-dkms-515 (= 515.65.01-0ubuntu1); however:
Package nvidia-dkms-515 is not configured yet.
dpkg: error processing package nvidia-driver-515 (--configure):
dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
Setting up libnvidia-decode-515:i386 (515.65.01-0ubuntu1) ...
Setting up libllvm15:i386 (1:15.0.7-0ubuntu0.22.04.3) ...
Setting up libegl1:i386 (1.4.0-1) ...
Setting up cuda-nsight-systems-11-7 (11.7.1-1) ...
Setting up cuda-libraries-dev-11-7 (11.7.1-1) ...
dpkg: dependency problems prevent configuration of cuda-runtime-11-7:
cuda-runtime-11-7 depends on cuda-drivers (>= 515.65.01); however:
Package cuda-drivers is not configured yet.
dpkg: error processing package cuda-runtime-11-7 (--configure):
dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
Setting up libgl1-mesa-dri:i386 (23.0.4-0ubuntu1~22.04.1) ...
Setting up cuda-command-line-tools-11-7 (11.7.1-1) ...
Setting up libnvidia-encode-515:i386 (515.65.01-0ubuntu1) ...
Setting up cuda-visual-tools-11-7 (11.7.1-1) ...
dpkg: dependency problems prevent configuration of cuda-demo-suite-11-7:
cuda-demo-suite-11-7 depends on cuda-runtime-11-7; however:
Package cuda-runtime-11-7 is not configured yet.
dpkg: error processing package cuda-demo-suite-11-7 (--configure):
dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of cuda-11-7:
cuda-11-7 depends on cuda-runtime-11-7 (>= 11.7.1); however:
Package cuda-runtime-11-7 is not configured yet.
cuda-11-7 depends on cuda-demo-suite-11-7 (>= 11.7.91); however:
Package cuda-demo-suite-11-7 is not configured yet.
dpkg: error processing package cuda-11-7 (--configure):
dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
Setting up libglx-mesa0:i386 (23.0.4-0ubuntu1~22.04.1) ...
Setting up libglx0:i386 (1.4.0-1) ...
dpkg: dependency problems prevent configuration of cuda:
cuda depends on cuda-11-7 (>= 11.7.1); however:
Package cuda-11-7 is not configured yet.
dpkg: error processing package cuda (--configure):
dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
Setting up libgl1:i386 (1.4.0-1) ...
Setting up cuda-tools-11-7 (11.7.1-1) ...
Setting up libnvidia-gl-515:i386 (515.65.01-0ubuntu1) ...
Setting up libnvidia-fbc1-515:i386 (515.65.01-0ubuntu1) ...
Setting up cuda-toolkit-11-7 (11.7.1-1) ...
Setting alternatives
Processing triggers for desktop-file-utils (0.26-1ubuntu3) ...
Processing triggers for gnome-menus (3.36.0-1ubuntu3) ...
Processing triggers for libc-bin (2.35-0ubuntu3.1) ...
Processing triggers for man-db (2.10.2-1) ...
Processing triggers for dbus (1.12.20-2ubuntu4.1) ...
Processing triggers for mailcap (3.70+nmu1ubuntu1) ...
Processing triggers for initramfs-tools (0.140ubuntu13.2) ...
update-initramfs: Generating /boot/initrd.img-6.2.0-26-generic
Errors were encountered while processing:
nvidia-dkms-515
cuda-drivers-515
cuda-drivers
nvidia-driver-515
cuda-runtime-11-7
cuda-demo-suite-11-7
cuda-11-7
cuda
E: Sub-process /usr/bin/dpkg returned an error code (1)
有人能帮忙吗?
答案1
我可以解决这个问题。我清除了与 nvidia 相关的所有内容,如上所述,然后我简单地安装了最新的 cuda 工具包:
wget https://developer.download.nvidia.com/compute/cuda/12.2.1/local_installers/cuda_12.2.1_535.86.10_linux.run
sudo sh cuda_12.2.1_535.86.10_linux.run
我无法再次安装 cuda 11.7,这对我来说是个谜,因为它上次运行良好。假设我的电脑由于一些更新而不再喜欢它了:')
对我来说,这个问题可以关闭了。
干杯
答案2
就我而言,我还升级了我的 ubuntu 软件包,导致我遇到了与上述完全相同的问题。Nico Petermann 接受的答案仅在我将 gcc 版本从 11.x 升级到 12 后才有效,方法是运行:
sudo apt-get install gcc-12
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 12
因此现在,将 gcc 升级到版本 12 并安装最新的 cuda 工具包后,一切都恢复正常。希望对您有所帮助。
编辑:我似乎与 cuda/nvidia-drivers-515 无关,因为我有以下错误堆栈跟踪:
errors were encountered while processing:
nvidia-dkms-535
cuda-drivers-535
cuda-drivers
nvidia-driver-535
cuda-runtime-12-2
cuda-12-2
cuda
cuda-demo-suite-12-2
e: sub-process /usr/bin/dpkg returned an error code (1)