mutter-primary-gpu icon indicating copy to clipboard operation
mutter-primary-gpu copied to clipboard

GNOME 43 support

Open tjholm opened this issue 2 years ago • 13 comments

Adds basic GNOME 43 support by adding a new front end for quickSettings (as aggregateMenu has been removed in 43).

image

The toggle currently does nothing, need to think of behaviour for this e.g. off for integrated GPU and on for next available non-integrated GPU?

Using the popup menu should work identically to current functionality, have tested this selecting single GPU but not with multiple (currently waiting for new eGPU to arrive).

tjholm avatar Jan 29 '23 01:01 tjholm

This looks great, if you need a tester with a amd igpu (amd ryzen 5800h) and a nvidia dgpu (nvidia rtx 3070 mobile), just mention me. 😄

AshtakaOOf avatar Jan 29 '23 02:01 AshtakaOOf

Unfortunately this doesn't work for me. It seems to work ok with only the iGPU, but as soon as an eGPU is connected it doesn't show anything in the list: image

If the eGPU is already primary and then removed it does show 2 entries in the list: image

so it seems like maybe an issue with how the menu updates? Let me know if you want me to provide more info or logs.

ewagner12 avatar Jan 29 '23 02:01 ewagner12

@ewagner12 thanks for testing this.

I've added a missing sync call for the menu on init. That might help. The menu state should also re-sync whenever the popup menu is opened.

Will add some more debug logging if that doesn't help to track down the issue.

tjholm avatar Jan 29 '23 04:01 tjholm

@tjholm Unfortunately that didn't change anything on my end. I've attached what I believe are relevant logs from journalctl -f when I open the menu with the eGPU plugged in. No output in journalctl when opening it without the eGPU.

err_out_1_29.txt

ewagner12 avatar Jan 29 '23 06:01 ewagner12

@ewagner12 thanks for that.

Looks like it may be an issue with running gnome-control-center-print-renderer while your egpu is connected. I've thrown in some error handling to try and catch this case, so at least if the human readable name of your eGPU can't be retrieved then it should just list as /dev/dri/card1 like in your screen cap before.

I'm curious what the results of running

udevadm info --query=property --property=ID_PATH_TAG /dev/dri/card1

then running the following with the resulting ID_PATH_TAG that you get e.g. pci-0000_00_02_0

DRI_PRIME=<YOUR_ID_PATH_TAG> /usr/lib/gnome-control-center-print-renderer

OR

DRI_PRIME=<YOUR_ID_PATH_TAG>  /usr/libexec/gnome-control-center-print-renderer

Depending on where gnome-control-center-print-renderer is located on your machine.

tjholm avatar Jan 29 '23 06:01 tjholm

@tjholm Awesome! That fixes it and it works as expected for me now.

As for the output from gnome-control-center-print-renderer, it looks like it segfaults:

DRI_PRIME=pci-0000_05_00_0 /usr/libexec/gnome-control-center-print-renderer
AMD Radeon RX 580 Series (polaris10, LLVM 15.0.6, DRM 3.49, 6.1.7-200.fc37.x86_64)[1]    14754 segmentation fault (core dumped)  DRI_PRIME=pci-0000_05_00_0 /usr/libexec/gnome-control-center-print-renderer

ewagner12 avatar Jan 29 '23 07:01 ewagner12

@ewagner12 good to know that works.

Interesting that segfaults, will need to check out open issues for gnome-control-center.

@AshtakaOOf any testing would be great! Let me know if you need a hand.

tjholm avatar Jan 29 '23 07:01 tjholm

I can test on laptop with intel igpu and nvidia 1660ti

ThatMarko avatar Feb 22 '23 03:02 ThatMarko

I forgot about this, but is there any change needed to use this on 44?

AshtakaOOf avatar Aug 29 '23 01:08 AshtakaOOf

I'm working on this and will hopefully be able to merge it and make the necessary changes to support recent versions of Gnome.

zaidka avatar Aug 31 '23 18:08 zaidka

Gnome 45 is out and I'd love to be able to use this!

Californian avatar Oct 16 '23 22:10 Californian

@zaidka @tjholm happy to help however to get this good for Gnome 45. I can test on an Intel + Nvidia eGPU setup. Also happy to help contribute to a PR if you can point me in the right direction

mattkang avatar Feb 14 '24 04:02 mattkang

I started looking into Gnome 46 in https://github.com/Betree/mutter-primary-gpu/pull/1.

It still needs more work, but I just wanted to flag here that due to the changes in imports made in https://gjs.guide/extensions/upgrading/gnome-shell-45.html, preserving backward compatibility will be challenging.

Betree avatar Apr 26 '24 15:04 Betree