Nvidia:无法识别任何设备驱动程序

Nvidia:无法识别任何设备驱动程序

我已经遇到这个问题三天了,我卸载了 nvidia 驱动程序并重新安装,并尝试搜索了很多答案,但我找不到一个令人满意的答复

我试图nvidia-smi检查我的 GPU 驱动程序,但我的系统无法识别它们,我不明白我的安装存在什么问题,有人可以建议我解决这个问题的方法吗?

uname -a
Linux dev-Lenovo-Legion-5-15ARH05 5.8.0-63-generic #71~20.04.1-Ubuntu SMP Thu Jul 15 17:46:08 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

LSB 模块输出:

lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04.2 LTS
Release:    20.04
Codename:   focal

GPU 信息:

cat /proc/driver/nvidia/gpus/0000\:01\:00.0/information
Model:       GeForce GTX 1650
IRQ:         91
GPU UUID:    GPU-e40be3a1-7830-6e15-7330-30fd6a28ae8f
Video BIOS:      ??.??.??.??.??
Bus Type:    PCIe
DMA Size:    47 bits
DMA Mask:    0x7fffffffffff
Bus Location:    0000:01:00.0
Device Minor:    0
Blacklisted:     No

已安装的驱动程序:

lspci -k | grep -EA3 'VGA|3D|Display'
01:00.0 VGA compatible controller: NVIDIA Corporation Device 1f99 (rev a1)
    Subsystem: Lenovo Device 3a3f
    Kernel driver in use: nvidia
    Kernel modules: nvidiafb, nouveau, nvidia_drm, nvidia
--
05:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Renoir (rev c7)
    Subsystem: Lenovo Renoir
    Kernel driver in use: amdgpu
    Kernel modules: amdgpu

输出nvidia-smi

nvidia-smi
No devices were found

Nvidia 安装:

nvidia_uvm           1011712  0
nvidia_drm             53248  0
nvidia_modeset       1228800  1 nvidia_drm
nvidia              34168832  2 nvidia_uvm,nvidia_modeset
drm_kms_helper        217088  2 amdgpu,nvidia_drm
nvidiafb               53248  0
vgastate               20480  1 nvidiafb
fb_ddc                 16384  1 nvidiafb
i2c_algo_bit           16384  2 nvidiafb,amdgpu
drm                   552960  22 gpu_sched,drm_kms_helper,amdgpu,nvidia_drm,ttm

Ubuntu 设备驱动程序:

sudo ubuntu-drivers devices
[sudo] password for dev: 
== /sys/devices/pci0000:00/0000:00:01.1/0000:01:00.0 ==
modalias : pci:v000010DEd00001F99sv000017AAsd00003A43bc03sc00i00
vendor   : NVIDIA Corporation
driver   : nvidia-driver-450-server - distro non-free
driver   : nvidia-driver-470 - third-party non-free
driver   : nvidia-driver-460 - distro non-free recommended
driver   : nvidia-driver-460-server - distro non-free
driver   : xserver-xorg-video-nouveau - distro free builtin

答案1

我有同样的笔记本电脑,最好的方法是在 BIOS 中切换到“可切换显卡”,确保安全启动已禁用,然后启动到 Ubuntu 并按照以下步骤操作

  1. 清除所有与 nvidia 相关的软件包以下命令将列出所有 nvidia 软件包,你必须清除所有软件包

    sudo dpkg -l | grep nvidia

  2. 使用安装推荐的驱动程序

    sudo ubuntu-drivers autoinstall

  3. 在主要设置中选择 Nvida

    sudo prime-select nvidia

  4. 重新启动并在 BIOS 中选择“独立显卡”

答案2

下面的命令只是为了节省运行给出的解决方案的时间乌特卡什·钱德拉·斯里瓦斯塔瓦

它将为列出的所有包生成清除命令:

sudo dpkg -l | grep nvidia | awk '{ print $2 }' | awk -F: '{ print $1 }' | xargs -I % echo 'sudo dpkg -r %'

结果将会是这样的:

sudo dpkg -r libnvidia-cfg1-470
sudo dpkg -r libnvidia-common-470
...
sudo dpkg -r libnvidia-compute-470
sudo dpkg -r libnvidia-compute-470
sudo dpkg -r xserver-xorg-video-nvidia-470

然后您只需检查它并将其复制并粘贴到终端中即可清除包。

相关内容