Documentation: amdgpu lowered lockup_timeout in kernel 7.x affects InvokeAI
Is there an existing issue for this problem?
- [x] I have searched the existing issues
Install method
Invoke's Launcher
Operating system
Linux
GPU vendor
AMD (ROCm)
GPU model
Radeon R9700 AI PRO
GPU VRAM
32
Version number
v6.13.6
Browser
No response
System Information
Irrelevant
What happened
I started getting some repeatable GPU timeouts on AMD:
ring gfx_0.0.0 timeout
Process Xorg ... Xorg:cs0
Starting gfx_0.0.0 ring reset
Ring gfx_0.0.0 reset succeeded
[drm] device wedged, but recovered through reset
The screen would freeze and not recover. InvokeAI was still running in the background until it finished.
I could SSH into the machine and sudo service restart lightdm to recover.
But I noticed InvokeAI was fine on Kernel 6.17, though the screen would lock up for roughly 2 seconds while finishing VAEs (which was at the time the system would freeze in 7.0).
The culprit?
lockup_timeout was lowered from 10 seconds to 2 seconds:
6.17
modinfo amdgpu | grep -E 'lockup_timeout|timeout_period|timeout_fatal_disable|gpu_recovery'
parm: lockup_timeout:GPU lockup timeout in ms (default: 10000 for all jobs. 0: keep default value. negative: infinity timeout), format: for bare metal [Non-Compute] or [GFX,Compute,SDMA,Video]; for passthrough or sriov [all jobs] or [GFX,Compute,SDMA,Video]. (string)
parm: gpu_recovery:Enable GPU recovery mechanism, (1 = enable, 0 = disable, -1 = auto) (int)
parm: timeout_fatal_disable:disable watchdog timeout fatal error (false = default) (bool)
parm: timeout_period:watchdog timeout period (0 = timeout disabled, 1 ~ 0x23 = timeout maxcycles = (1 << period) (uint)
7.0
parm: lockup_timeout:GPU lockup timeout in ms (default: 2000. 0: keep default value. negative: infinity timeout), format: [single value for all] or [GFX,Compute,SDMA,Video]. (string)
parm: gpu_recovery:Enable GPU recovery mechanism, (1 = enable, 0 = disable, -1 = auto) (int)
parm: timeout_fatal_disable:disable watchdog timeout fatal error (false = default) (bool)
parm: timeout_period:watchdog timeout period (0 = timeout disabled, 1 ~ 0x23 = timeout maxcycles = (1 << period) (uint)
It may be relevant to document that AMDGPU users on Linux should set amdgpu.lockup_timeout kernel parameter back to something higher like 10 seconds or else InvokeAI may "crash" the Xorg server.
Technically this is not InvokeAI's fault, but it is customary on Windows for commercial software to explain that TDR setting needs to be increased given that it's relevant to the application.
What you expected to happen
The system to continue working normally.
How to reproduce the problem
Just run any workload with SDXL at around 1320x1320 on Kernel 7.0 and the display will freeze.
Additional context
No response
Discord username
No response
I traced this against the current InvokeAI troubleshooting documentation and the upstream amdgpu parameter definition before proposing a documentation change.
The current Linux amdgpu source does document a 2000 ms default for non-SR-IOV queues, so the driver-side behavior described here is real. However, the report in #9374 also says that increasing the timeout did not resolve that user's VAE-decode crash. I therefore would not present this as a general ROCm or InvokeAI crash fix.
I can prepare a narrowly scoped FAQ addition with the following boundaries:
- apply it only when the kernel log contains matching amdgpu watchdog/reset signatures, such as
ring gfx_... timeout,Starting ... ring reset, ordevice wedged; - explain that
lockup_timeoutis a kernel-driver watchdog and is not the cause of every AMD/ROCm generation failure; - show
amdgpu.lockup_timeout=10000as a diagnostic example rather than a universal required setting; - avoid distribution-specific bootloader commands, and instead direct users to their distribution's kernel-parameter documentation;
- include a way to inspect the effective value after reboot, for example
/sys/module/amdgpu/parameters/lockup_timeout; - warn that increasing the timeout delays recovery from a genuine GPU hang and should be reverted if it does not help;
- link to the upstream amdgpu parameter source or another authoritative kernel reference.
The proposed location is docs/src/content/docs/troubleshooting/faq.mdx, near the existing Linux-specific memory section. I would validate the change with the repository's documentation checks:
pnpm -C docs build
pnpm -C docs check-redirects
Would maintainers prefer this in the general FAQ, or in a Linux/AMD-specific troubleshooting page? Also, should the documentation include 10 seconds as the concrete diagnostic example, or describe how to inspect and choose a value without recommending one?
@Jokasa7 - respectfully to the poster involved, I do not think that the timeout setting would have been adjusted as part of those tests. They were declining to modify env variables and the invoke yaml config in a prior discussion citing "not being a coder" ... so I think it's likely that they just tried the invokeai.yml changes suggested and glossed over the kernel level changes.
Apologies to that poster if I am mistaken though.
Thanks for the clarification — I agree that #9374 should not be treated as evidence that increasing lockup_timeout was actually tested and failed, so I’m withdrawing that inference. The narrower documentation boundary still seems appropriate: mention this only when the logs show matching amdgpu watchdog/reset signatures, present it as a diagnostic rather than a general ROCm fix, and include inspection and revert guidance. I’ll wait for maintainer guidance on placement and whether to include a concrete value before preparing a PR.
apply it only when the kernel log contains matching amdgpu watchdog/reset signatures, such as
That makes sense. I also need to remind everyone that (at least on my setup) the keyboard became 100% unresponsive and I could only see dmesg (and restart xorg) from another laptop via SSH. Not even Ctrl+Alt+F2 to switch to tty. Other users may not be running an SSH server nor have a spare computer to login.
For such cases, on most machines (systemd) one can inspect the previous boot via:
journalctl -b -1
Also another symptom is that if you're running music while the crash happened, the music will continue playing as normal for quite some time (usually until the track is over). This includes youtube videos running on Firefox.
show amdgpu.lockup_timeout=10000 as a diagnostic example rather than a universal required setting;
In my particular case the lock up is extremely close to 2 seconds (you can tell from the mouse cursor and... well, anything else running in the background that is animated). Personally I raised it to 8000 to stay on the safe side, but I could probably get away with setting it to 3500 or 4000. I did not test whether higher resolutions cause longer lock ups, but higher resolutions also bring other problems (mostly out of memory, or simply very long invoke times).
respectfully to the poster involved, I do not think that the timeout setting would have been adjusted as part of those tests. They were declining to modify env variables and the invoke yaml config in a prior discussion citing "not being a coder"
I also suspect the poster did not try the solution (no disrespect), which is exactly why I am bringing this up: Modifying amdgpu.lockup_timeout is "scary" and not easy, specially given InvokeAI's target audience. Just recognizing the symptoms is already hard. That's why good documentation is paramount.
In the long run, AMD may improve ROCm so that all those cryptic environment variables are no longer needed, but amdgpu.lockup_timeout is a recurring problem on any OS from any vendor for any problem that hogs the GPU.
I've spent some time documenting my ROCm based setup on Linux, in case it helps others. I currently have no issues with SD or SDXL generation and as long as I'm gentle with the models and images sizes, it seems Z-Image, Anima and KREA are working... just trying some Flux now and will download some of the other models available from the starter models, but I'm quite happy with this setup at the moment (not tried WAN since the feature was launched, not sure it will go well on ROCm).
EDIT: Updated documentation URL
@fishd72 Your ROCm documentation looks very useful, and I wonder if it would be OK to link to it from the official documentation - probably in both the Troubleshooting section and in the section on AMD cards. Is your documentation stable, and can we link to it?
@lstein That's cool with me, if you could give me a day to tidy the contents a little (was coming off an insomnia spiral) and I'll change the repo a little as I want to also add some helper scripts that I'll be working on... but I'll provide an updated link shortly.
@lstein Ok, I've changed some things around in the repo and if you're happy with the content, it should be stable at https://codeberg.org/fishd/invokeai-tips/src/branch/main/amd.md ... let me know if there is anything you'd like altered.
There has been no activity in this issue for 30 days. If this issue is still being experienced, please reply with an updated confirmation that the issue is still being experienced with the latest release.
Due to inactivity, this issue was automatically closed. If you are still experiencing the issue, please recreate the issue.