Has anyone successfully installed NVIDIA driver to Optimus enabled laptops?

Here are all the config files I can find in /etc:

  • /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 "Files"
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

I don’t think there’s a contradiction somewhere, if someone knows any better please let me know. If you need any other .conf files also please tell me where to find them.

This is the problematic section that I referred to, which gets added by nvidia-xconfig:

Omg I completely missed that. OK I’m gonna remove it and see how that goes :smiley:

Thanks for the heads up :smiley:

Ok, removed it and all the nvidia modules from /usr/lib64/xorg/modules and works like a charm. Thank you so much :smiley:

That’s a great news!

So with the above configurations, you managed to have Optimus working?

Yes it’s working like a charm. I have tried Metroid Prime in Dolphin Emulator (on Vulkan), Tomb Raider (2013) on Steam and WoW Classic on Lutris. All work really well, I get ~5 FPS more than on Manjaro, especially on lower resolutions. The only thing that doesn’t work for some reason is vkcube.

Just for the record, I have a muxless laptop, so the NVIdia drivers can work on any configuration.

So I actually suggested someone to do the same modifications as you did in my post. But he disappeared and I cannot know whether this approach work.

Ok what I did was first install the drivers through the scripts. So I ran the pre_install.sh script. I rebooted, I didn’t log in, and went to a terminal (ALT +CTRL+F2) immediately. I ran the install.sh script and then the post_install.sh script. Then I rebooted to see if the latest drivers would work cause apparently they have some Prime offloading support.This didn’t work and I got an error screen.
I, then (using a terminal), followed the guide that was mentioned before and rebooted. I got a black screen and things still didn’t work.

I tried a lot of different things until I checked the /var/log/Xorg.0.log and found that the necessary ModulePaths weren’t loading. I’m sorry I don’t remember exactly what I did between the stage that wasn’t working and copying the modules to make things work. I suggest he checks his /var/log/Xorg.0.log and troubleshoots himself what’s going on exactly. But for future reference the above configuration files work, as long as you remove the problematic segment that was mentioned before.

That module file section is needed only because we installed the driver to /opt/nvidia.

Would you open a new post like “Notes for NVIDIA proprietary driver on laptop”? Quite a lot people had samilar issues. I will update my scripts to accommodate NVIDIA PRIME if more people succeeds with the configurations you have.

1 Like

Yeah I have no problem creating a topic. You mean create a topic and put all my config files in there?

yes. A separate post is more likely to be discovered by other users.

1 Like

I have a MSI GP62MVR-6RF with an MSI MAG241C as external display (with Displayport, so I can use G-SYNC). I used drivers 430.40 until last week, when after rebooting I couldn’t get in the GUI environment. After double checking all the config files, (look note 2 in this thread), the only way I could make it work again has been by installing the new version. There are some changes to the post-install script that had to be made, since the swupd --fix command wasn’t properly formatted (refer to the official guide to get the right command). I can only say you should really double check all the configs and the symlinks, because it’s easy to miss something.

swupd verify --fix has been marked as deprecated for a while, and from the first released version of my post-instal script, I use swupd repair instead.

Also, I’m actively updating the scripts. Now there’re scripts for updating.

I know, but swupd repair doesn’t support the --bundle option (at least it didn’t work to me). That’s why I had to fallback to the old one

I can verify that, swupd --repair --quick --bundle=lib-opengl didn’t work for me either during installation.

It used to support --bundle until last few weeks they disabled it because users will accidentaly remove system files when this command is not invoked in a correct way.

I opened a GitHub issue on this and they said it would be re-enabled after they make --bundle safer.

1 Like

I will think about how to solve this problem. On one hand, swupd repair doesn’t support --bundle at this point. On the other hand swupd verify --fix is marked deprecated and would be eventually removed.

1 Like

I would say that, if it works, use the old method. I know it’s deprecated, but until it gets removed it’s the best way to do it, unless you know of any workarounds.

Which card do you own?

This sister-thread will make it work with little-to-no trouble:


There is a more recent announcement and tips.

Additional tips for Optimus-based laptops.

The two threads have everything covered.

In a nut-shell.

NVIDIA users using 3000+/4000+ series cannot install Clear Linux using the graphical installer. So, booting into text mode it is. There’s no way around it.

Not sure which Clear Linux release? Install 38640. Do not upgrade until GNOME 44 stabilizes. CL 38650 introduces graphical glitches and decrease in OpenGL performance.

Install the LTS kernel for the least amount of troubles. For example: Blender does not support CUDA 12.x. Moreover, the 520 driver will not build on Kernel 6.2. Go into the advanced screen/tab during the OS installation and select the LTS kernel. The NVIDIA 520 driver installation will then succeed.

For Optimus laptops, uncomment the two lines in /etc/X11/xorg.conf.d/nvidia-drm-outputclass.conf after the driver installation before rebooting (described in the 2nd topic).