No announcement yet.

Tweaking SteamOS For Better Steam Deck Performance

  • Filter
  • Time
  • Show
Clear All
new posts

  • Tweaking SteamOS For Better Steam Deck Performance

    Phoronix: Tweaking SteamOS For Better Steam Deck Performance

    A Phoronix reader recently published a guide that at its heart is a set of commands aimed at boosting the performance of SteamOS on the AMD APU powered Steam Deck. Here are some benchmarks showing the performance impact from these changes on the SteamOS 3.5 Preview release.

    Phoronix, Linux Hardware Reviews, Linux hardware benchmarks, Linux server benchmarks, Linux benchmarking, Desktop Linux, Linux performance, Open Source graphics, Linux How To, Ubuntu benchmarks, Ubuntu hardware, Phoronix Test Suite

  • #2
    Changing the governor to "performance" is going to have battery drain implications. "Performance" just locks the CPU to the highest frequency the hardware configuration allows without allowing it to scale down when the system load declines so the battery is going to drain faster. The benchmark results suggest the configuration change is a dubious performance improvement overall if the battery is actually draining faster as would be suggested by the governor documentation.


    • #3
      I love these articles where we see big tweak guides put to the test. I completely agree with stormcrow that the governor has multiple objectives in addition to performance, battery life and fan activity are among them.

      Kyber is an awesome choice. I've been doing that on all my Linux installs. I didn't see any notes on swap other than MGLRU nor anything on changing UMA buffer size, but perhaps, those default Steam Deck settings are optimal for its typical use cases (except MGLRU being off).
      Last edited by Mitch; 03 October 2023, 11:55 AM.


      • #4
        So, here's the magical script:

        cat << EOF | sudo tee /etc/systemd/system/cpu_performance.service
        Description=CPU performance governor
        ExecStart=/usr/bin/cpupower frequency-set -g performance
        sudo systemctl daemon-reload
        sudo systemctl enable cpu_performance.service
        cat << EOF | sudo tee /etc/tmpfiles.d/mglru.conf
        w /sys/kernel/mm/lru_gen/enabled - - - - 7
        w /sys/kernel/mm/lru_gen/min_ttl_ms - - - - 0
        cat << EOF | sudo tee /etc/security/limits.d/memlock.conf
        * hard memlock 2147484
        * soft memlock 2147484
        cat << EOF | sudo tee /etc/udev/rules.d/64-ioschedulers.rules
        ACTION=="add|change", KERNEL=="nvme[0-9]*", ATTR{queue/scheduler}="kyber"
        ACTION=="add|change", KERNEL=="sd[a-z]|mmcblk[0-9]*", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="kyber"
        sudo sed -i -e '/home/s/\bdefaults\b/&,noatime/' /etc/fstab
        sudo sed -i 's/\bGRUB_CMDLINE_LINUX_DEFAULT="\b/&mitigations=off nowatchdog nmi_watchdog=0 /' /etc/default/grub
        sudo grub-mkconfig -o /boot/efi/EFI/steamos/grub.cfg
        From what it seems the only three things that are likely to affect performance are:

        1. Running /usr/bin/cpupower frequency-set -g performance which forces the maximum performance governor for the CPU which may negatively affect both battery life and game performance (since the TDP budget is shared between CPU and GPU).

        2. Enabling these kernel options: mitigations=off nowatchdog nmi_watchdog=0

        Of which only mitigations=off is important. Zen 2 has seen quite heavy performance losses due to CPU vulnerabilities, so I wonder if that's the option which unlocks extra performance. It's innocuous as long as the only application that you run is Steam.

        3. Tuning Multi-Gen LRU which is applicable probably only for RAM constrained scenarios.

        Michael could probably just run PTS with mitigations=off and any of his Zen 2 systems and check performance benefits
        Last edited by avis; 03 October 2023, 05:10 AM. Reason: Spelling


        • #5
          Michael Larabel


          • #6
            Originally posted by avis View Post
            So, here's the magical script:

            3. Tuning Multi-Gen LRU which is applicable probably only for RAM constrained scenarios.
            I don't think that change would actually do anything at all, since on my Deck with SteamOS 3.5 (with no system level tweaks applied, I haven't even gotten root access on it yet and don't plan to) MGLRU is already enabled, and that min_ttl_ms value is also already set to 0, which is the upstream default anyway. And of course on SteamOS 3.4 it would still be pointless since MGLRU wouldn't be in that kernel version anyway.


            • #7
              I think benchmarking this would be interesting, as it will have the latest kernel and mesa from Fedora.

              Bazzite is an OCI image that serves as an alternative operating system for the Steam Deck, and a ready-to-game SteamOS-like for desktop computers, living room home theater PCs, and numerous other h...


              • #8
                I also interested to see if using amd-pstate driver will have any effect on battery life and performance. Now that SteamIS had updated to kernel version 6.1.52.


                • #9
                  Thanks for the benchmark. Could be a bit more verbose that mitigations are turned off. René Rebe found that turning mitigations turned off may cause illegal instructions on Zen 4.
                  Would be interesting to see how this performs compared to the tweaks done using cryo-utilities.


                  • #10
                    Seems the main advantages are to mitigate regressions from the 3.5 update, rather than push higher than seen previously. I think the integration of something like game mode to manage the CPU scheduler, rather than leaving it at performance.

                    Tangentially, I think a scheduler similar to conservative, but biased toward maximum speed instead of minimum, would be of great benefit for handhelds. Schedutil keeps showing that it is erratic, ondemand is slow in its frequency changes, and performance has a higher idle drain than others.