1. 查看系统内核版本

    $ uname -r 
    5.4.35-1-MANJARO

    # 注意版本号前两位
  2. 禁用开源驱动

    $ sudo vim /etc/modprobe.d/blacklist-nouveau.conf 

    # 输入以下内容:
    blacklist nouveau
    options nouveau modeset=0

    # 保存退出
  3. 编辑xorg.conf

    $ sudo vim /etc/X11/xorg.conf

    Section "Module"
    Load "modesetting"
    EndSection

    Section "Device"
    Identifier "nvidia"
    Driver "nvidia"
    BusID "PCI:1:0:0"
    Option "AllowEmptyInitialConfiguration"
    EndSection
  4. 安装独显驱动

    $ sudo pacman -S nvidia nvidia-utils
    # 选择与第一步的系统内核版本号相同的nvidia驱动版本,例如,我的系统内核是5.4.35-1版本,就选择安装54版本的nvidia驱动
  5. 配置登录管理器

    $ sudo vim /usr/share/sddm/scripts/Xsetup
    # 添加如下内容:
    xrandr --setprovideroutputsource modesetting NVIDIA-0
    xrandr --auto
  6. 重启输入命令验证

    ❯ nvidia-smi 
    Mon Apr 27 21:57:19 2020
    +-----------------------------------------------------------------------------+
    | NVIDIA-SMI 440.82 Driver Version: 440.82 CUDA Version: 10.2 |
    |-------------------------------+----------------------+----------------------+
    | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
    | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
    |===============================+======================+======================|
    | 0 GeForce GTX 1050 Off | 00000000:01:00.0 Off | N/A |
    | N/A 44C P3 N/A / N/A | 642MiB / 2002MiB | 27% Default |
    +-------------------------------+----------------------+----------------------+

    +-----------------------------------------------------------------------------+
    | Processes: GPU Memory |
    | GPU PID Type Process name Usage |
    |=============================================================================|
    | 0 1182 G /usr/lib/Xorg 279MiB |
    | 0 1918 G /usr/bin/kwin_x11 74MiB |
    | 0 1928 G /usr/bin/plasmashell 37MiB |
    | 0 1942 G /usr/bin/latte-dock 26MiB |
    | 0 3101 G ...)\Tencent\TXEDU\1.5.6.146\Bin\TXEDU.exe 1MiB |
    | 0 5466 G ...wf/.local/share/Steam/ubuntu12_32/steam 18MiB |
    | 0 5476 G ./steamwebhelper 1MiB |
    | 0 5490 G ...AAAAAAAAAAAgAAAAAAAAA --log-file=/home/ 70MiB |
    | 0 98800 G ...AAAAAAAAAAAACAAAAAAAAAA= --shared-files 79MiB |
    | 0 101547 G ...quest-channel-token=2584948295994107302 14MiB |
    | 0 108662 G ...quest-channel-token=2516819101081470287 29MiB |
    +-----------------------------------------------------------------------------+

    或者输入nvidia-settings打开nvidia设置