Configuration files for NVIDIA Drivers on Optimus laptops

Following are the .conf files of a working NVidia Drivers installation on a muxless Optimus laptop. If you are having problems with the drivers check /var/log/Xorg.0.log to see exactly what’s wrong and the laptop won’t boot.

  • /etc/ld.so.conf.d/nvidia.conf
/opt/nvidia/lib
/opt/nvidia/lib32
  • /etc/modprobe.d/disable-nouveau.conf
blacklist nouveau
blacklist nvidiafb
blacklist rivafb
options nouveau modeset=0
  • /etc/modprobe.d/nvidia-drm.conf
options nvidia_drm modeset=1
  • /etc/X11/xorg.conf
# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 430.40

Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/mouse"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"
    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "Unknown"
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
EndSection

Section "Screen"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection
  • /etc/X11/xorg.conf.nvidia-xconfig-original

This file is empty

  • /etc/X11/xorg.conf.d/00-keyboard.conf
# Written by systemd-localed(8), read by systemd-localed and Xorg. It's
# probably wise not to edit this file manually. Use localectl(1) to
# instruct systemd-localed to update it.
Section "InputClass"
        Identifier "system-keyboard"
        MatchIsKeyboard "on"
        Option "XkbLayout" "us,gr"
        Option "XkbVariant" ","
EndSection
  • /etc/X11/xorg.conf.d/ nvidia-drm-outputclass.conf
# This xorg.conf.d configuration snippet configures the X server to
# automatically load the nvidia X driver when it detects a device driven by the
# nvidia-drm.ko kernel module.  Please note that this only works on Linux kernels
# version 3.9 or higher with CONFIG_DRM enabled, and only if the nvidia-drm.ko
# kernel module is loaded before the X server is started.

Section "OutputClass"
    Identifier     "nvidia"
    MatchDriver    "nvidia-drm"
    Driver         "nvidia"
EndSection
  • /etc/X11/xorg.conf.d/ nvidia-files-opt.conf
Section "Files"
	ModulePath      "/opt/nvidia/lib64/xorg/modules"
	ModulePath      "/usr/lib64/xorg/modules"
EndSection
  • /etc/X11/xorg.conf.d/xorg.conf
Section "ServerLayout"
    Identifier "layout"
    Screen 0 "nvidia"
    Inactive "intel"
EndSection

Section "Device"
    Identifier "nvidia"
    Driver "nvidia"
    BusID "PCI:1:0:0"
EndSection

Section "Screen"
    Identifier "nvidia"
    Device "nvidia"
    Option "AllowEmptyInitialConfiguration"
EndSection

Section "Device"
    Identifier "intel"
    Driver "modesetting"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection
1 Like

Ok, this is a very ironic moment. I uninstalled Clear Linux and reinstalled it today and I’m using the exact same .conf files but I just get a black screen on boot. I can access the terminal tho so that’s good at least here’s part of my /var/log/Xorg.0.log :


[     4.395] (--) NVIDIA(GPU-0): DFP-0: disconnected
[     4.395] (--) NVIDIA(GPU-0): DFP-0: Internal TMDS
[     4.395] (--) NVIDIA(GPU-0): DFP-0: 165.0 MHz maximum pixel clock
[     4.395] (--) NVIDIA(GPU-0): 
[    25.693] (**) Option "fd" "41"
[    25.694] (II) event3  - Power Button: device removed
[    25.694] (**) Option "fd" "44"
[    25.694] (II) event4  - Video Bus: device removed
[    25.694] (**) Option "fd" "45"
[    25.694] (II) event5  - Video Bus: device removed
[    25.694] (**) Option "fd" "46"
[    25.694] (II) event1  - Power Button: device removed
[    25.694] (**) Option "fd" "47"
[    25.694] (II) event2  - Sleep Button: device removed
[    25.694] (**) Option "fd" "48"
[    25.694] (II) event11 - Integrated_Webcam_HD: Integrate: device removed
[    25.694] (**) Option "fd" "49"
[    25.694] (II) event6  - PixArt Microsoft USB Optical Mouse: device removed
[    25.694] (**) Option "fd" "50"
[    25.694] (II) event19 - DELL0802:00 06CB:7E92 Touchpad: device removed
[    25.694] (**) Option "fd" "51"
[    25.694] (II) event7  - Intel HID events: device removed
[    25.695] (**) Option "fd" "52"
[    25.695] (II) event8  - Intel HID 5 button array: device removed
[    25.695] (**) Option "fd" "53"
[    25.695] (II) event10 - Dell WMI hotkeys: device removed
[    25.695] (**) Option "fd" "54"
[    25.695] (II) event9  - AT Translated Set 2 keyboard: device removed
[    25.695] (**) Option "fd" "55"
[    25.695] (II) event12 - SynPS/2 Synaptics TouchPad: device removed
[    26.320] (II) systemd-logind: got pause for 13:66
[    26.320] (II) systemd-logind: got pause for 13:71
[    26.320] (II) systemd-logind: got pause for 13:83
[    26.320] (II) systemd-logind: got pause for 13:75
[    26.320] (II) systemd-logind: got pause for 13:65
[    26.320] (II) systemd-logind: got pause for 13:69
[    26.320] (II) systemd-logind: got pause for 13:76
[    26.320] (II) systemd-logind: got pause for 13:73
[    26.320] (II) systemd-logind: got pause for 13:67
[    26.320] (II) systemd-logind: got pause for 13:72
[    26.320] (II) systemd-logind: got pause for 13:74
[    26.320] (II) systemd-logind: got pause for 13:68
[    26.320] (II) systemd-logind: got pause for 13:70
[    26.320] (II) systemd-logind: got pause for 226:0
[    28.048] (II) UnloadModule: "libinput"
[    28.048] (II) systemd-logind: releasing fd for 13:76
[    28.164] (II) UnloadModule: "libinput"
[    28.164] (II) systemd-logind: releasing fd for 13:73
[    28.181] (II) UnloadModule: "libinput"
[    28.181] (II) systemd-logind: releasing fd for 13:74
[    28.209] (II) UnloadModule: "libinput"
[    28.209] (II) systemd-logind: releasing fd for 13:72
[    28.225] (II) UnloadModule: "libinput"
[    28.225] (II) systemd-logind: releasing fd for 13:71
[    28.241] (II) UnloadModule: "libinput"
[    28.241] (II) systemd-logind: releasing fd for 13:83
[    28.265] (II) UnloadModule: "libinput"
[    28.265] (II) systemd-logind: releasing fd for 13:70
[    28.285] (II) UnloadModule: "libinput"
[    28.285] (II) systemd-logind: releasing fd for 13:75
[    28.305] (II) UnloadModule: "libinput"
[    28.305] (II) systemd-logind: releasing fd for 13:66
[    28.317] (II) UnloadModule: "libinput"
[    28.317] (II) systemd-logind: releasing fd for 13:65
[    28.333] (II) UnloadModule: "libinput"
[    28.333] (II) systemd-logind: releasing fd for 13:69
[    28.353] (II) UnloadModule: "libinput"
[    28.353] (II) systemd-logind: releasing fd for 13:68
[    28.373] (II) UnloadModule: "libinput"
[    28.373] (II) systemd-logind: releasing fd for 13:67
[    28.396] (II) NVIDIA(GPU-0): Deleting GPU-0
[    28.397] (WW) xf86CloseConsole: KDSETMODE failed: Input/output error
[    28.397] (WW) xf86CloseConsole: VT_GETMODE failed: Input/output error
[    28.397] (WW) xf86CloseConsole: VT_ACTIVATE failed: Input/output error
[    28.398] (II) Server terminated successfully (0). Closing log file.