Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sub-optimal scheduling configuration #3977

Open
4 tasks
Dietr1ch opened this issue Jan 20, 2025 · 0 comments
Open
4 tasks

Sub-optimal scheduling configuration #3977

Dietr1ch opened this issue Jan 20, 2025 · 0 comments
Labels

Comments

@Dietr1ch
Copy link

Dietr1ch commented Jan 20, 2025

I've found that there's scheduling issues, likely due to misconfiguration of priorities and real-time settings if available.

I've been using the fish script at the end to configure the cpu governor, adjust niceness, pin the game to fewer cores (better cache locality as the game can't use all cores anyway).

  • Set the lowest niceness possible
  • Pin the process to up-to 8 cores (or whatever makes the most sense, this might be empirical)
  • Mark process as real-time if running a RT kernel
  • Adjust the CPU governor to keep clocks high on the pinned CPUs

I'm probably missing other options (memory tweaks? I think mmaps use hugepages on modern kernels though), but these ones already make a significant difference on frame times, specially around lows since there's a huge variance without these.

I know that having something like gamemoderun as a wrapper can help configuring the system, but as long as it's not integrated with steam and some changes require sudo there'll be performance left on the table using it unless care is taken to ensure commands (maybe with specific arguments) don't require passwords when using sudo.


begin
    set -l game 'cs2'
    set -l cores '0-7'
    set -l process (pgrep $game)

    # Pinning
    sudo taskset \
          -cp $cores \
          $process
    # Priority
    sudo renice \
          -n '-19' \
          -p $process
    sudo chrt \
          --fifo \
          -p 99 \
          $process

    # CPU Governor
    sudo cpupower \
          --cpu $cores \
          frequency-set \
          --governor 'performance'
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants