记录 debian intel nvidia 笔记本安装显卡驱动详细过程
目录
以下步骤全部根据官方文档操作
官方文档:NvidiaGraphicsDrivers
识别显卡
$ lspci -nn | egrep -i "3d|display|vga"
00:02.0 VGA compatible controller [0300]: Intel Corporation HD Graphics 530 [8086:191b] (rev 06)
01:00.0 3D controller [0302]: NVIDIA Corporation GM107M [GeForce GTX 960M] [10de:139b] (rev a2)
因为这条命令有2条输出,所以你有一个 Optimus (hybrid) graphics chipset。当以下步骤都做完后,需要去 NVIDIA Optimus 页面选择性配置。
检测并安装显卡驱动
安装 nvidia-detect
并执行,得到以下信息
$ nvidia-detect
Detected NVIDIA GPUs:
01:00.0 3D controller [0302]: NVIDIA Corporation GM107M [GeForce GTX 960M] [10de:139b] (rev a2)
Checking card: NVIDIA Corporation GM107M [GeForce GTX 960M] (rev a2)
Your card is supported by all driver versions.
Your card is also supported by the Tesla 510 drivers series.
Your card is also supported by the Tesla 470 drivers series.
Your card is also supported by the Tesla 450 drivers series.
Your card is also supported by the Tesla 418 drivers series.
It is recommended to install the
nvidia-driver
package.
根据结果,安装 nvidia-driver
和 firmware-misc-nonfree
。
接着安装 CUDA: # apt install nvidia-cuda-dev nvidia-cuda-toolkit
配置
选择 Using NVIDIA PRIME Render Offload
,但是总黑屏。
于是选择 Using NVIDIA GPU as the primary GPU
。
安装:# apt install x11-xserver-utils
/etc/X11/xorg.conf
已经替换了BusID。
Section "ServerLayout"
Identifier "layout"
Screen 0 "nvidia"
Inactive "intel"
EndSection
Section "Device"
Identifier "nvidia"
Driver "nvidia"
BusID "PCI:1:0:0" # e.g. PCI:1:0:0
EndSection
Section "Screen"
Identifier "nvidia"
Device "nvidia"
Option "AllowEmptyInitialConfiguration"
EndSection
Section "Device"
Identifier "intel"
Driver "modesetting"
BusID "PCI:0:2:0" # e.g. PCI:0:2:0
#Option "AccelMethod" "none"
EndSection
Section "Screen"
Identifier "intel"
Device "intel"
EndSection
/etc/lightdm/display_setup.sh
xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto
xrandr --dpi 96
添加权限:# chmod +x /etc/lightdm/display_setup.sh
/etc/lightdm/lightdm.conf
已完成替换
[Seat:*]
display-setup-script=/etc/lightdm/display_setup.sh
重启系统,完成所有配置
检测结果
$ glxinfo | grep -i opengl
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: NVIDIA GeForce GTX 960M/PCIe/SSE2
OpenGL core profile version string: 4.6.0 NVIDIA 510.85.02
OpenGL core profile shading language version string: 4.60 NVIDIA
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.6.0 NVIDIA 510.85.02
OpenGL shading language version string: 4.60 NVIDIA
OpenGL context flags: (none)
OpenGL profile mask: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 510.85.02
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了