Collecting debug information when your GPU hangs
After having my i965 hang) twice this morning, I decided to create a small script to make it easier to capture the relevant information when this sort of bug happens. Because the X server stops running, the display is useless, and it’s convenient to be able to get the relevant information by running a single command (I do this using ConnectBot on my phone).
It’s designed to be invoked manually by the user while the system is hung, but if we can somehow detect that it’s locked up, then we could run it automatically.
It collects dmesg, /proc/interrupts, /proc/dri and (for Intel cards) intel_gpu_dump output at the time of the hang. It then leaves behind a crash report in /var/crash, so that after the user recovers their system, apport will collect the usual information and submit a bug on the appropriate package.
If this seems useful, it could be added to x11-common or to apport.