Skip to content

Instantly share code, notes, and snippets.

@CapacitorSet
Created July 2, 2023 10:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save CapacitorSet/29b34ba77e8f6662e79f5894d82aec47 to your computer and use it in GitHub Desktop.
Save CapacitorSet/29b34ba77e8f6662e79f5894d82aec47 to your computer and use it in GitHub Desktop.
Reduce the CPU usage of "Processing Vulkan shaders" in Steam

You can use cgroups to cap the CPU usage of processes. Thus, you can make the shader compilation process use less CPU and produce less heat, in exchange for longer compilation times.

Requires: Linux, a somewhat recent kernel, possibly a package for cgcreate.

sudo cgcreate -g cpu:/slow # Create a CPU cgroup
sudo cgclassify -g cpu:slow $(pidof fossilize_replay) # Move all shader compilation processes to the cgroup
sudo cgset -r cpu.max='2000000 1000000' slow # Cap the CPU usage (in this case: to 2 CPUs)

You may need to rerun the cgclassify from time to time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment