DadSchoorse / vkBasalt

a vulkan post processing layer for linux
zlib License
1.24k stars 52 forks source link

Steam Deck support? #182

Open CHJ85 opened 2 years ago

CHJ85 commented 2 years ago

Hi there. In order to get vkBasalt working I have to install it system wide with root access, which doesn't work on the Steam Deck. Is there a workaround for this? Can I somehow install vkBasalt locally to my home directory and still be able to point Steam games to it in the Launch Options?

Tonux599 commented 2 years ago

I'm quite interested in this too. There is a 'vkBasalt' flatpak package in the Discover application but as far as I can tell there is no way to apply it to a game.

HellishINC commented 2 years ago

Can I somehow install vkBasalt locally to my home directory and still be able to point Steam games to it in the Launch Options?

You can install a program anywhere and call it globally if you add it to your $PATH in your .bashrc

Example:

export PATH="$HOME/.local/bin:$PATH"

This would then allow any programs under the ~/.local/bin to be called from anywhere as long as it's under the same user.

I'm not sure what $user the steam game UI runs under but if it's the deck user then you should be able to add it to a games run command.

ENABLE_VKBASALT=1 %command%

I don't know how this will interact with gamescope, gamemode, etc nor do I know if this will work at all but it's worth a try. Just FYI.

varlesh commented 2 years ago

For steam: https://github.com/flathub/com.valvesoftware.Steam.Utility.vkBasalt/blob/master/README.md For other example, package org.freedesktop.Platform.VulkanLayer.vkBasalt (yuzu flatpak): flatpak override --user --env=ENABLE_VKBASALT=1 org.yuzu_emu.yuzu Key HOME enable/disable vkBasalt, but by default it's enabled

CHJ85 commented 2 years ago

Awesome. But could you name the flatpaks so that in the Discover store it says "vkBasalt (for Steam)" and "vkBasalt (for YUZU Emulator)"? And also. You said it's for the Steam flatpak. Does that mean it's not gonna work for the Steam Deck, or does it recognize both the flatpak version and the regular version? I'm curious because the Steam client on Steam Deck is not a flatpak.

EDIT: Never mind. It's for flatpak steam only. And it's from 2020. @varlesh Is this flatpak gonna work on the Steam Deck?

TheEvilSkeleton commented 2 years ago

For steam: https://github.com/flathub/com.valvesoftware.Steam.Utility.vkBasalt/blob/master/README.md

Do note that all users should use org.freedesktop.Platform.VulkanLayer.vkBasalt, which includes Steam users. com.valvesoftware.Steam.Utility.vkBasalt is deprecated https://github.com/flathub/com.valvesoftware.Steam.Utility.vkBasalt/commit/0b2a360e11a2179fd370cb654f7194e5d424cc29.

EDIT: Never mind. It's for flatpak steam only. And it's from 2020.

Unfortunately yes. The vkBasalt flatpak only works with other flatpaks, not with system packages.

CHJ85 commented 2 years ago

@TheEvilSkeleton Right. That's why I was wondering how this flatpak was related to this issue. Perhaps @varlesh misunderstood. EDIT: if it'd be possible to modify the flatpak and allow it to work with system wide packages, I guess that would solve the problem. However. There is one problem. The Steam Deck's file system is immutable (hence the need for flatpak support). That means we're back to square one.

varlesh commented 2 years ago

Sorry, I didn't know this package was outdated

The Steam Deck's file system is immutable

It's not worked?

sudo passwd root
sudo steamos-readonly disable

After this you can install base-devel, yay, git and more packages from AUR.

CHJ85 commented 2 years ago

@varlesh That's not a solution though. It'll reset when there's a new Steam Deck update from Valve thus every change you made systemwide will be reset. I'm not gonna enable root access on my Steam Deck. That's just idiotic. And you can't expect others to do that either. It needs to be a locally installed flatpack and it needs to recognize the systemwide Steam installation.

TheEvilSkeleton commented 2 years ago

It needs to be a locally installed flatpack and it needs to recognize the systemwide Steam installation.

Unfortunately that can't be done, sorry.

It'd be really cool if Valve officially published and shipped the one from Flathub so these extensions could be easily integrated.

CHJ85 commented 2 years ago

@TheEvilSkeleton I agree. That's what they should have done. Or perhaps not. Wouldn't that give all kinds of issues with Wine/Proton?

TheEvilSkeleton commented 2 years ago

In my experience I haven't had any problems with Proton recently. I've been using the Steam flatpak and Bottles without any issues on Fedora Silverblue, which is an immutable distribution just like SteamOS.

CHJ85 commented 2 years ago

@TheEvilSkeleton Right. Proton itself is not the issue. I use Proton GE versions from ProtonUP-QT. But all of Valve's Steam Deck tweaks are on system level. Things like APU modules in the kernel, FSR support, running games off of an SD card and stuff like that. Not sure if this will work properly if the steam client is sandboxed. But I could be totally wrong. Honestly I don't know enough about this.

varlesh commented 2 years ago

vkBasalt has absolutely nothing to do with the Steam Deck project. It existed before the Steam Deck and other consoles. You have already been given 2 solutions to problems that you have not even tried to use. System update? Write a script! Everything can be solved - this is the Linux principle. A fully open game console is in your hands. Only you can update it, set the root password, another operating system. This is the power of open source. At the expense of flatpack, it's a container, read about it. But I dare say that thousands of Linux computers work with ROOT access and no one complains. Take an example, Android. Where a bunch of firmware and the ability to get ROOT are released. I hope you will understand that in the Linux world, no one owes you anything, but responds with help and support.

varlesh commented 2 years ago

Your console - your rules! You can modify it! You can install Windows. You can to brake it (sorry for that, it's joke). This project is amazing, support it and don't ask stupid questions. No offense :)

TheEvilSkeleton commented 2 years ago

@varlesh I don't see how that's a stupid question. I myself would hate to tamper my system just to get vkBasalt running. This is obviously impractical and shouldn't be recommended to an average user.

Things like APU modules in the kernel, FSR support, running games off of an SD card and stuff like that. Not sure if this will work properly if the steam client is sandboxed.

@CHJ85 Keep in mind that kernel modules are, well, baked in the kernel. As for FSR, that's baked in Proton, so whether the app is a flatpak or not, it'll work. I do agree with the SD card, though. For that, you have to use Flatseal to give more permissions.

Either way, needing to tamper the system or having to installl the Steam flatpak and thus have two Steam apps installed just to get vkBasalt running is really bad UX. I do admit that this can be vastly improved on SteamOS's end. They could start treating Flatpak as a first class citizen or ship those extensions by default. Unfortunately, for now, these are the only options I know of. I suggest the latter because I've had no problems with the Steam flatpak recently.

varlesh commented 2 years ago

@TheEvilSkeleton You can tell that to thousands of Linux computers and Android mobile devices. I understand that this is a problem for the average user. But the console is completely open. I think the author should find out what Linux is and what console he uses. I think you don't understand what prospects are open for this console.

TheEvilSkeleton commented 2 years ago

A console being open is not an excuse of needing to duplicate installs or tamper the system just to get something this basic installed.

varlesh commented 2 years ago

@TheEvilSkeleton Why this question on this tread? Why not on Steam?

TheEvilSkeleton commented 2 years ago

Cut them some slack. I've made the same mistakes too. It's difficult to contact the "right" developers. This is still a practical issue and the solutions we offered are horrible solutions. This doesn't make it less of a problem.

varlesh commented 2 years ago

Do you want to repeat once again that this project existed before the Steam Deck appeared? And that Steam Deck is a complete open platform with which you can do what your heart desires

varlesh commented 2 years ago

You can install vkbasalt - make it! It's hard for you? Sorry, not use it! :)

TheEvilSkeleton commented 2 years ago

Do you want to repeat once again that this project existed before the Steam Deck appeared? And that Steam Deck is a complete open platform with which you can do what your heart desires

No, I don't. I already made myself clear. You are free to be ignorant.

Kellegram commented 2 years ago

Elitists like you @varlesh are hilarious. Are you just looking for issues to attack the average user as a hobby? Looking kinda pathetic here tbh.

axtloss commented 2 years ago

A possible solution to the issue might be to manually compile vkBasalt but instead of using --prefix=/usr using --prefix=~/.local, which would install all files in the home directory.

varlesh commented 2 years ago

Maybe you should read what flatpack is. How does it work? What kind of security? Or maybe you need to understand that the Steam Deck operating system is a stripped-down (formally) Archlinux. And even better, if you want to add an improvement, then maybe you should study how it works and и built in. You have already been told that this is not possible. And you are continuing this discussion again.

axtloss commented 2 years ago

If you don't want to discuss it then how about you just ignore it? By having this completely useless discussion you aren't helping anyone. Why not just stay on-topic and help op to fix their issue?

varlesh commented 2 years ago

@axtloss I offered a solution, but in response I got idiocy

varlesh commented 2 years ago

Give root and write script - it's idiocy? Please tell me Linux users

axtloss commented 2 years ago

You know what a good response to "idiocy" is? Nothing. If something is idiotic then ignore it and don't clutter the issue with useless discussions.

varlesh commented 2 years ago

So did the ts try to solve the problem or can he only be indignant?

axtloss commented 2 years ago

The solution you provided may work, but it's not the solution op wants to use. As it would get reset on an update.

varlesh commented 2 years ago

Is it a problem to run the script after the update?But has he tried it? Or another soltion? You can tell me?

Kellegram commented 2 years ago

If op was able or willing to tamper with the read-only filesystem, they wouldn't be here on this issue. Advanced users will do with their steam deck what they will, but for vast majority of people this is not only out of scope for their knowledge, it's a bad idea in general. Just because you can do something, doesn't mean it's a good idea. Honestly this pointless "discussion" should just be marked off-topic, toxic people like you are of no help, you are just that, toxic. You preach about idiocy, ironic considering your responses here so far.

varlesh commented 2 years ago

I'm asking you a question again. What does this project have to do with Steam Deck and Valve? Unlike you, I have proposed a solution to the problem.

axtloss commented 2 years ago

A possible solution to the issue might be to manually compile vkBasalt but instead of using --prefix=/usr using --prefix=~/.local, which would install all files in the home directory.

After experimenting around with it a bit using distrobox to get an arch container for compiling it, I've realized that vkBasalt installs a linux library (*.so), which to my knowledge only work when put in root directories, in this case /usr/lib, which I don't think is writable by default on the steam deck. So it seems like there really isn't any solution that doesn't involve "unlocking" the steam deck.

varlesh commented 2 years ago

You want vkbasalt disable read-only file system and install yours execs on system? It's safe for you? It's easier than getting root access?

CHJ85 commented 2 years ago

I think I have a better solution than to enable root access and potentially bricking peoples steam deck. What if vkBasalt was patched in with Proton-GE? Then it could be provided as a Proton alternative in ProtonUp-QT app. Maybe call it Proton-GEVKB or something. Would that be a possibility or am I way off here?

axtloss commented 2 years ago

Would you be ok with testing some stuff for me? I think I may have found a solution but I'm not 100% sure if it'd work

varlesh commented 2 years ago

This is not possible - this is the principle of the container. If you want to get improvements, sacrifice, but only with your consent. You are responsible for what you do. This is the only thought I wanted to convey to you. There is no magic button :)

CHJ85 commented 2 years ago

@axtloss Your solution seems the most likely. But if .so files can only be read in a root directory, it needs to be compiled to a different format that doesn't require root. Hmm. @varlesh I want a streamlined solution that'll work for everyone. Not just me. People are receiving their Steam Decks, so I for one think solving this should be high priority. That's just my opinion anyway.

axtloss commented 2 years ago

@CHJ85 I believe I have found a solution

axtloss commented 2 years ago

First you'll have to install distrobox using this command: curl -s https://raw.githubusercontent.com/89luca89/distrobox/main/install | sh -s -- --prefix ~/.local, then you create an archlinux container using ~/.local/bin/distrobox create -i docker.io/library/archlinux -n dev-arch, which you then enter using ~/.local/bin/distrobox enter dev-arch, then you'll have to run sudo pacman -S vulkan-headers glslang gcc spirv-headers meson git which will install the needed dependencies. Once that's done you can clone the repository using git clone https://github.com/DadSchoorse/vkBasalt and then move into the directory using cd vkBasalt, once you've done that you can run meson --buildtype=release --prefix=~/.local builddir and then ninja -C builddir install Then, in steam, you set LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/.local/lib/ ENABLE_VKBASALT=1 %command%

This has worked for me on fedora kinoite, but I'm not 100% sure if it will work on the steam deck.

varlesh commented 2 years ago

sudo pacman -S :rofl:

varlesh commented 2 years ago

It's easy way, man?

CHJ85 commented 2 years ago

@axtloss Wow, that is awesome. Thank you. It's not necessarily streamlined, but at least it works (kinda). It works in desktop mode anyway. Not Steam Deck mode. Probably because that's a different user. Btw. That's another thing to keep in mind regarding the steam deck. You've got 2 users. Desktop mode and Deck mode. But thanks anyway @axtloss

CHJ85 commented 2 years ago

@varlesh You know. I haven't seen you come up with anything better. At least @axtloss is trying to help. What is your contribution? Leaving smart-ass comments and being an internet tough-guy? Word of advice. That is not how you win brownie points around here.

axtloss commented 2 years ago

Btw. That's another thing to keep in mind regarding the steam deck. You've got 2 users. Desktop mode and Deck mode.

Do you happen to know the username of the deck mode?

CHJ85 commented 2 years ago

@axtloss yes. That would be deck, so /home/deck/.

axtloss commented 2 years ago

@axtloss yes. That would be deck, so /home/deck/.

Not sure if that'd work, but if you can switch to the deck user during the desktop session using su deck you may be able to run the same steps for deck mode.

CHJ85 commented 2 years ago

@axtloss Deck mode doesn't have a terminal, or a DE for that matter. It's just the Steam big picture mode. EDIT: Obviously I can side load apps to the non-Steam games section, which means I can add the Konsole terminal and set it up that way.. Okay I'll give that a try. And then the docker should now be running in the background as idle every time I boot up the Deck?