ubuntu 22.04 双启动,安装.deb 和 .run Cuda 12.1 失败

ubuntu 22.04 双启动,安装.deb 和 .run Cuda 12.1 失败

我应该尝试 Cuda 11xx 吗?

我最近的错误

nyck33@nyck33-IdeaPad-Gaming-3-15ACH6:~/Downloads$ sudo sh cuda_12.1.1_530.30.02_linux.run
 Installation failed. See log at /var/log/cuda-installer.log for details.
nyck33@nyck33-IdeaPad-Gaming-3-15ACH6:~/Downloads$ cat /var/log/cuda-installer.log
[INFO]: Driver not installed.
[INFO]: Checking compiler version...
[INFO]: gcc location: /usr/bin/gcc

[INFO]: gcc version: gcc version 11.3.0 (Ubuntu 11.3.0-1ubuntu1~22.04) 

[INFO]: Initializing menu
[INFO]: nvidia-fs.setKOVersion(2.15.3)
[INFO]: Setup complete
[INFO]: Installing: Driver
[INFO]: Installing: 530.30.02
[INFO]: Executing NVIDIA-Linux-x86_64-530.30.02.run --ui=none --no-questions --accept-license --disable-nouveau --no-cc-version-check --install-libglvnd  2>&1
[INFO]: Finished with code: 256
[ERROR]: Install of driver component failed. Consult the driver log at /var/log/nvidia-installer.log for more details.
[ERROR]: Install of 530.30.02 failed, quitting

我对任何我所相信的 nvidia 都是“无害的”

yck33@nyck33-IdeaPad-Gaming-3-15ACH6:~/Downloads$ dpkg -l | grep nvidia

我之前尝试的是来自这里的 .deb 本地和 .run 版本的说明 https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=22.04&target_type=runfile_local

其他相关输出

nyck33@nyck33-IdeaPad-Gaming-3-15ACH6:~/Downloads$ lspci | grep -i nvidia
01:00.0 3D controller: NVIDIA Corporation TU117M [GeForce GTX 1650 Mobile / Max-Q] (rev a1)

nyck33@nyck33-IdeaPad-Gaming-3-15ACH6:~/Downloads$ gcc --version
gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.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.

nyck33@nyck33-IdeaPad-Gaming-3-15ACH6:~/Downloads$ uname -r
5.19.0-1009-nvidia-lowlatency

yck33@nyck33-IdeaPad-Gaming-3-15ACH6:~/Downloads$ sudo ubuntu-drivers devices
== /sys/devices/pci0000:00/0000:00:01.1/0000:01:00.0 ==
modalias : pci:v000010DEd00001F9Dsv000017AAsd00003A5Dbc03sc02i00
vendor   : NVIDIA Corporation
model    : TU117M [GeForce GTX 1650 Mobile / Max-Q]
driver   : nvidia-driver-530 - distro non-free
driver   : nvidia-driver-510 - distro non-free
driver   : nvidia-driver-470-server - distro non-free
driver   : nvidia-driver-470 - distro non-free
driver   : nvidia-driver-525 - distro non-free
driver   : nvidia-driver-530-open - distro non-free recommended
driver   : nvidia-driver-515-open - distro non-free
driver   : nvidia-driver-515-server - distro non-free
driver   : nvidia-driver-525-server - distro non-free
driver   : nvidia-driver-515 - distro non-free
driver   : nvidia-driver-525-open - distro non-free
driver   : xserver-xorg-video-nouveau - distro free builtin

nyck33@nyck33-IdeaPad-Gaming-3-15ACH6:~/Downloads$ nvcc --version
Command 'nvcc' not found, but can be installed with:
sudo apt install nvidia-cuda-toolkit

我阅读了此内容以了解预安装步骤:https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html

我不知道下一步该尝试什么。
发生的另一件事是,我安装的 Displaylink 驱动程序以及 dkms 和另一个用于使我的第二台显示器工作的软件包关闭了,也就是说,当我尝试以不同的方式安装 nvidia 驱动程序和 cuda 时,第二台显示器不再被识别或接收任何电源。

编辑:禁用nouveau:https://linuxconfig.org/how-to-disable-blacklist-nouveau-nvidia-driver-on-ubuntu-22-04-jammy-jellyfish-linux 对于 20.04:https://linuxconfig.org/how-to-install-the-nvidia-drivers-on-ubuntu-22-04

这些令人困惑,因为 22.04 的教程听起来像我先禁用 nouveau,然后安装 Nvidia 驱动程序,但对于 20.04,先安装 Nvidia,然后将 nouveau 列入黑名单,那么哪种方式呢?

我还看到

nyck33@nyck33-IdeaPad-Gaming-3-15ACH6:~$ lspci | grep -e VGA
06:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Cezanne [Radeon Vega Series / Radeon Vega Mobile Series] (rev c6)
nyck33@nyck33-IdeaPad-Gaming-3-15ACH6:~$ lspci | grep -e nvidia
nyck33@nyck33-IdeaPad-Gaming-3-15ACH6:~$ lspci | grep -i nvidia
01:00.0 3D controller: NVIDIA Corporation TU117M [GeForce GTX 1650 Mobile / Max-Q] (rev a1)
nyck33@nyck33-IdeaPad-Gaming-3-15ACH6:~$ 

https://www.linuxcapable.com/install-nvidia-drivers-on-ubuntu-linux/

为什么该命令没有-e像该链接中那样显示我的 Nvidia 显卡?

我还尝试了 GUI 方式安装驱动程序,并得到了最奇怪的输出

yck33@nyck33-IdeaPad-Gaming-3-15ACH6:~$ lspci | grep -i nvidia
01:00.0 3D controller: NVIDIA Corporation TU117M [GeForce GTX 1650 Mobile / Max-Q] (rev a1)
nyck33@nyck33-IdeaPad-Gaming-3-15ACH6:~$ nvidia-smi
No devices were found

答案1

注意:有一些与我原来的问题相关的评论,但我想我会补充一下我是如何安装它的,因为它与其他答案所展示的在我的联想游戏笔记本电脑上安装 GEFORCE GTX 1650(Max-Q 笔记本电脑版本)的方法并不完全相同

选择此驱动程序:

司机

此时命令nvidia-smi应该可以工作了。

从这里下载Cuda 12.1运行版本: https://developer.nvidia.com/cuda-downloads

注意:如果您之前尝试过安装,并按照该页面上的说明再次尝试安装,但收到“建议您删除/移除...”的提示,我实际上只是说继续而不是中止,然后系统会询问您是否要更新安装,我回答是。另外,不要忘记使用空格键取消选中驱动程序,因为上面的第 1 步您已经有 Nvidia 驱动程序了。

为了简单起见,我之前没有考虑过 libcudnn 和其他东西,现在我nvcc --version得到了

NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2023 NVIDIA
Corporation Built on Mon_Apr__3_17:16:06_PDT_2023 Cuda compilation
tools, release 12.1, V12.1.105 Build
cuda_12.1.r12.1/compiler.32688072_0 ```

答案已从此处移至OP 的编辑

相关内容