So I got the Steam Deck recently to reward myself for a great 2023, and wanted to document my journey customizing and optimizing the Steam Deck.
Why?
While there have been new competitors such as the ROG Ally and the Legion Go that have been introduced to the market, the Steam Deck has been a much more popular choice due to it’s first class support for Steam Games, and lack of jankiness that comes coupled with Windows.
Another reason why the OLED refresh has been much more popular is the battery life and general community support for it compared to it’s alternatives. I think this is also why I chose it despite the alternatives being significantly cheaper here in Singapore.
However, a big complaint was that the Steam Deck ships with a really outdated Zen 2 custom SoC, compared to the Z1 on the other machines, which provide much better performance. While this is true that OOTB, the Steam Deck is significantly poorer in performance, this does not have to be the case. The Steam Deck ships with quite sane defaults, but if you know what you are doing as an enthusiast, you can significantly boost performance, and more importantly, battery life.
Here are some of my overarching thoughts:
On the Operating System
- I think the SteamOS works really great as an immutable OS, but having NixOS on top of it would be far superior. Something like Jovian’s NixOS might actually do the trick, if you’re okay with not having first-class support.
- I really like the alternative option of using SteamOS as the base, and using the Nix package manager on top to manage any other software and tools in our ecosystem. Sure, we might not be able to do stuff like kernel tweaking with Nix, but I think it’s a fair tradeoff since the Valve team has done an amazing job supporting the Steam Deck thus far.
- Emudeck seems like a really mature stack that I would love to incorporate into my deck.
On Optimizations:
- A.B.T does a really good job showing some pretty amazing performance optimizations you can do with the current Steam Deck. In particular, how disabling CPU mitigations for retbleed can significantly boost performance and efficiency. While this leaves our Steam Deck vulnerable, I think it’s unlikely anyone wants to use such a highly complex side channel attack on a Steam Deck.
- Cryo’s Steam Deck Utilities can be used to improve 1% low performance on games.
- Applying a conservative undervolt of about 10mv might also help with battery life
Benchmarks
- The initial plan was to use YABS to test CPU, memory, disk and networking performance. Sadly, I wasn’t able to get the script properly running in time.
- Luckily for us, we already have some performance numbers here
Tweaks
ABT’s SteamOS Optimizations
cat << EOF | sudo tee /etc/systemd/system/cpu_performance.service
[Unit]
Description=CPU performance governor
[Service]
Type=oneshot
ExecStart=/usr/bin/cpupower frequency-set -g performance
[Install]
WantedBy=multi-user.target
EOF
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
EOF
cat << EOF | sudo tee /etc/security/limits.d/memlock.conf
* hard memlock 2147484
* soft memlock 2147484
EOF
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"
EOF
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
ABT’s Steam Deck mods
And to uninstall:
sudo systemctl disable cpu_performance.service
sudo rm /etc/tmpfiles.d/mglru.conf
sudo rm /etc/security/limits.d/memlock.conf
sudo rm /etc/udev/rules.d/64-ioschedulers.rules
sudo sed -i -e 's/,noatime//' /etc/fstab
sudo sed -i -e 's/mitigations=off nowatchdog nmi_watchdog=0 //' /etc/default/grub
sudo grub-mkconfig -o /boot/efi/EFI/steamos/grub.cfg
Uninstall ABT’s Mods
Cryo’s Steam Deck Utilities
This is another one click install via the .desktop
link to modify to swap space of the deck.
Undervolting
This is another really simple modification since this has been now built into the BIOS. We simply hold down the volume up button with the power to boot into BIOS. I’ve applied a 20mv undervolt to everything, as I feel like that is the sweet spot for me. Performance may vary though.
Customization
Next, I wanted to install software and support that isn’t on the default SteamOS. In particular, Emudeck and Nix are both must-haves in my opinion to set up an optimal Steam Deck experience.
Emudeck Installation
Emudeck installation is another simple point and click adventure: simply download the .desktop file and let it do its thing. We’ll need to then install the firmware and keys, which is a simple google search away.
Results
With the already improved battery life from the OLED model, coupled with optimizations and undervolting, I could easily get 4-6 hours depending on the Deck, with a 10w TDP limit with almost no stuttering, which is absolutely insane to me.
This machine will probably be a must keep for any linux gamer.