bottlesdevs / Bottles

Run Windows software and games on Linux
https://usebottles.com
GNU General Public License v3.0
6.51k stars 277 forks source link

[Request]: Support `--prefer-vk-device` for Gamescope #2181

Open cyberphantom52 opened 2 years ago

cyberphantom52 commented 2 years ago

Tell us the problem or your need

This argument allows us to force gamescope to run on the specfied GPU. It is extremely useful on laptops with NVIDIA GPUs as you can just run gamescope on the iGPU which would be AMD/Intel, both of which gamescope runs on nicely and the game itself runs on NVIDIA GPU.

Describe the solution you'd like

There are two ways this can be implemented, either bottles can automagically detect the possible GPUs on the computer and provide them as a drop down list or the easier way would be to allow the user to enter the pci id of the device manually.

I tried to implement the latter myself, but i am pretty new to linux development in general and got confused over how to make it appear in the preferences menu. :P

Other solutions?

No response

Additional context and references

No response

TheEvilSkeleton commented 2 years ago

I have a different proposal for the UI/UX: this could be handled through enabling or disabling "Discrete Graphics" from the bottle preferences, to avoid duplicated entries. If Discrete Graphics and Gamescope are enabled, Bottles won't run with --prefer-vk-device, however disabling Discrete Graphics will intelligently make Bottles enable --prefer-vk-device. If Gamescope is disabled, then Bottles will do the normal way of using discrete graphics.

For reference, this is precisely what we do with MangoHud and mangoapp:

https://github.com/bottlesdevs/Bottles/blob/4966833e3e115b527d2037874f1b47632961f704/bottles/backend/wine/winecommand.py#L455-L469

Edit: never mind. I just looked through the manpage and it allows to do a lot more than that:

  --prefer-vk-device             prefer Vulkan device for compositing (ex: 1002:7300)