Updating Nvidia Drivers to work with Optimus Switch

I had stopped regularly updating all packages on my system since the past few months (and only updated the occasional package which I needed a particular version of). But doing this sort of selective update broke my system today and I got it working again by updating all my packages and switching to Intel mode using Optimus Switch.

The major concern and reason for this post is that I am unable to boot into “Nvidia mode” of Optimus Switch.

So… I see that Manjaro now supports Nvidia 455xx, which is great! (I think that is the latest version that is supported on Manjaro + my GPU - is there a way to check which Nvidia driver version is available for my system? I am on “Intel mode” so I can’t use nvidia-smi) So maybe since I updated everything with sudo pacman -Syyu, there was an issue with my graphics driver. I think I had 450xx before this update.
How do I fix it?
First, I tried to check my current NVIDIA driver version which is difficult without having nvidia-smi available. mhwd -li and pacman -Q | grep nvidia didn’t help much.

[reik@reik-msi ~]$ mhwd -li
Warning: No installed PCI configs!
Warning: No installed USB configs!

[reik@reik-msi ~]$ pacman -Q | grep nvidia
mhwd-nvidia 455.45.01-3
mhwd-nvidia-340xx 340.108-1
mhwd-nvidia-390xx 390.138-1
nvidia-450xx-utils 450.80.02-1
nvidia-cg-toolkit 3.1-6
nvidia-sdk 11.0.10-1
nvidia-sdk-doc 11.0.10-1
opencl-nvidia 455.45.01-2

I started by looking at Optimus Switch’s README which says that I should install the appropriate graphics driver, and I tried to do so with sudo mhwd -i pci video-nvidia-455xx but that failed -

[reik@reik-msi ~]$ sudo mhwd -i pci video-nvidia-455xx
[sudo] password for reik: 
Error: config 'video-nvidia-455xx' does not exist!

I also tried without the “video” prefix going by this post - Update Nvidia Driver to 450 while using Optimus Switch

[reik@reik-msi ~]$ sudo mhwd -i pci nvidia-455xx
Error: config 'nvidia-455xx' does not exist!

“video-nvidia” has a conflict with “nvidia-455xx” so maybe that is the culprit?

[reik@reik-msi ~]$ sudo mhwd -i pci video-nvidia
> Installing video-nvidia...
Sourcing /etc/mhwd-x86_64.conf
Has lib32 support: true
Sourcing /var/lib/mhwd/db/pci/graphic_drivers/nvidia/MHWDCONFIG
Processing classid: 0300
Sourcing /var/lib/mhwd/scripts/include/0300
Processing classid: 0302
:: Synchronizing package databases...
 core is up to date
 extra is up to date
 community is up to date
 multilib is up to date
resolving dependencies...
looking for conflicting packages...
:: nvidia-utils and nvidia-450xx-utils are in conflict (nvidia-libgl). Remove nvidia-450xx-utils? [y/N] error: unresolvable package conflicts detected
error: failed to prepare transaction (conflicting dependencies)

:: nvidia-utils and nvidia-450xx-utils are in conflict
Error: pacman failed!
Error: script failed!

I would really appreciate your help in being able to boot into the “Nvidia mode” of Optimus Switch.

I would like to use the most recent NVIDIA drivers (which seems to be 460xx), but that comes second to being able to boot into the NVIDIA mode of my computer. Could you please help?

Some information about my system -
Kernel - 5.4.85-1-MANJARO (Open to using a more recent kernel)
GPU - Nvidia Geforce GTX 1070 Max Q
CUDA version - 11.2

Also, I see here - Is cuda 11 working with nvidia-455xx driver? that CUDA 11 (with NVIDIA 455x) only works with Linux kernel 5.8 and above. Is that true?

You very possibly want to install video-hybrid-intel-nvidia-prime, not video-nvidia. Before that remove every nvidia related package (except the mhwd-nvidia ones, except you can remove mhwd-nvidia-340xx) manually (as mhwd doesn’t seem to detect the already installed configuration). I believe you should be good to go after that. (Don’t forget to rebuild all Python packages that you have installed from the AUR if you haven’t done so already.)


It’s already in the unstable branch.

No. Optimus Switch does not use the hybrid drivers.

It seems like I have been able to fix the issue by doing the following (no reboot between steps) for future reference -

  1. Setting Optimus Switch to Nvidia mode
  2. Uninstalling Optimus Switch
  3. Uninstalling nvidia-450xx-utils
  4. Installing video-nvidia
  5. Installing Optimus Switch

It should work with video-hybrid-intel-nvidia-prime. I think you might be confusing something. There are no separate “hybrid drivers”. video-hybrid-intel-nvidia-prime is more or less the same as video-nvidia, but it additionally installs nvidia-prime, and applies udev/modprobe rules that enable PCI-Express runtime power management.

2 Likes

Hi,
I did last update without uninstaling optimus-switch. But I had to install it again after reboot like you. But I wonder if nvidia GPU is really powed off in inter-mode. I still have to check with powertop as I wonder also if custom acpi calls have been removed from my setup.

One way to check is by running cat "/sys/bus/pci/devices/0000:01:00.0/power/runtime_status" (where 0000:01:00.0 is the PCI bus id of the GPU).

Thanks. In intel-mode, with linux510:

[philippe@Probook-450 ~]$ cat "/sys/bus/pci/devices/0000:01:00.0/power/runtime_status" 
suspended
[philippe@Probook-450 ~]$   

And powertop returns in Device stats tab:
0,0% PCI Device: NVIDIA Corporation GM108M [GeForce 930MX]
It mention 0% for nvidia, as others are at 100%
So Nvidia GPU Should be off, as far as I know, cause dglt guide me to modify some files at that time. And I did not touch acpi calls since first setup

@dglt addresses this in the README of Optimus Switch - GitHub - dglt1/optimus-switch: *installer finished* installs nvidia prime and makes switching to intel only and back again easy as one command. intel mode fully disables the nvidia gpu to extend battery life.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.