[Merged to stable] Adding Nvidia prime-offloading support to mhwd

I'm feeling the same as @openminded on this one: If I'm not using it I want to turn it off and don't eat energy/produce heat in any way.

Hmm, this isn't reflected by your history here. Must have been on another forum or another account.

Then all is fine and dandy and I'm all for it :slight_smile:

The GPU still goes into low power mode, so its not nearly as bad as you think.

A Linux project I work on attracts many new Linux users. Manjaro is our recommended distro since the developers are also using Manjaro and helping out there is a lot easier. Our communication channel is our telegram group. Its not rare that people try Manjaro only to end up with a broken install because of bumblebee, so that's why I pledged to work on this since a few months.

IMHO the real issue is not the freedom to use any driver you want or not.
It's actually the automatic installation for multi-vendor multi-gpu systems, which are currently stuck with bumblebee (when intel+nvidia), even if they have a Desktop, when bumblebee is clearly a laptop solution.

Then this brings mhwd devs to improve AI so a proper automatic solution is selected, especially considering the various installers that offer this by default, and Manjaro likes to provide an OOTB best experience.

In a few words... more code developing work is required, when there is so much work to be done with probably less hands/minds than are required.

This is a sad truth given the many threads regarding this topic I saw in my time here in #newbies .
I'm using an optimus laptop which just works out of the box even with nvidia disabled and using an external monitor. Didn't realize how lucky I got with this hardware till I came here :slight_smile:
That situation definitly is convoluted and complicated and could use every improvement available - so thanks for your efforts!

1 Like

Tested on my second optimus laptop:

GTX 1050 and Intel HD 630

Also tried playing some Team Fortress 2 as a test, also works just fine (using prime-run %command%)! I expected this tho because I've been using prime render offloading on that device since the patched XOrg server landed in testing.

For anybody interested, I've uploaded an ISO with prime support and virtual machine fixes. Nvidia users with GPUs unsupported by driver 440 should avoid this ISO, mhwd will probably try to install a driver that's not in the ISO and fail to do so.

I've replaced the mhwd packages with mhwd-tne and mhwd-db-tne, so please only use this ISO for testing. The packages are being hosted by chaotic-aur thanks to @Librewish.


Thanks for testing the patches!

(Adding some random text here, so I can send this to 2 different threads)

I have set up Nvidia Prime render offloading on my PC. Deleted the two mhwd files you listed and also deleted the file /etc/modprobe.d/mhwd-gpu.conf as instructed by this tutorial: Install Nvidia PRIME on Manjaro 18.1.4. Instead of creating the config file, I installed the nvidia-prime package which comes with the necessary Xorg config file and a script to run applications with the nvidia card (prime-run <command>), you can read more about the package in this arch wiki: https://wiki.archlinux.org/index.php/PRIME#PRIME_render_offload. Are the modules blacklisted in this file: /etc/modprobe.d/nvidia.conf as shown below okay or are there any other modules that are needed to be blacklisted?

blacklist nouveau
blacklist nvidiafb
blacklist rivafb

I don't understand why you would need to set this up manually. I even provided a working mhwd-db package...

Was playing with the manual config for a while and wanted to make sure that I had blacklisted the required modules. Installed your mhwd-db package, installed the prime render offload solution (440) and it works. Thanks for contributing this to the community.

1 Like

Just waiting for these changes to be upstreamed now... I'm used to open source projects providing feedback/accepting changes within hours so I'm a bit impatient :sweat_smile:

I hope that the changes have already been upstreamed. With the manual configuration, pci severity corrected and 'intel-pipe' (as I remember it) errors are sometimes listed when running journalctl -p 3 -xb but with the prime render offload installed from your mhwd-db package these errors no longer show. If the nvidia power management option in this post: https://archived.forum.manjaro.org/t/nvidia-offloading-not-powering-down-gpu/116633/2 works for all Pre-Turing NVIDIA GPUs supported by drivers 435 and 440, I request that you add that to the 435 and 440 prime mhwd configs.


I'll look into it. We cannot afford any decrease in compatibility tho.


I tried to rid of bumblebee, because have problem with intel driver.

Here is more full story

So Installed as describe in first post and sddm didn't start.

Then I install package
and sddm started, but

$ prime-run glxinfo
name of display: :0
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  152 (GLX)
  Minor opcode of failed request:  24 (X_GLXCreateNewContext)
  Value in failed request:  0x0
  Serial number of failed request:  39
  Current serial number in output stream:  40

So, Nvidia started, but don't work.
Driver nvidia I started manually

Where I can find new version of package to install?
xorg config is empty. Do I need fill it by myself?

I'm use KDE and new nvidia.

I added power management to the latest version I just pushed. Patch file and package files were updated. I couldn't get this to work on pre-turing cards tho, could you explain how you want me to implement that?

This is great tho :smiley:

Please note that you also have to install the *-prime MHWD config too. Just installing the mhwd-db package isn't enough.

Sounds like the nvidia driver isn't running at all.

You should NEVER have to do this. You misconfigured something or are running a partially upgraded system.

Install package update, thank you!

I checked, Nvidia driver runned.

$ nvidia-smi
Sun Jan  5 19:37:57 2020       
| NVIDIA-SMI 440.44       Driver Version: 440.44       CUDA Version: 10.2     |
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|   0  GeForce GTX 165...  Off  | 00000000:03:00.0 Off |                  N/A |
| N/A   43C    P8     3W /  N/A |      0MiB /  3914MiB |      0%      Default |
| Processes:                                                       GPU Memory |
|  GPU       PID   Type   Process name                             Usage      |
|  No running processes found                                                 |
WARNING: infoROM is corrupted at gpu 0000:03:00.0

Trying find reason. The same error.
Maybe switch to stable branch, install intel only and then install prime

Okay, I'm switched to testing.
Removed 440-prime. Removed everything with nvidia drivers, removed all in /etc/modprobe/modprobe.d/, removed conf in /etc/X11/
Then installed again 440-prime.
And this is working now.

I'm happy now. :star_struck:

1 Like

I read the document: https://download.nvidia.com/XFree86/Linux-x86_64/440.36/README/dynamicpowermanagement.html and I earlier scrolled first down to the Driver Settings page only to view the available options and but only today I read the supported configuration sections, and one part states that the feature is only for Turing GPU and newer. The funny thing about the NVIDIA power management option is that when I just watch YouTube videos using Firefox at 1080p on my Optimus Laptop's fans with a Maxwell NVIDIA GPU is are audible for a shorter time and the charger is not hot with the option set but without power management option set, the fans are audible for longer and sometimes louder and the charger may be slightly hot. Hope you configured the NVIDIA power management to work on Turing GPUs and newer if possible so that it can benefit users with those GPUs. Is the 0% power consumption or usage?

0% power consumption according to powertop. I had to add some udev configurations too. The YouTube thing is probably just the placebo effect in action, since Firefox does not use the GPU to decode videos in the first place and even if it did intel would be the default gpu.

Reinstalled the nvidia-prime 440 via mhwd with your changes that include nvidia power management and is also good but is better. The Laptop fans are more silent and sometimes less audible than usual when just doing non-resourse with the changes since I started using nvidia prime render-offload last year but I don't know why. Previously without the power management option set the fans are more audible and sometimes noisy when just doing tasks that are non-resource intensive including just watching youtube videos. Also when removing the power management option which I put earlier which is in the post before the changes, the pci severity=corrected errors are occassionally stated in the logs and sometimes the 'intel_pipe' are sometimes shown. I don't know if I my laptop is the only one with this kind of behaviour with the option set or not and it has a weak Maxwell GPU (930MX). Maybe I am using awkward (not debian definition) hardware :laughing:.

I just used this and it worked for OpenGL and surprisingly less performance on Vulkan but still good nontheless. Thank you!

Forum kindly sponsored by