在 Fedora 39 上尝试使用 dnf update --refresh 更新 nvidia 驱动程序时出现很多错误

在 Fedora 39 上尝试使用 dnf update --refresh 更新 nvidia 驱动程序时出现很多错误

大约一两周前,我尝试更新内核,但不知何故无意中破坏了我的 NVIDIA 驱动程序。每次启动时我都会收到“NVIDIA 内核模块损坏。恢复到 nouveau”消息或类似的内容。查了一下,多个消息来源告诉我 sudo dnf update --refresh,但这样做给了我:

 Problem 1: package xorg-x11-drv-nvidia-power-3:550.67-1.fc39.x86_64 from rpmfusion-nonfree-nvidia-driver requires xorg-x11-drv-nvidia(x86-64) = 3:550.67, but none of the providers can be installed
  - cannot install the best update candidate for package xorg-x11-drv-nvidia-power-3:550.54.14-1.fc39.x86_64
  - package xorg-x11-drv-nvidia-3:550.67-1.fc39.x86_64 from rpmfusion-nonfree-nvidia-driver is filtered out by modular filtering
  - package xorg-x11-drv-nvidia-3:550.67-1.fc39.x86_64 from rpmfusion-nonfree-updates is filtered out by modular filtering
 Problem 2: package akmod-nvidia-3:550.67-1.fc39.x86_64 from rpmfusion-nonfree-nvidia-driver requires nvidia-kmod-common >= 3:550.67, but none of the providers can be installed
  - cannot install the best update candidate for package akmod-nvidia-3:535.129.03-1.fc39.x86_64
  - package xorg-x11-drv-nvidia-3:550.67-1.fc39.x86_64 from rpmfusion-nonfree-nvidia-driver is filtered out by modular filtering
  - package xorg-x11-drv-nvidia-3:550.67-1.fc39.x86_64 from rpmfusion-nonfree-updates is filtered out by modular filtering
 Problem 3: package nvidia-kmod-common-3:550.54.15-1.fc39.noarch from cuda-fedora39-x86_64 requires nvidia-kmod = 3:550.54.15, but none of the providers can be installed
  - package nvidia-driver-3:550.54.15-1.fc39.x86_64 from cuda-fedora39-x86_64 requires nvidia-kmod-common = 3:550.54.15, but none of the providers can be installed
  - package kmod-nvidia-open-dkms-3:550.54.14-1.fc39.x86_64 from @System conflicts with kmod-nvidia-latest-dkms provided by kmod-nvidia-latest-dkms-3:550.54.15-1.fc39.x86_64 from cuda-fedora39-x86_64
  - cannot install the best update candidate for package xorg-x11-drv-nvidia-3:550.54.14-1.fc39.x86_64
  - cannot install the best update candidate for package kmod-nvidia-open-dkms-3:550.54.14-1.fc39.x86_64
  - package kmod-nvidia-open-dkms-3:550.54.15-1.fc39.x86_64 from cuda-fedora39-x86_64 is filtered out by modular filtering
 Problem 4: package xorg-x11-drv-nvidia-power-3:550.54.14-1.fc39.x86_64 from @System requires xorg-x11-drv-nvidia(x86-64) = 3:550.54.14, but none of the providers can be installed
  - package xorg-x11-drv-nvidia-3:550.54.14-1.fc39.x86_64 from @System requires nvidia-modprobe(x86-64) = 3:550.54.14, but none of the providers can be installed
  - problem with installed package xorg-x11-drv-nvidia-power-3:550.54.14-1.fc39.x86_64
  - cannot install both nvidia-modprobe-3:550.54.15-1.fc39.x86_64 from cuda-fedora39-x86_64 and nvidia-modprobe-3:550.54.14-1.fc39.x86_64 from @System
  - cannot install both nvidia-modprobe-3:550.54.15-1.fc39.x86_64 from cuda-fedora39-x86_64 and nvidia-modprobe-3:550.54.14-1.fc39.x86_64 from cuda-fedora39-x86_64
  - package xorg-x11-drv-nvidia-power-3:550.67-1.fc39.x86_64 from rpmfusion-nonfree-nvidia-driver requires xorg-x11-drv-nvidia(x86-64) = 3:550.67, but none of the providers can be installed
  - package xorg-x11-drv-nvidia-power-3:550.67-1.fc39.x86_64 from rpmfusion-nonfree-updates requires xorg-x11-drv-nvidia(x86-64) = 3:550.67, but none of the providers can be installed
  - cannot install the best update candidate for package nvidia-modprobe-3:550.54.14-1.fc39.x86_64
  - package xorg-x11-drv-nvidia-3:550.67-1.fc39.x86_64 from rpmfusion-nonfree-nvidia-driver is filtered out by modular filtering
  - package xorg-x11-drv-nvidia-3:550.67-1.fc39.x86_64 from rpmfusion-nonfree-updates is filtered out by modular filtering
 Problem 5: problem with installed package akmod-nvidia-3:535.129.03-1.fc39.x86_64
  - package akmod-nvidia-3:535.129.03-1.fc39.x86_64 from @System requires xorg-x11-drv-nvidia-kmodsrc = 3:535.129.03, but none of the providers can be installed
  - package akmod-nvidia-3:535.129.03-1.fc39.x86_64 from rpmfusion-nonfree requires xorg-x11-drv-nvidia-kmodsrc = 3:535.129.03, but none of the providers can be installed
  - cannot install both xorg-x11-drv-nvidia-kmodsrc-3:550.67-1.fc39.x86_64 from rpmfusion-nonfree-nvidia-driver and xorg-x11-drv-nvidia-kmodsrc-3:535.129.03-2.fc39.x86_64 from @System
  - cannot install both xorg-x11-drv-nvidia-kmodsrc-3:550.67-1.fc39.x86_64 from rpmfusion-nonfree-nvidia-driver and xorg-x11-drv-nvidia-kmodsrc-3:535.129.03-2.fc39.x86_64 from rpmfusion-nonfree
  - package akmod-nvidia-3:550.67-1.fc39.x86_64 from rpmfusion-nonfree-nvidia-driver requires nvidia-kmod-common >= 3:550.67, but none of the providers can be installed
  - package akmod-nvidia-3:550.67-1.fc39.x86_64 from rpmfusion-nonfree-updates requires nvidia-kmod-common >= 3:550.67, but none of the providers can be installed
  - cannot install the best update candidate for package xorg-x11-drv-nvidia-kmodsrc-3:535.129.03-2.fc39.x86_64
  - package xorg-x11-drv-nvidia-3:550.67-1.fc39.x86_64 from rpmfusion-nonfree-nvidia-driver is filtered out by modular filtering
  - package xorg-x11-drv-nvidia-3:550.67-1.fc39.x86_64 from rpmfusion-nonfree-updates is filtered out by modular filtering
 Problem 6: problem with installed package kmod-nvidia-open-dkms-3:550.54.14-1.fc39.x86_64
  - package kmod-nvidia-open-dkms-3:550.54.14-1.fc39.x86_64 from @System requires nvidia-kmod-common = 3:550.54.14, but none of the providers can be installed
  - package kmod-nvidia-open-dkms-3:550.54.14-1.fc39.x86_64 from cuda-fedora39-x86_64 requires nvidia-kmod-common = 3:550.54.14, but none of the providers can be installed
  - package nvidia-kmod-common-3:550.54.14-1.fc39.noarch from cuda-fedora39-x86_64 requires nvidia-driver = 3:550.54.14, but none of the providers can be installed
  - cannot install both nvidia-driver-3:550.54.15-1.fc39.x86_64 from cuda-fedora39-x86_64 and nvidia-driver-3:550.54.14-1.fc39.x86_64 from cuda-fedora39-x86_64
  - package xorg-x11-drv-nvidia-3:550.54.14-1.fc39.x86_64 from @System requires nvidia-settings(x86-64) = 3:550.54.14, but none of the providers can be installed
  - package nvidia-settings-3:550.54.15-1.fc39.x86_64 from cuda-fedora39-x86_64 requires nvidia-driver(x86-64) = 3:550.54.15, but none of the providers can be installed
  - cannot install both nvidia-settings-3:550.54.15-1.fc39.x86_64 from cuda-fedora39-x86_64 and nvidia-settings-3:550.54.14-1.fc39.x86_64 from @System
  - cannot install both nvidia-settings-3:550.54.15-1.fc39.x86_64 from cuda-fedora39-x86_64 and nvidia-settings-3:550.54.14-1.fc39.x86_64 from cuda-fedora39-x86_64
  - cannot install the best update candidate for package nvidia-settings-3:550.54.14-1.fc39.x86_64
==============================================================================================================================================================================================================
 Package                                                 Architecture                       Version                                         Repository                                                   Size
==============================================================================================================================================================================================================
Skipping packages with conflicts:
(add '--best --allowerasing' to command line to force their upgrade):
 kmod-nvidia-latest-dkms                                 x86_64                             3:550.54.15-1.fc39                              cuda-fedora39-x86_64                                         40 M
 nvidia-driver                                           x86_64                             3:550.54.14-1.fc39                              cuda-fedora39-x86_64                                        126 M
 nvidia-driver                                           x86_64                             3:550.54.15-1.fc39                              cuda-fedora39-x86_64                                        126 M
 nvidia-modprobe                                         x86_64                             3:550.54.15-1.fc39                              cuda-fedora39-x86_64                                         30 k
 nvidia-settings                                         x86_64                             3:550.54.15-1.fc39                              cuda-fedora39-x86_64                                        822 k
 xorg-x11-drv-nvidia-kmodsrc                             x86_64                             3:550.67-1.fc39                                 rpmfusion-nonfree-nvidia-driver                              44 M
Skipping packages with broken dependencies:
 akmod-nvidia                                            x86_64                             3:550.67-1.fc39                                 rpmfusion-nonfree-updates                                    40 k
 nvidia-kmod-common                                      noarch                             3:550.54.14-1.fc39                              cuda-fedora39-x86_64                                         12 k
 nvidia-kmod-common                                      noarch                             3:550.54.15-1.fc39                              cuda-fedora39-x86_64                                         12 k
 xorg-x11-drv-nvidia-power                               x86_64                             3:550.67-1.fc39                                 rpmfusion-nonfree-nvidia-driver                             103 k

Transaction Summary
==============================================================================================================================================================================================================
Skip  10 Packages

Nothing to do.
Complete!

按照它所说的去做并尝试添加 --best --allowerasing

 Problem 1: cannot install the best update candidate for package xorg-x11-drv-nvidia-power-3:550.54.14-1.fc39.x86_64
  - problem with installed package xorg-x11-drv-nvidia-power-3:550.54.14-1.fc39.x86_64
  - package xorg-x11-drv-nvidia-power-3:550.67-1.fc39.x86_64 from rpmfusion-nonfree-nvidia-driver requires xorg-x11-drv-nvidia(x86-64) = 3:550.67, but none of the providers can be installed
  - package xorg-x11-drv-nvidia-power-3:550.67-1.fc39.x86_64 from rpmfusion-nonfree-updates requires xorg-x11-drv-nvidia(x86-64) = 3:550.67, but none of the providers can be installed
  - package xorg-x11-drv-nvidia-3:550.67-1.fc39.x86_64 from rpmfusion-nonfree-nvidia-driver is filtered out by modular filtering
  - package xorg-x11-drv-nvidia-3:550.67-1.fc39.x86_64 from rpmfusion-nonfree-updates is filtered out by modular filtering
 Problem 2: problem with installed package akmod-nvidia-3:535.129.03-1.fc39.x86_64
  - cannot install the best update candidate for package akmod-nvidia-3:535.129.03-1.fc39.x86_64
  - package akmod-nvidia-3:550.67-1.fc39.x86_64 from rpmfusion-nonfree-nvidia-driver requires nvidia-kmod-common >= 3:550.67, but none of the providers can be installed
  - package akmod-nvidia-3:550.67-1.fc39.x86_64 from rpmfusion-nonfree-updates requires nvidia-kmod-common >= 3:550.67, but none of the providers can be installed
  - package xorg-x11-drv-nvidia-3:550.67-1.fc39.x86_64 from rpmfusion-nonfree-nvidia-driver is filtered out by modular filtering
  - package xorg-x11-drv-nvidia-3:550.67-1.fc39.x86_64 from rpmfusion-nonfree-updates is filtered out by modular filtering
(try to add '--skip-broken' to skip uninstallable packages)

做这一切是因为自从内核崩溃后,我就无法运行任何 CUDA 代码。我尝试运行 NVIDIA 的矢量加法示例并收到此错误:

Failed to allocate device vector A (error code system has unsupported display driver / cuda driver combination)!

如果我尝试运行我自己的矢量输出 CUDA 程序,它只会输出 0。不用说 CUDA 不起作用。我检查了我的 CUDA 工具包,甚至重新安装了它,所以应该没问题。据我所知,我可能根本不知道应该采取什么措施来解决这个问题。最终目标是让我的 CUDA 代码再次运行。

我尝试过的事情:

  • 重新安装 CUDA 工具包
  • 须藤 dnf 更新 --刷新
  • sudo dnf update --refresh --best --allowerasing
  • 签署NVIDIA内核模块(不记得在哪里,但有地方说可以尝试一下,我跟着本指南
  • 完全重新安装驱动程序(通过本指南
  • 恢复到较旧的内核(这工作了一段时间,但最终也以同样的方式崩溃了,而且如果我能解决这个问题,我宁愿不被困在较旧的内核上)

几乎所有这些都没有效果

答案1

选项1


如果您的某些软件包具有未满足的依赖关系,则升级将拒绝继续,直到您使用额外--allowerasing选项再次运行它。从第三方存储库安装的软件包经常会发生这种情况,而这些第三方存储库的更新存储库尚未发布。请仔细研究输出并检查哪些软件包将被删除。它们对于系统功能来说都不是必需的,但其中一些可能对您的工作效率很重要。

  • 如果依赖关系不满足,如果在命令行中添加 --best 选项,有时可以看到更多详细信息。
  • 如果您想在dnf system-upgrade download再次运行之前手动删除/安装某些软件包,建议使用--setopt=keepcache=1dnf 命令行选项执行这些操作。否则,操作后整个包缓存将被删除,您将需要再次下载所有包。

https://fedoraproject.org/wiki/DNF_system_upgrade

来源

选项2


sudo dnf 清理数据库缓存

删除从存储库元数据生成的缓存文件。这会强制 DNF 在下次运行时重新生成缓存文件。 sudo dnf clean 过期缓存

将存储库元数据标记为已过期。 DNF 将在下次使用每个存储库时重新验证缓存。 sudo dnf 清理元数据

删除存储库元数据。 DNF 使用这些文件来确定软件包的远程可用性。使用此选项将使 DNF 在下次运行时下载所有元数据。

sudo dnf --刷新安装英伟达驱动程序

来源

相关内容