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

Good idea! The issue I submitted yesterday got looked at quickly by oberon. I'll just submit a patch file and some text explaining the purpose.

Edit: yes

5 Likes

This is great but should be limited based on GPU generation. Only Turing and newer makes sense. Battery life for Pascal and older is dramatically short when using this offload solution.
Another option is to use some more sophisticated tools like Optimus-manager, which allows easy switch between different modes.

It should be at least an option to choose for pre turing imo. 90% of the time my laptop is on power adapter. And I don't want to be forced to use old drivers. Yes it's not economical and ecological reasonable..

Mine too, mine too. But it's very odd to force everyone use a solution which has only one option. It should be done at least similar to how Ubuntu does it, otherwise there's no sense in such approach.
Any mhwd changes concerning Nvidia offload must provide some way to quickly and easily turn off pre-Turing GPUs. Now it is Bumblebee with bbswitch. It could be O-M with bbswitch. But it shouldn't be "only Prime, say goodbye to your battery haha, I don't use it so you all won't be able to use it too".

1 Like

I like that you provided a package of your changes. Your patch looks fine so far, might need some testing. I would keep the old configs. Most likely modern PCs won't use them but we still provide those drivers in our ISOs. We might reduce the supported drivers back to the big three (AMD,NVIDIA,INTEL) as other cards are already well supported by the kernel. Create a full clone of mhwd-db add your changes and point me to that git-repo. I'll look to find a way to include your changes.

4 Likes

Please note that the packages I removed don't actually install any drivers or modify the system in any way. They all the end up using the modesetting driver. Xorg automatically uses the modesetting driver on these devices without mhwd intervention. Would you still like me to re-add the stub mhwd configs anyway? Alternatively, combining the remaining mhwd configs (excluding nvidia) into video-linux would also be an option.

Currently, 4 users have tested it, seems to work so far, but more testing has to be done.

Git repo link: https://gitlab.com/TotallyNotElite/mhwd-db-tne

We already talked about that and I still disagree. The fact of the matter is that battery life on my pre-turing laptop was still more than acceptable and the convenience of not having to restart Xorg is unmatched.

Let's not forget about the countless optimus users I've helped over the years, many being Linux critics. Having to manually set up a working solution because bumblebee doesn't work properly isn't ideal.

This is Linux, nobody is forcing you to use prime offloading.
image

1 Like

I know you disagree with me, you know I disagree with you. That's the point.

This will be the next logical step: removing Bumblebee options without offering any alternative.

But I get it. Simple solutions are better than more complex ones.

That wouldn't be my decision and older GPUs not supported by 435xx+ would suffer (better to have some solution that works at least some of the time than to have no solution). Don't forget that users are free to install whatever graphics solution they want. I'm just happy that nvidia FINALLY gave us a real solution to this problem (meanwhile DRI_PRIME has been doing this exact same thing for years now with open source drivers...).

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.

https://sourceforge.net/projects/tne-manjaro-mhwd/files/manjaro-kde-18.1.5-minimal-200103-linux54-mhwdfix.iso/download

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://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.

2 Likes

Forum kindly sponsored by