我安装了基于这个建议使用以下命令:
sudo ubuntu-drivers autoinstall
上述命令安装了nvidia-driver-535 (535.154.05-0ubuntu0.22.04.1)
其他工具。接下来,我尝试安装 CUDA,但安装程序抛出了以下错误:
Loading new nvidia-520.61.05 DKMS files...
Building for 6.2.0-39-generic 6.5.0-18-generic
Building for architecture x86_64
Building initial module for 6.2.0-39-generic
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/nvidia-dkms-520.0.crash'
Error! Bad return status for module build on kernel: 6.2.0-39-generic (x86_64)
Consult /var/lib/dkms/nvidia/520.61.05/build/make.log for more information.
我查看了崩溃文件,发现以下错误:
/var/lib/dkms/nvidia/520.61.05/build/nvidia/nv-mmap.c: In function ‘nvidia_mmap_numa’:
/var/lib/dkms/nvidia/520.61.05/build/nvidia/nv-mmap.c:446:19: error: assignment of read-only member ‘vm_flags’
446 | vma->vm_flags |= VM_MIXEDMAP;
| ^~
/var/lib/dkms/nvidia/520.61.05/build/nvidia/nv-mmap.c: In function ‘nvidia_mmap_helper’:
以下是环境信息:
$ lspci | grep -i nvidia
01:00.0 VGA compatible controller: NVIDIA Corporation GA102 [GeForce RTX 3090] (rev a1)
01:00.1 Audio device: NVIDIA Corporation GA102 High Definition Audio Controller (rev a1)
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.4 LTS
Release: 22.04
Codename: jammy
$ ldd --version
ldd (Ubuntu GLIBC 2.35-0ubuntu3.6) 2.35
Copyright (C) 2022 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.
Written by Roland McGrath and Ulrich Drepper.
$ gcc --version
gcc (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.
$ uname -a
Linux asus 6.2.0-39-generic #40~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Thu Nov 16 10:53:04 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
$ nvidia-detector
nvidia-driver-545
$ echo $XDG_SESSION_TYPE
wayland
我发现这个问题已被报告在这里,这里, 和这里.但是他们报告说这是内核 6.3 的问题,而我使用的是 6.2 版本。
有什么解决方法?