Repository navigation
Description
Your system information
- System information from steam (
Steam->Help->System Information) in a gist: https://gist.github.com/rattones/00a9af339e66ada2baa189ee936ac0db - Have you checked for system updates?: Yes
- Are you using the latest stable video driver available for your system? No — 595.91.07. The newer 610.57.04 caused other problems on this machine; this freeze reproduced on both
- Have you verified the game files?: Yes
Summary of the relevant parts:
| Game | Dota 2 native Linux, Vulkan (default), ClientVersion=6941, SourceRevision=11041083 (Sep 25 2026), Steam Linux Runtime 3.0 (sniper) |
| OS | Ubuntu 26.04.1 LTS, kernel 7.0.0-34-generic, X11 + Cinnamon 6.4.13 |
| CPU | AMD Ryzen 7 5800H (8C/16T) |
| GPU | NVIDIA GeForce RTX 3050 Laptop 4 GB, driver 595.91.07 (open kernel module), MUX in discrete mode |
| RAM | 16 GB |
| Launch options | gamemoderun %command% -novid -map dota |
Please describe your issue in as much detail as possible:
Expected: smooth rendering during a match.
What happens: the game freezes completely (no new frames) for about 3 seconds, then resumes on its own. This repeats roughly once or twice per minute, both while playing and while spectating live games. There are no errors in the kernel log and no NVIDIA Xid messages.
What the profiling shows: during every one of these freezes, one GlobPool/N worker thread spins at 100% of one core in ThreadSpin (libtier0.so), called from libanimationsystem.so. At the same time the main thread (dota2) sleeps on a futex. When the main thread wakes up, the first code it runs is in libanimationsystem.so. The spin ends right after that and rendering resumes. It looks like the worker waits for animation work that only the main thread can complete, while the main thread waits for the worker. The deadlock seems to be broken by a timed wait of about 3 s.
1. Freeze frequency and duration (4 sessions, same day)
Freeze = GPU utilization at 0% for 1 s or more in the middle of a match (the GPU sits at 50–80% otherwise).
| Session | Length | Freezes of 1 s or more | Median duration | Lasting 2.9–3.6 s |
|---|---|---|---|---|
| playing | 48 min | 26 | 3.0 s | 13 |
| playing | 38 min | 32 | 3.0 s | 23 |
| playing | 6 min | 13 (8 in-game with the signature below) | — | 2.0–3.0 s each |
| spectating | 6 min | spin signature captured with perf (below) |
— | — |
The near-constant 3.0 s duration (3.001–3.007 s at 500 ms sampling) points to a timeout, not to load.
2. What the machine is doing during a freeze
Everything except one thread goes idle. Sampled every 500 ms:
GPU: utilization drops to 0 and power decays, VRAM steady (3.1 of 4 GB)
timestamp gpu_util% vram_used_MiB power_W
2026-09-29T14:10:23.426 76 3159 74.65
2026-09-29T14:10:23.926 0 3159 61.31
2026-09-29T14:10:24.426 0 3159 37.83
2026-09-29T14:10:24.926 0 3159 23.16
2026-09-29T14:10:25.426 0 3159 23.03
2026-09-29T14:10:25.927 0 3159 19.61
2026-09-29T14:10:26.427 0 3159 15.94
2026-09-29T14:10:26.927 72 3156 26.39
CPU: the process drops from ~390% to exactly one core; whole system at ~7%, no CPU pressure
timestamp cpu_total% busiest_core% busiest_core psi_cpu% dota_cpu% dota_running_threads
2026-09-29T14:10:23.334 26.2 49.0 6 0.5 392.0 2
2026-09-29T14:10:23.844 12.3 92.2 0 0.3 160.8 1
2026-09-29T14:10:24.334 7.4 100.0 0 0.0 102.0 1
2026-09-29T14:10:24.834 7.8 100.0 0 0.1 102.0 1
2026-09-29T14:10:25.334 7.4 100.0 0 0.0 102.0 1
2026-09-29T14:10:25.834 7.8 100.0 0 0.0 104.0 1
2026-09-29T14:10:26.334 7.9 100.0 0 0.0 102.0 1
2026-09-29T14:10:26.834 23.1 50.0 0 0.7 340.0 7
Threads (from /proc): one GlobPool worker running, the main thread sleeping on a futex
timestamp tid thread state cpu% wchan
2026-09-29T14:10:24.334 82985 dota2 S 0.0 futex_do_wait
2026-09-29T14:10:24.334 82992 GlobPool/2 R 100.0 0
This pattern shows up in all 8 in-game freezes of that session. The spinning worker varies (GlobPool/0, /1, /2, /3, /6). It always runs about 98% in user space, on core 0, with affinity 0-15. In the same freezes there is no I/O wait, no memory pressure (PSI ~0), no major page faults and no D-state threads.
3. Where the worker spins (perf record, 49 Hz, call graphs)
52 of the 58 samples of the spinning worker in one freeze have this exact stack:
ThreadSpin libtier0.so
[unknown] libanimationsystem.so
[unknown] libclient.so (x6 frames)
[unknown] libscenesystem.so (x3)
[unknown] libtier0.so
[unknown] libscenesystem.so (x2)
[unknown] libtier0.so (x2)
CThread::ThreadProc(void*) libtier0.so
libc.so.6 (thread start)
The NVIDIA driver (libnvidia-glcore) accounts for under 2% of the samples inside the freeze windows. The time is spent in the game's own code.
Timeline: the worker spins and the main thread is absent until it wakes up inside libanimationsystem
14:34:56.710 GlobPool/1 ThreadSpin (libtier0) < libanimationsystem < libclient
14:34:56.734 GlobPool/1 ThreadSpin (libtier0) < libanimationsystem < libclient
... every sample for 0.7 s: GlobPool/1 in the same stack, no samples from dota2 (sleeping) ...
14:34:57.367 GlobPool/1 ThreadSpin (libtier0) < libanimationsystem < libclient
14:34:57.432 dota2 libanimationsystem < libanimationsystem < libanimationsystem <- main thread wakes up here
14:34:57.516 dota2 Plat_GetWindowContentsScale (libtier0) < libengine2
14:34:57.683 GlobPool/2 ... < libnvidia-glcore <- rendering resumes
14:34:57.726 dota2 libnvidia-glcore ...
The same happens in the freeze at 14:34:04, this time with GlobPool/2.
4. Already ruled out
-
VRAM: peak 2.8 of 4 GB, with at least 1.2 GB free throughout.
-
Disk: no reads or writes around the freezes.
-
Network: stable during the freezes.
-
Swap: at most 0.26 GB in use during these sessions.
-
NVIDIA driver version: the same symptom on 595.91.07 and 610.57.04. No Xid errors in 12 boots.
-
CPU frequency and power profile: the symptom persists with the GameMode
performancegovernor, the ACPIperformanceprofile and PowerMizer at maximum performance. -
Xorg: the freezes do not line up with RandR output probes. Xorg and the desktop are idle during them.
-
Steam game recording: disabled for Dota 2.
-
Steam Runtime Diagnostics: the runtime's own
x11/vulkancheck reportscannot-load, timeout, cannot-drawin every container (scout, soldier, sniper), although the game renders fine with Vulkan. It may be unrelated, but it is included in the gist.
Possibly the same symptom as #1366 (freezes of about 3 s during teamfights on Linux), which never got a root cause.
Steps for reproducing this issue:
- Launch Dota 2 on Linux (native, Vulkan) on the machine described above.
- Play a match or spectate a live game for a few minutes.
- Every minute or two the game freezes for about 3 s and then recovers. At that moment,
top -H -p $(pidof dota2)shows a singleGlobPool/Nthread at 100% while every other thread sleeps.
The data above was collected with monitor, a Linux GPU/CPU/thread sampler written while chasing this bug. To collect the same evidence:
sudo sysctl kernel.perf_event_paranoid=1 # to allow perf without root
monitor all -f pid:$(pidof dota2) -P -o dota.csv
# after a freeze, where the threads spent the time in that window:
tools/perf-window.sh dota 14:34:56 14:34:58 GlobPoolI can provide the full CSVs and the perf.data file (1.4 MB) on request.
Activity
rattones commentedon Sep 30, 2026
Update: same freeze on a completely different driver stack (nouveau + NVK)
To rule out the NVIDIA proprietary driver, I switched this machine to the free stack and played again. The freeze is still there, with the same signature.
nouveau(GSP firmware), Linux 7.0.0-34deviceName = NVIDIA GeForce RTX 3050 Laptop GPU (NVK GA107))SourceRevision=11041083)nouveau exposes no GPU utilization, so I detected the freezes from the thread data instead, using the same signature as in the original report:
GlobPool/Nthread is running (R) at ≥90% of a core;dota2sleeps infutex_do_wait.13 freezes matched in 77 minutes, lasting 1.5–3.5 s (four of them ~3.0 s). The spinning worker varied (
GlobPool/0through/6), but it ran on core 0 every time and ~100% of its CPU was user time, just as on the proprietary driver.One of them, sampled every 500 ms (23:03:43)
Rate of these freezes, measured with the same detector in both setups:
The rate is lower on NVK, but I don't read that as the driver helping. The game used much less CPU in this session, most likely because the frame rate is lower on NVK. Fewer frames means fewer animation jobs, and so fewer chances to hit the deadlock.
I couldn't record
perfin this session, so I don't have thelibanimationsystem→ThreadSpinstack on NVK. Everything visible from/procmatches the stack captured on the proprietary driver: the worker spins in user space while the main thread waits on it.Since the freeze shows up with the NVIDIA driver and with Mesa/NVK alike, this points to the job system or the animation code in the client rather than to the graphics driver.
Collected with monitor (
monitor all -f pid:$(pidof dota2)). I can share the full CSVs if useful.— @rattones
rattones commentedon Sep 30, 2026
Update:
-disable_affinity_preferencesdoesn't help, and the spin also happens on the main threadNew session today, back on the proprietary driver, with the launch option usually suggested for thread-scheduling stutter on Linux:
gamemoderun %command% -novid -map dota -disable_affinity_preferencesThe option makes no difference. Excluding the initial load, the GPU sat at 0% for ≥1 s mid-match 70 times in 53 minutes. In 65 of those, a single thread of the game spins at ~100% of one core in user space, always on core 0, while every other thread is idle. Most last 3.0 s. That is ~74 per hour, the same rate as the ~80/h I measured without the option.
New: three variants of the same spin
Splitting those 70 freezes by what the main thread (
dota2) is doing at the time:GlobPool/Nworkerfutex_do_waitGlobPool/Nworkerep_pollfutex_do_waitVariant A is the one in the original report. The last row may simply be spins shorter than the 500 ms sampling window can show.
Variant B, 08:16:51: the worker spins while the main thread sits in epoll
GPU utilization, from the GPU CSV sampled at slightly different instants: 78% at 08:16:50.8, 0% from 08:16:51.3 through 08:16:53.8, 65% at 08:16:54.3.
Variant C, 08:21:40: the main thread spins and every worker is idle
No
GlobPoolworker is above 1% during this window. The same pattern shows at 08:05:47, 08:27:22 and 08:39:09.This changes what I suggested in my previous comment
In the fix suggestion I described a dependency cycle broken by a timed wait on the main thread. Variants B and C don't fit that:
epoll), and the worker still spins for ~3 s.A better fit for all three variants is a spin-wait with a built-in timeout of ~3 s on a condition that, in these cases, nothing ever satisfies. The spin runs on whichever thread executes that code path: a pool worker in A and B, and the main thread in C, probably when it runs the job inline. It ends when the timeout expires, not when the condition becomes true. That explains why the duration is almost always 3.0 s, why the machine is idle meanwhile, and why the main thread can be doing something else entirely.
So the most useful places to look are:
libanimationsystempath underThreadSpin(see the stack in the original report). Something that should set or signal it is missing, happens out of order, or targets the wrong object. This looks like a lost wake-up rather than contention.perfwas not available in this session, so theThreadSpin ← libanimationsystemstack is confirmed only for variant A, in the earlier session. Everything visible from/procfor B and C is the same: one thread, ~100% user time, core 0, ~3 s.Attached:
dota2-linux-freeze-3558-2026-09-30.zip(1.2 MB), with the raw CSVs for this session. TheREADME.txtinside lists example timestamps for each variant.— @rattones
dota2-linux-freeze-3558-2026-09-30.zip
rattones commentedon Sep 30, 2026
Update: driver 610.57.04 + MangoHud frame times: the freeze is capped at ~3.24 s
Another session, this time on the newest NVIDIA driver and with MangoHud logging every frame, so the freeze length now comes from the game's own frame times instead of the 500 ms sampling.
gamemoderun mangohud %command% -novid -map dota -disable_affinity_preferencesThe driver update changes nothing
The monitor saw 43 freezes mid-match, ~76 per hour. That is the same rate as on 595.91.07, with or without
-disable_affinity_preferences. The same three variants show up, always with the spinning thread on core 0 at ~100% user time:GlobPool/Nfutex_do_waitGlobPool/Nep_pollNew: the longest frame is always ~3.24 s
MangoHud logged 53 frames of 500 ms or more in 34 minutes. The long ones line up with the freezes seen by the monitor (examples below). Their lengths:
Of the 11 frames of 3 s or more, 10 fall between 3240.0 and 3249.0 ms: 3240.0, 3241.5, 3241.6, 3242.8, 3243.7, 3244.0, 3244.1, 3246.3, 3248.9 and 3249.0 ms. The eleventh is 3114.5 ms. No frame in the session is longer than 3249 ms.
A 9 ms spread on a 3.2 s freeze is not load: it is a hard limit. It fits the earlier observation that most freezes last "3.0 s" at 500 ms sampling, and it sharpens the picture:
This points to the timeout inside the
libanimationsystemwait path (ThreadSpin, see the stack in the original report). Whatever fires at ~3.2 s is the single best place to put a log line. It would name the condition that was never satisfied, and the shorter freezes would show how long it usually takes when it is satisfied.Examples: monitor freeze start → MangoHud frame time
For completeness: swap grew from 0.2 to 2.8 GB during this session, since other applications were open. The freezes above are the same thread signature as in sessions with no swap at all (VRAM peaked at 3231 of 4096 MiB), so I don't think memory plays a part here.
Attached:
dota2-linux-freeze-3558-2026-09-30-610.zip(3.9 MB): the monitor CSVs and the MangoHud per-frame log for this session, with aREADME.txt.— @rattones
dota2-linux-freeze-3558-2026-09-30-610.zip
rattones commentedon Sep 30, 2026
Analysis and suggested fix
This consolidates everything measured in this issue into one explanation and a set of suggested fixes. I don't have the source: the function names come from stripped binaries, and the mechanism is inferred from
/procthread states (500 ms),perfcall graphs (49 Hz) and MangoHud per-frame logs. The raw data is in the zips attached to the comments linked below.What was measured
ThreadSpin(libtier0), called fromlibanimationsystem←libclient←libscenesystem←CThread::ThreadProc(52 of 58 samples of the spinning thread)GlobPool/Nworker spins, main thread infutex_do_wait. B: a worker spins, main thread inep_poll(its event loop). C: the main thread itself spins and the workers are idlelibanimationsystem, and the spin ends right afteramd_pstate_prefcore_rankingon this Ryzen 7 5800H, so this is most likely just the scheduler's choice, not a cause-disable_affinity_preferences. Also present on nouveau + NVK (Mesa 26.0.8), at a lower rate with lower CPU loadMechanism
A spin-wait in the
libanimationsystempath waits for a condition that is set late or never, and gives up after a built-in timeout of about 3.2 s:Why it isn't a plain deadlock between the main thread and a job: in B the main thread is not waiting on the job at all, and in C nothing but the spinning thread is running. The timeout therefore sits in the spin path itself, not in whatever the main thread is doing.
What it looks like: a missing or misordered signal, not lock contention. Candidates are a lost wake-up, a flag set on the wrong object or generation, or a producer that ends up scheduled behind its own consumer.
Suggested fixes, in order of priority
1. Find the condition and why it is set late or never (the actual bug). Two handles point at it:
ThreadSpininlibanimationsystem(the stack above);Logging where the timeout fires (which job, which object, how long it waited), plus a histogram of wait times, would identify it directly. It would also show how often players actually hit it.
2. Make the producer impossible to starve. If the condition is produced by work queued behind the waiter, in the same pool or on the main thread, make the dependency explicit: schedule the waiter as a continuation of the producer, or pass the data into the job instead of having the job wait for it. Having the waiting thread "help" by running pending jobs is not enough on its own. If it picks up the waiting job instead of the producer, it spins itself, which is exactly variant C. Helping only works if it runs the producer.
3. Never spin unbounded (defensive). Spin briefly, then yield, then block on something the producer signals:
This frees the core and makes the wait visible in profilers. It does not remove the freeze when the signal never comes: the thread would sleep instead of spin, and the frame would still wait until the timeout. Only fix 1 removes the freeze itself.
4. Shorten the timeout's fallback, as a stopgap. A frame blocked for 3.2 s is what players see. If the work can be recovered, for example by redoing it inline or skipping that animation update for one frame, a timeout of a few frames would turn the 3 s freeze into a short hitch until the root cause is fixed.
How to verify a fix
With the same data collection (
monitor all -f pid:$(pidof dota2) -Pfrom monitor, plus MangoHud withlog_interval=0), a fixed build should show, over a ~30-minute match:Rat ~100% user time on a single core while the GPU is at 0% and every other thread is idle;ThreadSpin ← libanimationsystemstacks inperfinside freeze windows (tools/perf-window.sh).I'm happy to test a beta or debug build and report back with the same measurements.
— @rattones
rattones commentedon Sep 30, 2026
Closing remarks
To sum up what this issue has established:
ThreadSpin, called fromlibanimationsystem, waiting for a condition that arrives late or never, until a built-in timeout of ~3.2 s gives up. The whole machine is idle meanwhile.-disable_affinity_preferences), not VRAM, not memory pressure, not disk, not network. Each of these was measured and ruled out.ThreadSpin ← libanimationsystemstack.If you're seeing this too
More data from other machines would help tell what is universal and what is specific to mine. Everything here is one laptop: a Ryzen 7 5800H with an RTX 3050. It would be especially useful to know whether it happens on Intel CPUs, AMD GPUs, Wayland, Windows, or with different core counts. If you have freezes of about 3 s in Dota 2, a comment with any of the following would be valuable:
log_interval=0, then start and stop logging with Shift+F2), and report how many frames were ≥ 3 s and how long they were. If they cluster around ~3240 ms, it is this bug.top -H -p $(pidof dota2). You should see a single thread (GlobPool/Nordota2) at ~100% while everything else sits near 0.-P,perfcall graphs in one go:Thank you to everyone who reads this and takes a moment to add data. A single MangoHud log from different hardware can say more than another hour of logs from mine.
Thank you, Valve
Thank you, Valve, for keeping a native Linux client and an open tracker where players can report what they measure, and for believing that the community can help build something as good as Dota 2. This investigation was done in that spirit: to hand over as much evidence as possible so the fix is easier to find, not to complain. I'm happy to test a beta or debug build and report back with the same measurements.
— @rattones
rattones commentedon Oct 5, 2026
rattones commentedon Oct 5, 2026
Root cause found: CPU 0's TSC runs seconds behind the other cores, and the spin times itself with it. Closing.
The ~3 s freezes in this issue come from a firmware defect on this laptop: CPU 0's time-stamp counter (TSC) runs a few seconds behind every other core. The spin-wait in
ThreadSpinmeasures its elapsed time with the TSC. When a spinning thread lands on core 0, the counter jumps back by that many seconds, and the thread spins until core 0 catches up. The "hard cap" I reported isn't a timeout in the game: it is that boot's TSC gap, which the kernel measures and logs on every boot.It became frequent after an OS upgrade because, since kernel 6.9, amd-pstate's preferred-core ranking makes the scheduler favor core 0 on this CPU. Booting with
amd_prefcore=disablemade the freezes disappear: 0 frames ≥ 1 s in a 30-minute session, against about 41 per hour before.This also replaces some of my earlier conclusions. The corrections are listed at the end.
1. The kernel reports the gap on every boot
This happens on all 89 boots since this OS was installed (2026-09-08), across two kernel versions. The gap changes on every boot, from 2.0 to 20.7 s. This CPU (Ryzen 7 5800H) has no
TSC_ADJUST, so the kernel can't correct the gap. It can only stop using the TSC as its own clock and fall back to HPET. User-space code that executesRDTSCdirectly still reads the out-of-sync counters.2. Only core 0 is off
Measured against the kernel's global clock (HPET), with
tools/tsc-per-cpu.cfrom the attachment:CPUs 1–15 agree with each other to well under a millisecond, and CPU 0 is behind by exactly the gap the kernel logged for that boot (9 741 044 935 cycles at 3193.966 MHz = 3.050 s). This is why the spinning thread was on core 0 in practically every freeze. I earlier put that down to the scheduler's preferred-core ranking, and that was wrong.
3. The freeze cap matches that boot's TSC gap
Each MangoHud session next to the gap the kernel measured at that session's boot:
In every session, the longest frames are the boot's TSC gap plus 5–30 ms, i.e. the gap plus the rest of the frame's work. Same boot, same cap. New boot, new cap. The shorter frames (0.5–3 s) are spins where the thread moved off core 0 before core 0 caught up.
4. The main thread never sets a timeout
To see what the main thread waits for during a freeze, I wrote a bpftrace probe (
freeze-probe, listed in the tools below) that records every main-threadfutex/epoll_waitlonger than 500 ms:epoll_waitcalled fromThreadMultiWait(libtier0, fromSource2Maininlibengine2). It waits on two eventfds, with timeout −1, and returns when one of them fires.FUTEX_WAIT(private) with no timeout, always on the same address inlibtier0's data. In all three cases aGlobPoolthread issuedFUTEX_WAKEon that exact address when the freeze ended.ThreadSpin+28(libtier0), on core 0.So the cap was never in the main thread. The main thread waits, without a timeout, for a job whose spin is timed with the TSC.
The mechanism
This is inferred from stripped binaries, but it is the only explanation consistent with all of the above:
start = RDTSCon core k, whose counter is ahead.now − startis now about −W, so the spin continues until core 0's counter passesstart + limit. That takes W plus the normal spin.ThreadMultiWait/ a futex, so the entire frame stops for W seconds. If the thread moves off core 0 earlier, the spin, and the freeze, end early.This is why nothing else mattered. The NVIDIA 595 and 610 drivers (open and proprietary kernel modules), Mesa/NVK,
-disable_affinity_preferences, VRAM, memory, disk and network all freeze the same way. The input lag reported during freezes (keys and clicks not reaching the game) follows directly, because the main thread is the one that reads input.Where the gap comes from: the firmware
tools/tsc-vs-boottime.ccompares each core's absolute TSC with the kernel's boot clock:CPU 0's counter starts with the firmware, and the other cores start counting several seconds earlier, during POST. Across 89 boots the gap follows systemd's firmware time, not the bootloader time:
This all happens before Linux starts. The BIOS is already the latest available (HHCN37WW). Unsynchronized TSCs from firmware on AMD Ryzen laptops are a known problem in the kernel tracker (216161, 202525, 215037).
Why it started with the OS upgrade: amd-pstate preferred cores
The game ran fine on this same laptop, with the same BIOS, until I reinstalled with a newer Ubuntu (24.04 LTS with kernel 6.8 → 26.04 with kernel 7.0). The TSC defect was almost certainly there before too. What changed is how often the game's threads end up on core 0.
Since kernel 6.9, amd-pstate's preferred core support ranks the cores, and the scheduler packs work onto the highest-ranked ones. On this CPU the ranking (
amd_pstate_prefcore_ranking) puts core 0 at the top: cpu0/1 and cpu6/7 at 196, the rest from 191 down to 166. In other words, the kernel prefers exactly the core whose TSC is wrong. Kernel 6.8 didn't have this.I booted the same kernel with
amd_prefcore=disable, which turns the ranking off and changes nothing else:amd_prefcore=disableAt the old rate, 30 minutes would have given about 20 frames of 1 s or more. There were none. Note that the share of busy game-thread samples on cpu0 only fell from 7.7% to 4.6% (
data/cpu-placement-prefcore.txt), so time spent on core 0 is not the whole story. A freeze needs a thread to move onto core 0 in the middle of a spin. My reading is that preferred-core packing does exactly that, actively migrating running threads to the top-ranked idle CPU. Without the ranking, those mid-spin moves practically stop.Suggestion for Valve
The defect is in the platform, so I'm closing this issue. Still, Dota 2 could tolerate it cheaply, and every machine with this kind of firmware would stop freezing:
clock_gettime(CLOCK_MONOTONIC)(vDSO) instead of rawRDTSC. Or, ifRDTSCstays, useRDTSCPand restart the timer wheneverTSC_AUX(the CPU number) changes betweenstartandnow./sys/devices/system/clocksource/clocksource0/current_clocksourceisn'ttsc, the kernel has found the TSC unreliable on this machine.If you have the same freezes
journalctl -k -b | grep "TSC warp". If it prints a line, convert the cycles to seconds (divide by the MHz intsc: Detected … MHz, times 10⁶) and compare with your longest freezes in MangoHud. If they match, it's this.cat /sys/devices/system/cpu/amd_pstate/prefcoreandgrep . /sys/devices/system/cpu/cpu*/cpufreq/amd_pstate_prefcore_ranking. If prefcore is enabled and the out-of-sync core is ranked at the top, that is the combination described above.amd_prefcore=disable. To make it permanent, add it toGRUB_CMDLINE_LINUX_DEFAULT(e.g. in a file under/etc/default/grub.d/) and runupdate-grub. All cores stay in use. You only lose the scheduler's preference for the fastest-boosting cores.tasksetdoesn't help, because the game resets its own affinity. A cpuset does hold, for examplesudo systemctl set-property --runtime user.slice AllowedCPUs=1-15(lasts until reboot). This costs one logical CPU.Corrections to my earlier comments
Tools used in this investigation
monitor all -f pid:…)syscollectorwchan, user/system time, last CPU and affinity. It found the single spinning thread on core 0, the A/B/C variants, and thattasksetwas ignored-P+tools/perf-window.shperf recordcall graphs, sliced per freeze window. They foundThreadSpin←libanimationsystemin the original reportfreeze-probe(probe/in the monitor repository)ThreadMultiWait/eventfd waits, theFUTEX_WAKEon the same address, 99 Hz samples of the spinning threadtsc-per-cpu.c,tsc-vs-boottime.c,warp-per-boot.sh(attached)Attached:
dota2-linux-freeze-3558-2026-10-05-root-cause.zip: the three TSC tools, the gap and firmware time for all 89 boots, the freeze-cap vs gap table, today's per-core measurements and the bpftrace probe log, with aREADME.txt.Thank you, Valve, for the native Linux client and for keeping this tracker open. This turned out not to be a bug in your code, but a small change in how the spin measures time would spare everyone with this firmware these freezes.
— @rattones
dota2-linux-freeze-3558-2026-10-05-root-cause.zip
rattones commentedon Oct 5, 2026
The tools behind this investigation, and what each one contributed
This issue went through several wrong hypotheses before reaching the TSC answer. Each step needed a measurement the previous tools couldn't take, so new tools were written along the way. This post lists them in the order they came in, what each measures, and what it ruled in or out. The general-purpose ones are in rattones/monitor (bash only, no Python). The TSC utilities are in the zip attached to the closing comment.
1.
monitor: GPU, VRAM and disk (repository)monitor all -f pid:$(pidof dota2)Samples every 500 ms into CSVs: GPU utilization, clocks, temperature and power, VRAM total and per process, and disk throughput and IOPS.
2. GameMode hook (local script, not published)
gamemode-start.sh/gamemode-end.shplusgamemode-monitor.sh, run by GameMode on every launch. The hook attachesmonitorto the game's PID, withperfadded when it is enabled, and stops it when the game exits. It also sets the power profile and pauses a background network speed test during play.3.
monitorsyscollector: CPU, memory and every threadAdds two CSVs.
-sys.csvhas total and per-core CPU, memory, swap, PSI (CPU, memory, I/O pressure), and the game's CPU, thread count, D-state threads and major faults.-threads.csvhas every active game thread: state,wchan, CPU %, user/system split, last CPU and affinity.GlobPool/N, sometimes the main thread orVKRenderThread) ran at 100% user time on core 0, while the main thread slept infutex_do_waitorep_poll, every other thread was idle, and the system sat at ~7% CPU with no pressure. That ruled out CPU contention, memory pressure and swap, and gave the A/B/C variants.last_cpuandaffinitycolumns later showed thattasksetand-disable_affinity_preferenceswere ignored (affinity stayed 0-15), and that the spinner was always on core 0.4.
monitor -P+tools/perf-window.sh: where the thread spins-Prunsperf record -gon the game's PIDs alongside the CSVs.tools/perf-window.sh <log> HH:MM:SS HH:MM:SS [thread]cuts the samples to a freeze window and breaks them down per thread, per library, and by the first frame outside the kernel.CThread::ThreadProc → libscenesystem → libclient → libanimationsystem → ThreadSpin (libtier0), with no driver library in the stack. That moved the investigation from "driver/system" to "the game's own waiting code".5.
monitornouveau backend: an independent graphics stackReads VRAM through
vulkaninfo(VK_EXT_memory_budget) when the machine runs nouveau + NVK, wherenvidia-smidoesn't exist.6. MangoHud per-frame logs (MangoHud)
A per-frame frametime log (
log_interval=0), analyzed with smallawkscripts: counts per hour, percentiles, and the list of frames ≥ 0.5 s with timestamps.7.
freeze-probe: what the main thread waits for (probe/)A bpftrace program and a bash launcher, run under sudo and separate from the monitor. For every main-thread wait longer than a threshold it records:
the timeout the thread asked the kernel for, and the return value;
the user stack at the moment it went to sleep;
a
FUTEX_WAKEon the same address from another game thread;the epoll event that fired, mapped to its file descriptor through
fdinfo;99 Hz stack samples of every game thread while the main thread is stopped.
Role: the main thread never sets a timeout (
epoll_wait−1 inThreadMultiWait,FUTEX_WAITwithout timeout). So the cap was not the main thread's: it had to be in how the spinner measures time. The spinner sat atThreadSpin+28on core 0 in 397 of 430 samples.Note: the first version kept its state in scalar bpftrace maps that other CPUs read stale, which produced false wake-ups and weighed on the game. Version 2 keys all state explicitly and resolves
[unknown]frames intolibrary+offsetfrom a snapshot of/proc/PID/maps.8. The TSC utilities: the answer (attached to the closing comment)
warp-per-boot.shtsc-per-cpu.cRDTSCPbetween two reads of the global clock (CLOCK_MONOTONIC_RAW, HPET here), keeping the tightest of 200 pairstsc-vs-boottime.cCLOCK_BOOTTIME9. Kernel interfaces, no new code
/sys/devices/system/cpu/cpu*/cpufreq/amd_pstate_prefcore_ranking: the amd-pstate preferred-core ranking (kernel ≥ 6.9). It ranks core 0 at the top, so the scheduler favors the one core with the wrong TSC.amd_prefcore=disableon the kernel command line, set through a file in/etc/default/grub.d/, turns the ranking off. Before: 78 freeze frames per hour. After: 0 frames ≥ 1 s in 30 minutes.How the pieces fit
GPU at 0% (1) → one thread spinning on core 0 while the main thread waits (3) → the spin is
ThreadSpinin the game's code (4) → not the driver, even on Mesa (5) → each session has its own hard cap (6) → the main thread never sets a timeout, so the cap comes from the spinner's clock (7) → the cap equals that boot's TSC gap, which only CPU 0 has (8) → kernel 7.0's preferred-core ranking sends threads to CPU 0, and disabling it removes the freezes (9).Everything except the GameMode hook is public. If you suspect the same problem on your machine, steps 6 and 8 are enough to confirm it: one MangoHud log and
warp-per-boot.sh.— @rattones
Documenta a sonda no README e alinha o CHANGELOG e os testes
rattones commentedon Oct 6, 2026
The GameMode hooks are public too, and a correction about
amd_prefcore=disableTo make the setup behind this investigation easier to reproduce, I have also published the GameMode scripts I used: rattones/gamemode-hooks (MIT, README in English and Portuguese).
They are what recorded every session in this issue. With
gamemoderun %command%in the launch options, the hook starts monitor attached to the game's PID when it opens, and stops it when the game exits. No session had to be started by hand.On the same open/close events the hooks also apply, and then restore, a few common tweaks:
platform_profile) set to performance;Each tweak checks for the feature it needs and is skipped where it is missing. The installer detects the hardware and asks about anything that isn't clear:
sudois needed only to add your user to thegamemodegroup, which Ubuntu's polkit rule requires for GameMode to change the CPU governor. The files go to your own home, owned by you.To be clear: these hooks don't fix or cause the freezes. The root cause is CPU 0's TSC, as explained in the closing comment above. They are just the harness that made recording dozens of sessions effortless, and they may help anyone collecting comparable data on their own machine.
Correction:
amd_prefcore=disablereduces the freezes, it doesn't remove themIn the closing comment I wrote that booting with
amd_prefcore=disable"made the freezes disappear". That came from a single 30-minute session, and a longer one shows it was partly luck. To compare the same thing across the three sessions, the table counts the moments where GPU utilization fell to 0% for 1 s or more, from the monitor's 500 ms samples. The 2026-10-06 session has no MangoHud log.amd_prefcoredisabledisableSix of the seven stops on 2026-10-06 have the same signature as before: a thread spinning on core 0, either a
GlobPool/Nworker with the main thread waiting infutex_do_waitorep_poll, or the main thread itself. In one of them the main thread moved from cpu1 to cpu0, spun at 100% and stopped spinning as soon as the scheduler moved it to cpu12. That is the TSC mechanism in a single trace. The seventh stop (1.0 s, aGlobPoolworker on cpu1) is something else.So disabling preferred cores cuts the freezes by roughly 80–85%, because the scheduler stops packing work onto core 0. Threads still land on core 0 now and then (5.3% of busy game-thread samples in this session), and when one does in the middle of a spin, the freeze comes back with the same cap as that boot's TSC gap.
The rest of the closing comment stands. The cause is still CPU 0's TSC, and
amd_prefcore=disableis still the most effective workaround that keeps every core in use. Removing the freezes completely would take one of three things:CLOCK_MONOTONICinstead of rawRDTSC, as suggested in the closing comment.— @rattones
rattones commentedon Oct 8, 2026
Update: syncing CPU 0's TSC at boot removes the freezes here (tsc-sync)
This is probably my last update. It is the best fix so far, and possibly the definitive one for this machine.
To recap: the freezes come from CPU 0's TSC, which the firmware brings up a few seconds behind the other cores. The spin-wait in
ThreadSpinis timed withRDTSC, so a thread that moves to core 0 in the middle of a wait spins for the whole gap. Booting withamd_prefcore=disablecut the freezes by about 85%, because the scheduler stopped favoring core 0. It didn't remove them, since threads still land on core 0 now and then.The remaining step was to remove the gap itself. This CPU has no
TSC_ADJUST, so the kernel can't do it: it only marks the TSC unstable and switches to HPET. I wrote a small tool that does it at boot: rattones/tsc-sync (MIT).What it does
CLOCK_MONOTONIC_RAW, and interpolates. Its measurement of the gap matches the kernel's boot-time "TSC warp" figure to within a few dozen cycles.0x10, through/dev/cpu/N/msr). It then measures again and refines until the gap is within 50 µs.tsc-syncalone (no root) only measures.Results
Five hours after the first boot, the TSCs were still in sync. With the fix active (and
amd_prefcore=disable), a 71-minute session had no stop of 0.5 s or more. That count comes from the monitor's 500 ms GPU samples, since there was no MangoHud log in that session. For comparison, on the same measure:amd_prefcore=disablealoneamd_prefcore=disable+ tsc-syncAn earlier 28-minute session with the fix had two stops, neither involving core 0: one while the match was loading and one as the game was closing.
The boot log
This is the journal of the second boot (
journalctl -b -o short-monotonic -kplus-u tsc-sync.service), with the 14 "ok" lines for CPUs 2–15 omitted. tsc-sync prints in the system language, Portuguese here: "ATRASADA" means behind, and "sincronizada (resta …)" means in sync (… left).The kernel's 12,686,465,901 cycles at 3193.966 MHz are 3.972 s, the same gap tsc-sync measured on its own. The whole service takes 0.37 s and finishes 7.1 s after the kernel starts, before the desktop session. The first boot looked the same: the kernel reported 10,088,746,727 cycles (3.16 s), tsc-sync measured 3.158645 s, and one write left 6.0 µs.
Two hours later, measured again (with
TSC_SYNC_LANG=enfor this post):The tool
rattones/tsc-sync is a small C program (libc only) plus two systemd units, with a README in English and Portuguese.
/dev/cpu/N/msrmissing, write refusedmeasureand--dry-run)How it works, in more detail than above:
TSC_SYNC_LANG,LC_ALL,LC_MESSAGESorLANG, with the same i18n pattern as monitor.Caveats
msrdriver logsWrite to unrecognized MSR 0x10 ... tainting CPU_OUT_OF_SPECon every boot where it writes. It needs kernel lockdown off (Secure Boot usually turns it on).TSC_ADJUST, like these Ryzen laptops. WhereTSC_ADJUSTexists (Intel), the kernel already keeps the TSCs in sync and would undo such a write.If you have the same freezes
journalctl -k -b | grep "TSC warp": if the kernel reports a warp on your machine, compare it with your longest freezes.tsc-sync(no root) shows which CPU is off and by how much.amd_prefcore=disableis the low-risk first step. tsc-sync is the one that removed the freezes here.For Valve
The real fix for everyone still belongs in the game. A user should not need to write CPU registers to play. Timing the spin-wait with
CLOCK_MONOTONIC, or restarting the timer whenRDTSCPreports a CPU change, would make Dota 2 immune to this firmware defect on every affected machine.Thank you to everyone who followed this thread.
— @rattones
dulcean commentedon Oct 25, 2026
https://github.com/dulcean/Dota2-TSC-Fix
rattones commentedon Oct 27, 2026
https://github.com/rattones/tsc-sync
tsc-sync is a low-level utility designed to resolve Time Stamp Counter (TSC) drift on x86 multi-core CPUs. By directly targeting Core 0, it resets its hardware timestamp MSR to align seamlessly with all other cores. This eliminates micro-stutters, timing discrepancies, and performance losses caused by asynchronous core clocks.
"This is my solution; it directly targets the Core 0 synchronization issue by resetting it so that all cores share the exact same timestamp."