Bug 93475

Summary: Saints Row IV causes GPU lockup on Linux
Product: DRI Reporter: Jan Holthuis <holthuis.jan>
Component: DRM/RadeonAssignee: Default DRI bug account <dri-devel>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: high CC: marcus.hewat, markus.lobedann
Version: XOrg git   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 77449    

Description Jan Holthuis 2015-12-22 14:13:37 UTC
When running Saints Row IV (the Linux version that was released yesterday), I'm getting GPU lockups on my AMD A6-3410MX APU (Radeon HD 6520G) when using mesa drivers (happens with 11.0.7 and 11.2.0-devel (git-d191066).

Heres some dmesg output: http://hastebin.com/gaxemomefo.log

My system:

$ uname -a
Linux jan-laptop 4.2.5-1-ARCH #1 SMP PREEMPT Tue Oct 27 08:13:28 CET 2015 x86_64 GNU/Linux

$ glxinfo | grep string
server glx vendor string: SGI
server glx version string: 1.4
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
OpenGL vendor string: X.Org
OpenGL renderer string: Gallium 0.4 on AMD SUMO (DRM 2.43.0, LLVM 3.8.0)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 11.2.0-devel (git-d191066)
OpenGL core profile shading language version string: 3.30
OpenGL version string: 3.0 Mesa 11.2.0-devel (git-d191066)
OpenGL shading language version string: 1.30
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 11.2.0-devel (git-d191066)
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00

$ cat /proc/cpuinfo
processor	: 0
vendor_id	: AuthenticAMD
cpu family	: 18
model		: 1
model name	: AMD A6-3410MX APU with Radeon(tm) HD Graphics
stepping	: 0
microcode	: 0x3000027
cpu MHz		: 1000.000
cache size	: 1024 KB
physical id	: 0
siblings	: 4
core id		: 0
cpu cores	: 4
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 6
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc extd_apicid aperfmperf pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt arat cpb hw_pstate npt lbrv svm_lock nrip_save pausefilter vmmcall
bugs		: fxsave_leak sysret_ss_attrs
bogomips	: 3195.31
TLB size	: 1536 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 40 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate cpb
<repeats 3 more times>
Comment 1 Sabrin Islam 2016-06-17 06:02:46 UTC
Saints Row 3 & 4 causes a system hardlock with my Radeon 6850 on R600, it games work with fglrx but hardlocks when starting the game (after splash screen -> New Game -> system locks). This happened on ubuntu 16.04 and 14.04 both with stock Mesa 11.2 , Mesa 11.3-devel and Mesa 12.1.0-devel (git-0e73d94 2016-06-16 trusty-oibaf-ppa), also currently on 14.04 and resorted to mesa to confirm and report but

dmesg output: http://hastebin.com/axabakesac.vhdl




$ uname -a
Linux orn-GA-78LMT-S2P 3.16.0-031600-generic #201408031935 SMP Sun Aug 3 23:36:11 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

$ glxinfo | grep string
server glx vendor string: SGI
server glx version string: 1.4
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
OpenGL vendor string: X.Org
OpenGL renderer string: Gallium 0.4 on AMD BARTS (DRM 2.39.0 / 3.16.0-031600-generic, LLVM 3.8.0)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 12.1.0-devel (git-0e73d94 2016-06-16 trusty-oibaf-ppa)
OpenGL core profile shading language version string: 3.30
OpenGL version string: 3.0 Mesa 12.1.0-devel (git-0e73d94 2016-06-16 trusty-oibaf-ppa)
OpenGL shading language version string: 1.30
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 12.1.0-devel (git-0e73d94 2016-06-16 trusty-oibaf-ppa)
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00


$ cat /proc/cpuinfo
processor	: 0
vendor_id	: AuthenticAMD
cpu family	: 16
model		: 4
model name	: AMD Phenom(tm) II X4 955 Processor
stepping	: 3
microcode	: 0x10000c8
cpu MHz		: 800.000
cache size	: 512 KB
physical id	: 0
siblings	: 4
core id		: 0
cpu cores	: 4
apicid		: 0
initial apicid	: 0
fpu		: yes
fpu_exception	: yes
cpuid level	: 5
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt hw_pstate npt lbrv svm_lock nrip_save
bogomips	: 6427.88
TLB size	: 1024 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 48 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate

processor	: 1
vendor_id	: AuthenticAMD
cpu family	: 16
model		: 4
model name	: AMD Phenom(tm) II X4 955 Processor
stepping	: 3
microcode	: 0x10000c8
cpu MHz		: 800.000
cache size	: 512 KB
physical id	: 0
siblings	: 4
core id		: 1
cpu cores	: 4
apicid		: 1
initial apicid	: 1
fpu		: yes
fpu_exception	: yes
cpuid level	: 5
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt hw_pstate npt lbrv svm_lock nrip_save
bogomips	: 6427.88
TLB size	: 1024 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 48 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate

processor	: 2
vendor_id	: AuthenticAMD
cpu family	: 16
model		: 4
model name	: AMD Phenom(tm) II X4 955 Processor
stepping	: 3
microcode	: 0x10000c8
cpu MHz		: 800.000
cache size	: 512 KB
physical id	: 0
siblings	: 4
core id		: 3
cpu cores	: 4
apicid		: 2
initial apicid	: 3
fpu		: yes
fpu_exception	: yes
cpuid level	: 5
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt hw_pstate npt lbrv svm_lock nrip_save
bogomips	: 6427.88
TLB size	: 1024 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 48 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate

processor	: 3
vendor_id	: AuthenticAMD
cpu family	: 16
model		: 4
model name	: AMD Phenom(tm) II X4 955 Processor
stepping	: 3
microcode	: 0x10000c8
cpu MHz		: 800.000
cache size	: 512 KB
physical id	: 0
siblings	: 4
core id		: 2
cpu cores	: 4
apicid		: 3
initial apicid	: 2
fpu		: yes
fpu_exception	: yes
cpuid level	: 5
wp		: yes
flags		: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc extd_apicid pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt hw_pstate npt lbrv svm_lock nrip_save
bogomips	: 6427.88
TLB size	: 1024 4K pages
clflush size	: 64
cache_alignment	: 64
address sizes	: 48 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate


$ lshw -C display
  *-display               
       description: VGA compatible controller
       product: Barts PRO [Radeon HD 6850]
       vendor: Advanced Micro Devices, Inc. [AMD/ATI]
       physical id: 0
       bus info: pci@0000:01:00.0
       version: 00
       width: 64 bits
       clock: 33MHz
       capabilities: pm pciexpress msi vga_controller bus_master cap_list rom
       configuration: driver=radeon latency=0
       resources: irq:42 memory:d0000000-dfffffff memory:fdfc0000-fdfdffff ioport:ee00(size=256) memory:fdf00000-fdf1ffff
Comment 2 Sabrin Islam 2016-06-17 06:04:20 UTC
Just to confirm that Saints Row 3 & 4 are working on radeonsi and GL/GLSL override to 4.1 does not work and still causes a hardlock on r600
Comment 3 i.kalvachev 2016-07-13 09:37:29 UTC
Could you try `export R600_DEBUG=nosb`?

This disables Shader Backend that optimizes the assembler code.
If this workarounds the problem, it would be useful to provide an
apitrace of the game that could reproduce your problem.

These may be related:
https://bugs.freedesktop.org/show_bug.cgi?id=86720
https://bugs.freedesktop.org/show_bug.cgi?id=94900
Comment 4 Michael Stenzel 2016-08-16 18:51:26 UTC
Hello,

I have a HD 5870, with radeon module.
Today I upgraded to kernel 4.7 and mesa git from a few hours ago.
Can confirm this issue with SR3, still locks the GPU up:

[ 2598.025126] radeon 0000:01:00.0: ring 3 stalled for more than 10025msec
[ 2598.025135] radeon 0000:01:00.0: GPU lockup (current fence id 0x000000000005d84c last fence id 0x000000000005d84d on ring 3)

after `export R600_DEBUG=nosb` the game seems to work fine here (played first level for a few minutes).
Comment 5 Jan Holthuis 2016-08-21 14:15:46 UTC
I uploaded an apitrace file at: https://transfer.sh/ufSHo/saintsrow4.trace

I've set the Steam launch options to this:
MESA_GL_VERSION_OVERRIDE=4.1 MESA_GLSL_VERSION_OVERRIDE=410 apitrace32 trace -a gl -o ~/saintsrow4.trace %command%

Using R600_DEBUG=nosb fixes the GPU lockup. 

Here's my setup:

$ cat /proc/cpuinfo | grep -m 1 "model name"
model name	: AMD A6-3410MX APU with Radeon(tm) HD Graphics

$ glxinfo | grep -E "^OpenGL.*string:"      
OpenGL vendor string: X.Org
OpenGL renderer string: Gallium 0.4 on AMD SUMO (DRM 2.45.0 / 4.7.1-1-ARCH, LLVM 3.8.1)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 12.0.1
OpenGL core profile shading language version string: 3.30
OpenGL version string: 3.0 Mesa 12.0.1
OpenGL shading language version string: 1.30
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 12.0.1
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00
Comment 6 Markus Lobedann 2017-06-04 12:00:00 UTC
I was able to reproduce this error before, but now it doesn't happen anymore with mesa 17.1 on arch linux with my AMD 6950.
Comment 7 Timothy Arceri 2019-07-04 01:30:32 UTC
Closing as per comment 6. Likely fixed by:

commit e933246013eef376804662f3fcf4646c143c6c88
Author: Heiko Przybyl <lil_tux@web.de>
Date:   Sun Nov 20 14:42:28 2016 +0100

    r600/sb: Fix loop optimization related hangs on eg

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.