Skip to content

Dylan-B-D/steam-affinity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Steam Affinity

A lightweight Windows utility that automatically sets CPU affinity for games and processes launched by Steam. It automatically identifies and excludes the first physical core (Logical Processors 0 & 1 on HT/SMT systems). This generally improves raw CPU performance by around 2-5% by avoiding the core heavily used by the OS kernel, interrupts, and background tasks.

Features

  • Automatic Detection: Monitors processes launched by steam.exe.
  • Hardware-Aware Affinity: Automatically detects your CPU topology (Hyper-Threading/SMT) and disables only the first physical core (which handles OS interrupts and background tasks).
    • On HT/SMT systems: Disables Logical Processors 0 and 1.
    • On non-HT/SMT systems: Disables only Logical Processor 0.
  • System Tray Integration: Runs silently in the background with a system tray icon.
  • Log Viewer: Built-in log window to see which processes are being modified.
  • Startup Management: Option to automatically start when you log in.

Installation

Installer (Recommended)

Download and run the .msi installer from the releases page (or build it yourself). This will:

  • Install the application to Program Files.
  • Create a Start Menu shortcut.

Manual

You can also run the standalone executable:

cargo run --release

Building from Source

Prerequisites

Build Steps

  1. Build the executable

    cargo build --release
  2. Build the MSI installer

    # Ensure WiX v3 bin folder is in your PATH
    cargo wix

    or

    cargo wix --bin-path "C:\Program Files (x86)\WiX Toolset v3.14\bin" --nocapture

    The installer will be generated in target/wix/steam_affinity-x.y.z-x86_64.msi.

Usage

Once running, Steam Affinity sits in your system tray (gear icon).

Tray Menu Options:

  • Show Logs: Opens a window displaying recent actions and detected processes.
  • Monitoring: Toggle the automatic affinity adjustment on/off.
  • Start on Login: Toggle whether the app starts automatically with Windows.
  • Exit: Closes the application.

Configuration

The application supports command-line arguments for advanced usage:

steam_affinity.exe --verbose --interval-ms 3000
  • --verbose: Enable detailed logging to stdout (useful for debugging).
  • --interval-ms <MS>: Set the polling interval in milliseconds (default: 3000ms).

Technical Details

  • Uses CreateToolhelp32Snapshot to snapshot running processes.
  • Identifies steam.exe and monitors for new child processes.
  • Uses GetLogicalProcessorInformation to determine the mask for Physical Core 0.
  • Applies SetProcessAffinityMask to identified children, ensuring the first physical core is excluded while all other cores remain active.
  • Stores startup configuration in HKCU\Software\Microsoft\Windows\CurrentVersion\Run.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages