Created attachment 140109 [details]
Freeze before launching android emulator
X become unresponsive occasionally during the day, it usually happens before launching applications but it's not reproducible constantly, it also happens while browsing in Firefox. I have attached the log when it happened before launching the android emulator (amdgpu.vm_debug was set to true to show the stack trace). I can reboot the machine with a sysRq but everything graphical is freeze. Sometime it says gfxhub others mmhub.
Ubuntu 18.04, Kernel is 4.17 from the kernel-ppa, asrock ab350m pro4 updated to the latest test firmware with AGESA 188.8.131.52b to see if it fixed the problem but still happens, mesa stack from the oibaf ppa, with padoka it seems the error appears less frequently and the error is usually silent and can only see this "[drm:amdgpu_job_timedout [amdgpu]] *ERROR* ring gfx timeout, last signaled seq=453604"
The attached dmesg looks like bug 106418.
Other than that, per https://bugs.freedesktop.org/show_bug.cgi?id=105251#c9 , try the latest microcode files from https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/tree/amdgpu and make sure LLVM is version >= 6.
I think they are the same bug but in the title it was mentioned it was occurring during boot and that is not my case although I have this problem at boot (https://bugs.freedesktop.org/show_bug.cgi?id=106225). I've updated the microcode to the latest version, llvm was already at version 6. It seems it happens again but more rarely, it happened now after 7 hours of uptime.
I have updated the microcode for raven ridge, Mesa 18.0.5 and the microcode of the CPU also. I haven't had a problem in 2 days so I considered it solved.