Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Steam + Vulkan support (Proton) | Notes #6262

Closed
Fourdee opened this issue Mar 20, 2023 · 17 comments · Fixed by #6273
Closed

Steam + Vulkan support (Proton) | Notes #6262

Fourdee opened this issue Mar 20, 2023 · 17 comments · Fixed by #6273
Assignees
Labels
Enhancement 💨 Solution available 🥂 Definite solution has been done
Milestone

Comments

@Fourdee
Copy link
Collaborator

Fourdee commented Mar 20, 2023

As title, steam requires a Vulkan driver stack/support for DirectX wrapper.


  • Intel:
  • 🈯 Intel Iris onboard GPU
mesa-vulkan-drivers:amd64 
mesa-vulkan-drivers:i386 #Required for steam

  • 🈯 Nvidia 1660ti
nvidia-driver
nvidia-vulkan-icd
nvidia-vulkan-common

#+STEAM
nvidia-driver-libs:i386
libnvidia-glvkspirv:i386
nvidia-vulkan-icd:i386

  • AMD unknown (no access to HW)

To consider:

  • Adding Vulkan to base driver installs by default? It will replace OpenGL at some point.

Docs to enable proton (disabled by default):

  • Load Steam
  • Click View
  • Settings
  • SteamPlay
  • Enable Steam Play for all other titles
@Fourdee Fourdee self-assigned this Mar 20, 2023
@MichaIng
Copy link
Owner

MichaIng commented Mar 20, 2023

Many tanks for the info. While the Nvidia drivers will most likely work better, do Mesa Vulkan drivers work with Nvidia GPU as well?

I'm thinking about adding this to the dietpi-config menu as well:

  • An additional menu entry to install Vulkan drivers
  • Usually Mesa drivers will be installed (works with all platforms), but if Nvidia drivers are enabled already, the Nvidia Vulkan drivers will be installed
  • When enabling Nvidia drivers while Vulkan drivers are enabled, those will be switched to Nvidia Vulkan drivers as well
  • And generally we can enable this menu for AMD as well: The Radeon drivers are available for all architectures, the Nvidia drivers for ARM64. SBCs can in theory work with external graphic cards.

Just to understand correctly: Steam generally works without Vulkan. But to play Windows games on Linux, one needs to enable Proton, which requires Vulkan?

@Fourdee
Copy link
Collaborator Author

Fourdee commented Mar 21, 2023

Steam generally works without Vulkan. But to play Windows games on Linux, one needs to enable Proton, which requires Vulkan?

Yep correct.
Any OpenGL native games will work in Steam. Any Vulkan games Native or not, and Proton, requires Vulkan support.

do Mesa Vulkan drivers work with Nvidia GPU as well?

Not from my testing, nvidia-vulkan- was required for Vulkan support (install vulkan-tools package and test with vkcube).

SBCs can in theory work with external graphic cards.

Oh intresting 👍


An additional menu entry to install Vulkan drivers

I personally would install Vulkan support as part of any driver stack, that supports it. Make it available at OS level. I feel the user of a dedicated GPU will expect this API support from a GPU driver install, as much as OpenGL for example?


adding this to the dietpi-config menu as well

Not sure if we implimented it (might of just been an idea) but, wasnt there a GPU_index=2 (eg: RPi GL) in dietpi.txt, we could use in DietPi-Software to install selected GPU drivers?
Then GPU_index=0 could be None and uninstall all GPU drivers we cover. GPU_index=4 could be Nvidia etc?

I'll have a look through the code. Its been a while lol 🤣

EDIT: https://github.com/MichaIng/DietPi/blob/master/dietpi/dietpi-software#L5123 . Ok so maybe use dietpi-set_hardware, call that from dietpi-config. I'll do a PR and go from there?

@Fourdee
Copy link
Collaborator Author

Fourdee commented Mar 21, 2023

@MichaIng
Maybe something like this? https://github.com/Fourdee/DietPi/blob/dev/dietpi/func/dietpi-set_hardware#L2262-L2303

Then call from dietpi-config?

ToDo: During Steam install, still need to add i386 extras to driver install. Not sure best method yet.

@MichaIng
Copy link
Owner

I personally would install Vulkan support as part of any driver stack, that supports it.

You mean when selecting any of the three options of this menu? That makes it simpler, actually fine with me. The mesa-vulkan-drivers should be generally right on AMD GPUs as well, as it explicitly pulls libdrm-amdgpu1 as dependency.

Only downside is that then there is no option to install Vulkan on other GPUs like Rockchip Mali on SBCs. OpenGL/EGL libs are basically pulled in with any graphics software, including the X11 core package, so there is no point installing those explicitly or as additional option. But for Vulkan and also in cases GLES2 this is different, so having an option to enable/install those on any GPU is actually nice.

Currently we install GLES2 on demand for e.g. Kodi on ARM. We could definitely do the same with Vulkan for Steam. We also do an Nvidia GPU check there to decide whether to install the nvidia-driver-libs:i386 or not. I'm not sure how reliable this check is, but based on it we could install as well nvidia-vulkan-icd or otherwise mesa-vulkan-drivers.

@MichaIng
Copy link
Owner

MichaIng commented Mar 21, 2023

Maybe something like this?

Jep makes sense to add it there, so we can call this from dietpi-config as well as dietpi-software.

In dietpi-config, it makes sense then to make this a single driver stack selection, and I'd add "Generic" then: None, Intel, Nvidia, AMD, Generic (mesa-vulkan-drivers and probably libgles2). Storing this as new dietpi.txt option for non-interactive/first-run-setup Steam installs, and allow interactive selection as well? And during non-interactive Steam installs, if nothing was chosen, we can at least auto-detect Nvidia cards and then also install the i386 libs as we do currently:

[[ -e '/sys/module/nvidia/version' ]] && nvidia=('nvidia-driver-libs:i386')

EDIT: Also VA-API can be extended: https://packages.debian.org/en/bullseye/va-driver
Originally it's an Intel thing, but AFAIK nowadays other GPUs (can) make use of this as well, in this case with the Mesa VA-API driver.

@Fourdee
Copy link
Collaborator Author

Fourdee commented Mar 23, 2023

@MichaIng Yep sounds good. I'll continue with changes and let you know when its ready.

@MichaIng
Copy link
Owner

DietPi-Automation | Add ``GPU_INDEX=``` support?

Would be great. Could be added to DietPi-Automation_Pre() or DietPi-Automation_Post(). Ignore the obsolete info that network connectivity wouldn't be assured in DietPi-Automation_Pre(): On first login, dietpi-update runs and checks for + requires network connectivity, and we to G_AGDUG in DietPi-Automation_Pre(). So it makes more sense to decide whether the GPU driver should be installed before or after software installs. I've no clear preference. If dietpi-set_hardware adjusts the dietpi.txt setting as well, and change done by software installs, e.g. if the Steam install changes it from "None" to "Nvidia", would be preserved in both cases.

@Fourdee
Copy link
Collaborator Author

Fourdee commented Mar 24, 2023

@MichaIng
I went for a system where we can reinstall drivers + i386 extras as needed, using dietpi-set_hardware
So if a user installs steam after a GPU driver install, it will re-check during steam install. Cover all possibilites.
#6262 (comment)

Will do some testing and get back to you 👍

@MichaIng
Copy link
Owner

Sounds great, many thanks!

@MichaIng MichaIng added this to the v8.16 milestone Mar 24, 2023
@Fourdee
Copy link
Collaborator Author

Fourdee commented Mar 24, 2023

@MichaIng
Ah looks like config inject is setting Setting in /boot/dietpi.txt adjusted: CONFIG_GPU_INDEX=enable instead of indexs.
Anyway to tell G_CONFIG_INJECT to not override number value sent to text?

Ignore me, due to 🤣
https://github.com/Fourdee/DietPi/blob/dev/dietpi/func/dietpi-set_hardware#L39-L49


https://github.com/Fourdee/DietPi/blob/dev/dietpi/patch_file#L2090-L2097 not patching for some reason? Did update with

DEV_GITBRANCH=dev
DEV_GITOWNER=Fourdee

But command works.

root@DietPi:~# dpkg-query -s nvidia-driver &> /dev/null && gpu_index_current=2
root@DietPi:~# G_CONFIG_INJECT 'CONFIG_GPU_INDEX=' "CONFIG_GPU_INDEX=$gpu_index_current" /boot/dietpi.txt
[  OK  ] G_CONFIG_INJECT | Setting in /boot/dietpi.txt adjusted: CONFIG_GPU_INDEX=2

@MichaIng
Copy link
Owner

MichaIng commented Mar 24, 2023

Ignore me, due to 🤣

I never liked this 1 => enable/0 => disable translation but like it to be rather explicit. We could switch consequently to 0/1 (does not need to be beautiful here, we use it internally only) or enable/disable. Or otherwise to keep changes minimal, translate it the other way round: enable => 1, disable => 0.

not patching for some reason?

That one is only used on DietPi systems older than v7.x. New patch file is here: https://github.com/Fourdee/DietPi/blob/dev/.update/patches

@Fourdee
Copy link
Collaborator Author

Fourdee commented Mar 24, 2023

@MichaIng

I never liked this 1 => enable/0 => disable translation but like it to be rather explicit.

Let me know how you want it. Maybe GPU_DEVICE=Nvidia instead of GPU_INDEX=2. I can change if needed?

DietPi systems older than v7.x

Nice 👍

@MichaIng
Copy link
Owner

Let me know how you want it. Maybe GPU_DEVICE=Nvidia instead of GPU_INDEX=2. I can change if needed?

Using textual inputs seems quite a good solution as well. Probably GPU_DRIVER to be a bit more precise what it is about?

@Fourdee
Copy link
Collaborator Author

Fourdee commented Mar 25, 2023

Using textual inputs seems quite a good solution as well. Probably GPU_DRIVER to be a bit more precise what it is about?

Yep. Done a rewrite, changed from index based to name system.

Just doing patch + fresh driver install tests now. Will get back to you with PR when done.

@Fourdee
Copy link
Collaborator Author

Fourdee commented Mar 25, 2023

Pretty much done.

🈯 Tested patch with both Nvidia and Intel. Steam working fine now on both. Unable to test AMD (no HW).

Added a "Custom" GPU driver option to allow user/manual setups, and have DietPi ignore any driver changes. Felt this was needed, espically for exisiting installs where users may have a custom driver install we should not touch.

Patch now prompts user to select new GPU driver for x86.

ToDo:

@MichaIng MichaIng linked a pull request Mar 25, 2023 that will close this issue
@MichaIng MichaIng added the Solution available 🥂 Definite solution has been done label Apr 1, 2023
@MichaIng
Copy link
Owner

MichaIng commented Apr 1, 2023

Done with DietPi v8.16 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement 💨 Solution available 🥂 Definite solution has been done
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants