ValveSoftware / steam-for-linux

Issue tracking for the Steam for Linux beta client
4.13k stars 174 forks source link

New Big Picture Doesn't support Hardware Acceleration on Linux #8918

Closed papamikey closed 8 months ago

papamikey commented 1 year ago

Your system information

Please describe your issue in as much detail as possible:

Ever since the new big picture was accessible on PC, (start of this year modifying the beta file in steam to the steam decks, to today) the new big picture interface runs at about 15 fps in fullscreen (1440p). If I minimize it to 720p, it runs at about 60 fps. However, on windows, it runs at 165 fps regardless of resolution. This issue seems to affect a lot of people across different forums, hopefully it will get fixed soon.

papamikey commented 11 months ago

With the new update today there is no artifacts! Great work valve, performance is still pretty bad, but at least it's usable!

alexis-belmonte commented 11 months ago

I currently am observing that the Steam client purposely blocks GPU compositing/rendering on my system.

I got to see the full command line used to launch the steamwebhelper binary:

/home/alexis/.local/share/Steam/ubuntu12_64/steamwebhelper
--type=renderer
--disable-seccomp-filter-sandbox
--force-device-scale-factor=1.00
--log-file='/home/alexis/.local/share/Steam/logs/cef_log.txt'
--field-trial-handle=17280965424695382527,17308932074744730194,131072
--enable-features=CastMediaRouteProvider
--disable-features=SameSiteByDefaultCookies
--disable-gpu-compositing
--enable-blink-features=ResizeObserver,Worklet,AudioWorklet
--disable-blink-features=Badgin
--lang=fr
--log-file='/home/alexis/.local/share/Steam/logs/cef_log.txt'
--product-version='Valve Steam Client'
--force-device-scale-factor=1.00
--buildid=1685572056
--steamid=0
--num-raster-threads=4
--enable-main-frame-before-activation
--renderer-client-id=10
--shared-files=v8_snapshot_data:100

Even though there are a lot of flags, only two of them (from what I can think of) are responsible of forcing CEF to do software rendering:

Flag Description
--disable-gpu-compositing This is probably causing the CPU to do all of the rendering workload
--num-raster-threads=4 This tells CEF to use 4 CPU threads to do the rendering

I am trying to figure out if there is a way to alter the flags passed so that we can both:

Here are the flags that I would specify to steamwebhelper: Flag Description
--ignore-gpu-blocklist Try to use the GPU, even if it has been blacklisted
--enable-gpu-rasterization Use GPU rasterization instead of offloading to the CPU
--enable-zero-copy Tell the GPU to do DMA instead of the CPU
--enable-features=VaapiVideoDecoder,VaapiVideoEncoder Enable proper VA-API accelerated video decoding and encoding (if that ever has a use in this context)

Those flags are the same that I came up with when configuring Google Chrome on my machine so that it uses my GPU with Wayland -- so if you also happen to have a chrome-flags.conf that works for your setup, you should use the same flags for steamwebhelper as well.

I'll post an update if I ever find a way of accomplishing what I need to do in order to have a smoother BPM experience on Linux distributions.

Saghen commented 11 months ago

This was a great tip thank you @alexis-belmonte!! I've found that "steam (runtime)" (notably not "steam (native)" for me) calls ~/.local/share/Steam/ubuntu12_64/steam-runtime-heavy/run.sh on my system in order to start steamwebhelper. I've added the following lines at the bottom replacing exec "$@":

# Not steamwebhelper so skip
if [[ "$1" != *steamwebhelper* ]]; then
  exec "$@"
  exit
fi

args=()

# Read blocklist from ~/.config/steam-flag-blocklist.conf
blocklisted_flags=()
while read flag; do
    blocklisted_flags+=("$flag")
done < "$XDG_CONFIG_HOME/steam-flags-blocklist.conf"

# Filter arguments using the blocklist
for arg in "$@"; do
  include_arg=true

  for blocklisted_flag in "${blocklisted_flags[@]}"; do
    if [[ "$arg" == "$blocklisted_flag" ]]; then
      include_arg=false
    fi
  done

  if $include_arg; then
    args+=("$arg")
  fi
done

# Add additional flags from ~/.config/steam-flags.conf
while read flag; do
    args+=("$flag")
done < "$XDG_CONFIG_HOME/steam-flags.conf"

# Execute
echo "${args[@]}" >> /tmp/steam-args
exec "${args[@]}"

And here are the flags that I personally send

~/.config/steam-flags-blocklist.conf

--disable-gpu
--disable-gpu-compositing
--use-angle=gl
--disable-smooth-scrolling

~/.config/steam-flags.conf

--ignore-gpu-blocklist
--disable-frame-rate-limit
--enable-gpu-rasterization
--enable-features=VaapiVideoDecoder
--use-gl=desktop
--enable-zero-copy

For debugging, tail -f /tmp/steam-args will contain the executed command. This should work for sending any flags to steamwebhelper!

alexis-belmonte commented 11 months ago

@Saghen I had tried a similar solution, altering steamwebhelper.sh instead of steam-runtime-heavy/run.sh -- but since the files present at the root of ubuntu12_64 were overwritten each time the launcher found out that they had been modified, I had to chown root:root ... + chmod ga-r ....

Your solution seems more elegant, and it works great! The only thing that I had to do was to add a line at the start of your patch so that XDG_CONFIG_HOME is defined:

export XDG_CONFIG_HOME="$HOME/.config"

Here's a demo if you want to see the difference

I think we should make a script that automatically installs the "patch"/workaround so that more users can benefit from it.

Saghen commented 11 months ago

@alexis-belmonte An installer would be great! I might look at doing this sometime this weekend. Fyi you can launch steam with -noverifyfiles to skip the verification that results in the file being overwritten

Mar2ck commented 11 months ago

That solution works like a charm. Big picture is actually smooth and usable even at 3440x1440 without any graphical artifacts at all. The new desktop UI benefits from it too with smooth scrolling and no stuttering in the animations anymore. And best of all Steam isn't crashing my whole desktop environment anymore which is always a nice touch :D

The only issue I have is when using -forcedesktopscaling 1.25, the desktop UI is scaled slightly bigger then it's supposed to be after exiting Big Picture mode.

alexis-belmonte commented 11 months ago

@Mar2ck There are known issues in general with fractional scaling on almost all desktop environments (except for Gnome IIRC) -- that'd be great if you could tell us what you're using!

Mar2ck commented 11 months ago

I'm on KDE Plasma X11 so all of the scaling is being done on Steam's end, Plasma X11 doesn't have compositor-level scaling so I doubt it's that. Big Picture has it's own scaling slider which uses the same scaling mechanism as the Desktop so what I think is happening is that the scaling factor isn't being reset properly on exit like it is on Windows.

Edit: This actually ended up being an unrelated issue with steam's scaling handling where it accidentally uses two variables at once. Happens regardless of this unofficial fix.

alexis-belmonte commented 11 months ago

@Mar2ck Since I also use Plasma, I tried replicating your problem but couldn't seem to reproduce it -- in any case, you should open a separate issue for that matter -- there are chances that you're not alone with this problem :+1:

AlmaPlata commented 11 months ago

I'm on KDE Plasma X11 so all of the scaling is being done on Steam's end, Plasma X11 doesn't have compositor-level scaling so I doubt it's that. Big Picture has it's own scaling slider which uses the same scaling mechanism as the Desktop so what I think is happening is that the scaling factor isn't being reset properly on exit like it is on Windows.

Edit: This actually ended up being an unrelated issue with steam's scaling handling where it accidentally uses two variables at once. Happens regardless of this unofficial fix.

Yeah, I reported on this issue yesterday at #9565 after also confirming this fix makes BP usable on Nvidia cards. At first I also thought was related to the fix, but seems to be something introduced with Steams recent general redesign. We can discuss it more in depth at the other issue to not furtherly spam this one.

kisak-valve commented 11 months ago

Hello, per "Re-enabled HW acceleration by default for Nvidia GPUs." in the 2023-06-06 Steam client beta, please retest this issue.

alexis-belmonte commented 11 months ago

Steam is now translucent!... image

In other words, the official "fix" doesn't fix the problem... and even worsens the situation

Trying to apply the workaround again makes it EVEN WORSE, with only the steamwebhelper container showing... everything else has disappeared (or rather, because fully transparent) image

kisak-valve commented 11 months ago

Hello @alexis-belmonte, that issue is being tracked at #9422.

hidinginside commented 11 months ago

The latest client update fixed it by default for me! Thanks Valve!

dylanmtaylor commented 11 months ago

I am testing on Ubuntu 23.04. I'm using the latest graphics driver that they provide on a 3090. The frame rate is excellent in big picture mode now. It seems fairly stable too. Thanks, Valve! I am also experiencing the weird transparency issue, but that can be forgiven because this is totally usable now.

alexis-belmonte commented 11 months ago

I found a workaround for https://github.com/ValveSoftware/steam-for-linux/issues/8918#issuecomment-1580743947 -- see https://github.com/ValveSoftware/steam-for-linux/issues/9422#issuecomment-1580770411

Now it works again! :]

kantlivelong commented 11 months ago

June 6th beta looking good.

Mint 21.1 X/Cinnamon GTX 3090 530.41.03

DanMan commented 11 months ago

Getting some minor, intermediate, visual corruption on the "store, library, …" dropdown menu. Nothing critical thus far.

dtantono commented 11 months ago

The new Stable update comes today. But, the new big picture is really bad on nvidia. I hope we can go back to old big picture at the moment.

hidinginside commented 11 months ago

The new Stable update comes today. But, the new big picture is really bad on nvidia. I hope we can go back to old big picture at the moment.

@dtantono Just tested the new stable update. It works great on my Nvidia card. Seems, at least from my end, that they have already rolled out the fixes from the beta into stable.

dtantono commented 11 months ago

I try to connect to my Linux pc with Sunshine and moonlight on my phone and my Steam deck. But, this new big picture mode is really slow unlike the old one. Which tweaks you use?

Ibal-Dawabsheh commented 11 months ago

I try to connect to my Linux pc with Sunshine and moonlight on my phone and my Steam deck. But, this new big picture mode is really slow unlike the old one. Which tweaks you use?

I enabled GPU Accelerated Rendering in the interface settings and now it runs fine.

dtantono commented 11 months ago

if you mean these parameters. it is same. the old BPM is much smoother image

Nandru86 commented 10 months ago

That means its a regression and eventually will hit the stable as well if not fixed

El lun., 3 de julio de 2023 20:15, antekmeco @.***> escribió:

nevermind, i switched back from the beta to the stable release and it works now

— Reply to this email directly, view it on GitHub https://github.com/ValveSoftware/steam-for-linux/issues/8918#issuecomment-1619247239, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFP7B2LIEP75HL2WW5STJTLXONHC3ANCNFSM6AAAAAASCDUORM . You are receiving this because you were mentioned.Message ID: @.***>

lostgoat commented 10 months ago

@antekmeco that command line flag doesn't do anything anymore.

To enable or disable hardware acceleration you can use the toggle in settings.

intelligentgaming commented 10 months ago

Just to update the thread, switching to the Steam beta has now fixed the issue.

I can now use "Enable GPU accelerated rendering in web views" without Steam crashing on launch, and as a bonus, Big Picture mode is nice and smooth again at 1440p.

Nvidia RTX 3060ti Driver - 535.54.03 EndeavourOS

kisak-valve commented 8 months ago

Closing as fixed. Any follow up issues should be tracked separately.