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

And according to this


all should be set then ...

I know. Multiple people I've helped are running it too.

This will make mhwd options list for Nvidia even more confusing.
I guess Manjaro will eventually have to adopt optimus-{manager|switch} logic.
I use manager in hybrid mode and quite happy with it...

Except optimus manager and optimus switch use some of the same hacks for switching and other stuff and therefore end up having some of the same problems that bumblebee has.

Let's stop all this fragmentation once and for all by adopting the official and most stable way to use the dGPU on optimus devices.

3 Likes

The official and the most stable way as you mean it isn't the one-and-only-the-best solution for everyone. Say, I don't want my dGPU to be enabled when on battery power, and most people think the same I guess. But your suggestion is to keep dGPU always running. Optimus-manager has means to control this behavior without much hassle.
Another thing I can think of is a bunch of issues happening on modesetting driver, it works fine for some devices, and not that good on others. Again, optimus-manager has a set of options that allow setting either modesetting or intel driver for iGPU, and many more. In other words, it is already more flexible than what you offer.

1 Like

Optimus-manager has means to control this behavior without much hassle.

Yea no. Tried that, froze the system. Had to chroot in to uninstall it. Same with bumblebee. Nvidia's solution does one thing right: It works. It works for games, it works for programs, it doesn't freeze the system.

I understand that optimus-manager may work just fine for you and that's great! But you must consider that some people WILL have problems with the more hacky solutions.

I'm not arguing that you shouldn't be allowed to use optimus-manager or related tools, not at all! I'm simply saying that Nvidia prime-offloading should be the default mode of operation for manjaro users because it offers the highest success rate from the data I have collected. Bumblebee is just simply too unstable and unreliable.

Users are still free to manually switch to a solution that does a slightly better job at preserving the battery, but its important that we finally get optimus laptops working out of the box without any manual intervention.

3 Likes

I agree with that (and OT request). The point is, this discussion has been done already and Manjaro Team knows about it. They are probably considering the best way to go with this, which obviously needs a lot of thinking, coding and designing.

Providing a safe successful 1st installation for Optimus or multi-GPU systems is a legitimate perspective. Then a user can go for a better setup, if needed.

It's been very long time that bumblebee is considered to be removed from default config for dual-gpu systems (even Desktops/non-Optimus).

Time is money?...

1 Like

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.

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

1 Like

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.

5 Likes

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

image
image

2 Likes

[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

Forum kindly sponsored by