6

I use Linux Mint on an x86_64 machine with the following display adapters and X server:

# 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

but in fact, I only use the on-board graphics controller for display purposes. I want Xorg to ignore my nvidia card and refrain from using it (so I can use it solely for CUDA work). My /etc/X11/xorg.conf says:

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

... but apparently this kind of "inactive" is not inactive enough: If I try to, say, debug CUDA code in nVIDIA's nsight, I get

fatal: All CUDA devices are used for display and cannot be used while debugging.

I wanted to try removing the references to the nvidia adapter from /etc/X11/xorg.conf, but if I do that - the file gets rewritten.

So:

  • Should removing the references from xorg.conf be what I'm aiming for?
  • If so, how do I prevent it from being rewritten, or make sure it's rewritten without the nVIDIA card?
  • If not, how do I otherwise make Xorg completely ignore my nVIDIA card? Perhaps some kind of fiddling with modules?

Edit:

I've tried using nvidia-settings. I chose "Prime Profiles" on the main list, then within "Select the GPU you would like to use" switched from "nVIDIA" to "Intel". However, this prevents me from using CUDA altogether - the runtime fails to identify any GPUs available - while before I was at least able to run, rather than debug, my code. Also, strangely enough, doing that makes /etc/X11/xorg.conf disappear completely.

einpoklum
  • 8,772
  • 19
  • 65
  • 129
  • I don’t know the answer, but naïvely I would have expected the `Screen 0` / `Inactive` configuration to be the other way round: `Screen 0 "intel"`, `Inactive "nvidia"`... – Stephen Kitt Oct 05 '17 at 08:14
  • Perhaps the option in https://unix.stackexchange.com/a/345824/194701 might help? `Option "UseDisplayDevice" "none"` – Cobertos Feb 02 '21 at 20:32

0 Answers0