WayfireWM / wayfire

A modular and extensible wayland compositor
https://wayfire.org/
MIT License
2.39k stars 179 forks source link

Is wayfire capable to work with hybrid graphics? #857

Closed kanyck closed 3 years ago

kanyck commented 3 years ago

Couldn't find any info on this. And couldn't make wayfire or an app see dGPU at any rate. switcheroo shows dGPU powered but inactive no matter what I tried. The app performance is suffering, of course. Thanks!

ammen99 commented 3 years ago

Wayfire supports multiple GPUs via wlroots, however, the support is less-than-ideal because of how the wlroots backend works. For Wayfire itself, you need to choose a single GPU device that will be used all the time, so I would recommend running Wayfire itself on the iGPU (not to mention that iGPUs are generally enough for Wayfire).

For apps, I think they should be able to use the dGPU just fine (with DRI_PRIME or whatever you use to launch an app on the dGPU). Have you tried this? What happens?

kanyck commented 3 years ago

It looks like DRI_PRIME=1 has no affect. vainfo and DRI_PRIME=1 vainfo show the same card. firefox and DRI_PRIME=1 firefox show the same speed in test. If I start DRI_PRIME=1 firefox I don't see any change in /sys/kernel/debug/vgaswitcheroo/switch: dGPU is powered but inactive. All that makes me think that I can only use iGPU for some reason. Maybe I have to do some passes to make it visible to wlroots/wayfire/apps? BTW this your project makes me happy. I've been using Compiz for more than a decade and seeing it slowly dying have been quite disappointing)) Thanks for your efforts!

ammen99 commented 3 years ago

What is your dGPU (model) ? Which drivers do you use?

ammen99 commented 3 years ago

And also, can you explain what you are doing for ex. on X11 to make the apps use your dGPU?

kanyck commented 3 years ago

The laptop is quite old -- its AMD ARUBA integrated and AMD TURKS discrete, both under radeon/r600 naturally. I did some investigation under X11, too. Switching seem to work under X but in a weird way. glxinfo | grep renderer shows ARUBA DRI_PRIME=1 glxinfo | grep renderer shows TURKS --> OK so far. However vblank_mode=0 glxgears shows about 4000fps while DRI_PRIME=1 vblank_mode=0 glxgears shows only 2500... I know that glxgears is not a benchmark but it still reflects the situation more or less. And browser benchmarks did not show any improvement over iGPU, i'd say the numbers are a little bit less, too. (The numbers vary between runs, so I can't tell for sure). IIRC when I fiddled with it some years ago, the dGPU showed significanly better performance than integrated card, what was quite natural (more memory, more shaders, etc). Anyways, it doesn't seem to relate to wayfire anyhow, rather to underlying software regression or misconfiguration or even some hardware issue. So I'm closing this issue as irrelevant. Sorry for involving you in this... I should have checked X11 first... however if you already have some ideas on the matter -- please share.

ammen99 commented 3 years ago

Unfortunately the last time I have used dGPU was 5-6 years ago, and it definitely did not work under Wayland. Regardless, I think that DRI_PRIME=1 should work if your system is configured properly: https://www.phoronix.com/scan.php?page=news_item&px=wayland-dri-prime-mesa-nodes