查看: 96|回覆: 0

[Debian] 记录 debian intel nvidia 笔记本安装显卡驱动详细过程

[複製鏈接]

3

主題

0

回帖

0

積分

热心网友

金币
0
閲讀權限
220
精華
0
威望
0
贡献
0
在線時間
0 小時
註冊時間
2008-2-3
發表於 2022-10-13 02:01:00 | 顯示全部樓層 |閲讀模式

目录
  • 识别显卡
  • 检测并安装显卡驱动
  • 配置
    • /etc/X11/xorg.conf
    • /etc/lightdm/display_setup.sh
    • /etc/lightdm/lightdm.conf
    • 重启系统,完成所有配置
    • 检测结果

以下步骤全部根据官方文档操作
官方文档: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-driverfirmware-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:


来源:https://www.cnblogs.com/mutuu/p/16786696.html
回覆

使用道具 舉報

您需要登錄後才可以回帖 登錄 | 立即注册

本版積分規則

相关侵权、举报、投诉及建议等,请发 E-mail:qiongdian@foxmail.com

Powered by Discuz! X5.0 © 2001-2026 Discuz! Team.

在本版发帖返回顶部