Skip to content

Steam performance issue: resources may not be fully utilized by games #335

@PierreBeucher

Description

@PierreBeucher

Issue summary: on hypethreaded systems (AWS g4dn instance and some GCP instance), Steam sets a CPU affinity causing games to run with a single or only half CPU available.

Example on AWS g4dn:

  • Steam sets CPU affinity to {0,2}
  • But instance CPU sibling pattern is actually {0,2} and {1,3} - meaning that logical CPU 0 and 2 on instance are actually on the same CPU Core.

Setting {0,2} CPU affinity in this context actually make the game run on a single CPU - using both hyperthread of the same CPU, and the other CPU completely unused.

It has huge (bad) impact on performance.

Possible workarounds

Custom launch option

set custom Steam game launch options such as

taskset -c 0-$(($(nproc --all)-1)) %command%

It will run command like taskset -c 0-3 /.../GAME.exe which will effectively run the game on all available CPU.

Disable OS level hyperthreading (less efficient but still better)

Disable instance SMT control with:

echo off | sudo tee /sys/devices/system/cpu/smt/control

Example impact

Example performance change on Clair Obscur Expedition 33 at medium graphics on AWS g4dn.xlarge instance:

  • Hyperthreading enabled (no fix):10 FPS
  • Hyperthreading disabled at OS level: 20 FPS (using echo off | sudo tee /sys/devices/system/cpu/smt/control)
  • Forcing all 4 vCPU with taskset -c 0-$(($(nproc --all)-1)) %command% in launch options: 40 FPS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions