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

Great to hear you agree with my perspective!

As outlined in my original post, I'd be interested in adding the relevant bash scripts/"configs" to mhwd myself if team members are interested in adopting the proposal.

2 Likes

You don't need to do step 3 since nvidia-xxxxx-utils provides the necessary Xorg configuration for PRIME Offload to work on both Intel and AMD system. That configuration file is located on/usr/share/X11/xorg.conf.d/10-amdgpu-nvidia-drm-outputclass.conf for AMD and /usr/share/X11/xorg.conf.d/10-intel-nvidia-drm-outputclass.conf for Intel.

+1 for mhwd integration. I'm too stupid to set this up myself.

If this really does work then it’ll be good to see the back of fumblebee. Which hasn’t seen an update in over 6 years and only seems to work for 1/10 users.

It does work. I've helped people that had trouble with bumblebee set it up. Manjaro is a distro known for its hardware support, so having optimus laptops just not work for some/(most?) users is not acceptable. Nvidia's solution works for all users I've tried it with so far (although I wish they would use DRI_PRIME instead of whatever the f*** they're using to name their variables... Well I also wish they would just open source their drivers but I digress).

I've developed a prototype for anyone daring to test this on their Nvidia Optimus laptop (development done on testing branch, YMMV).

NOTE: Your GPU needs to be supported by the Nvidia driver version 435 or 440.

Instructions:

  1. Make sure you do not have any custom xorg config files (not by mhwd) in /etc/X11/xorg.conf.d/
  2. Download the mhwd-db package
  3. Install the package sudo pacman -U mhwd-db-0.6.3-16-x86_64.pkg.tar.xz
  4. Open the mhwd GUI
  5. Uninstall any other nvidia drivers
  6. Install the video-hybrid-intel-nvidia-xxxxx-prime of your choice
  7. Reboot
  8. (Assuming that you booted successfully, otherwise go to step 9) Try glxinfo | grep "OpenGL renderer" && prime-run glxinfo | grep "OpenGL renderer"
  9. Tell me what happened

In this modified mhwd-db I also removed some stub configs (at least I think they're stub configs) that do not actually install any packages or modify the system in any way. (Pinging @philm, is it OK to remove these configs?)

A git patch file is available here.

Any success/failure reports are appreciated.

4 Likes

Tried it with a user on telegram, works great so far.


image

1 Like

[chard@doggo ~]$ glxinfo | grep "OpenGL renderer"
OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 630 (Kaby Lake GT2)
[chard@doggo ~]$ prime-run glxinfo | grep "OpenGL renderer"
OpenGL renderer string: GeForce GTX 1050/PCIe/SSE2

1 Like

And on second laptop
[chard@pupper ~]$ glxinfo | grep "OpenGL renderer" && prime-run glxinfo | grep "OpenGL renderer"
OpenGL renderer string: Mesa DRI Intel(R) UHD Graphics (Whiskey Lake 3x8 GT2)
OpenGL renderer string: GeForce GTX 1050 with Max-Q Design/PCIe/SSE2

1 Like

Thanks for testing this. Great to see its working!

To be honest, manjaro is one of the harder projects to contribute to, because merge requests aren't really a thing. I've gotten more pull requests accepted by bitnami and intel than I get responses from the manjaro team. Kind of a shame because manjaro is supposed to be community project.

Only issue i see is nm-applet will not restart after sleep, affects both laptops using XFCE

That does not sound like a graphics issue. What DE are you using?

XFCE for DE Xfwm4 Wm Unstable Branch BTW

And ctually network is up just the tray indicator shows it
down

Hopefully the team adds this (contributing process improvements) to their new year's resolutions, @philm, @oberon.

3 Likes

I've been trying to get this to work with an ISO, but I've stumbled upon some very interesting roadblocks:

  1. ISO images that I build always have their pacman-mhwd.conf files in /opt instead of /opt/mhwd like /usr/bin/mhwd-live requires.
  2. Official ISO images ship with an outdated mhwd-db or something because /opt/pkg (should actually be /opt/mhwd/pkg, see point 1) doesn't contain Nvidia 435 and mhwd doesn't know about anything above 418 in live systems (also throws tons of errors, but I digress)

So to summarize the steps needed to get this working in ISOs:

  1. Add 435xx or 440xx + nvidia-prime to Packages-Mhwd in profiles
  2. Let mhwd know about that driver in whatever custom mhwd-db is being used for Manjaro ISOs (important: if live mhwd tries to install a driver that doesn't exist in /opt/mhwd/pkg, it will error)
2 Likes

These observations look serious.
I would suggest you post them at GitLab/mhwd and/or GitLab/iso-profiles, or where you think it is better suitable, as issues, even if no contributing is possible.

What can we do?... That's the Manjaro team... Too busy!... :man_shrugging:

3 Likes

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

Forum kindly sponsored by