如何让 Xorg 完全忽略我的一个显示适配器?

ein*_*lum 6 xorg configuration nvidia display

我在带有以下显示适配器和 X 服务器的 x86_64 机器上使用 Linux Mint:

# inxi -G
Graphics:  Card-1: Intel Xeon E3-1200 v2/3rd Gen Core processor Graphics Controller
           Card-2: NVIDIA GK106 [GeForce GTX 650 Ti Boost]
           Display Server: X.org 1.18.4 driver: nvidia tty size: 130x50 Advanced Data: N/A for root
Run Code Online (Sandbox Code Playgroud)

但实际上,我只将板载图形控制器用于显示目的。我希望 Xorg 忽略我的 nvidia 卡并避免使用它(因此我可以将它仅用于 CUDA 工作)。我的/etc/X11/xorg.conf说:

Section "ServerLayout"
    Identifier "layout"
    Screen 0 "nvidia"
    Inactive "intel"
EndSection

Section "Device"
    Identifier "intel"
    Driver "modesetting"
    BusID "PCI:0@0:2:0"
    Option "AccelMethod" "None"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection

Section "Device"
    Identifier "nvidia"
    Driver "nvidia"
    BusID "PCI:2@0:0:0"
    Option "ConstrainCursor" "off"
EndSection

Section "Screen"
    Identifier "nvidia"
    Device "nvidia"
    Option "AllowEmptyInitialConfiguration" "on"
    Option "IgnoreDisplayDevices" "CRT"
EndSection
Run Code Online (Sandbox Code Playgroud)

...但显然这种“不活跃”还不够不活跃:如果我尝试在 nVIDIA 的 nsight 中调试 CUDA 代码,我会得到

致命:所有 CUDA 设备都用于显示,不能在调试时使用。

我想尝试从 中删除对 nvidia 适配器的引用/etc/X11/xorg.conf,但如果我这样做了 - 文件将被重写。

所以:

  • 应该从xorg.conf我的目标中删除引用吗?
  • 如果是这样,我如何防止它被重写,或者确保它在没有 nVIDIA 卡的情况下被重写?
  • 如果没有,我如何才能让 Xorg 完全忽略我的 nVIDIA 卡?也许某种摆弄模块?

编辑:

我试过使用nvidia-settings. 我在主列表中选择了“Prime Profiles”,然后在“Select the GPU you would like to use”中从“nVIDIA”切换到“Intel”。但是,这阻止了我完全使用 CUDA - 运行时无法识别任何可用的 GPU - 而在我至少能够运行而不是调试我的代码之前。此外,奇怪的是,这样做会使/etc/X11/xorg.conf完全消失。