Bug 50657

Summary: [Evergreen,GIT,Tiling?] Occasional invalid command stream and subsequent performance increase
Product: Mesa Reporter: Thomas Lindroth <thomas.lindroth>
Component: Drivers/Gallium/r600Assignee: Default DRI bug account <dri-devel>
Status: RESOLVED MOVED QA Contact:
Severity: normal    
Priority: medium CC: niels_ole
Version: git   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: dmesg, Xorg.log

Description Thomas Lindroth 2012-06-03 15:46:47 UTC
Starting Warcraft 3 in Wine sometimes failes because of invalid command stream. It happens in about 10% of all startup attempts.

After a failed startup Warcraft normally starts fine again and with improved framerate. Normal framerate after clean reboot is 110fps and directly after error it jumps to 150fps. Other applications also get improved framerate. Street fighter 4 benchmark in wine goes from 50 to 61 and glxgears from 4,000 to 10,000. The increased performance lasts for about 2 min and drops back to normal after that. It will jump again next time the error is triggered. No rendering errors can be seen. No other applications besides war3 can trigger the failed command stream.

Dmesg reports:
radeon 0000:01:00.0: evergreen_surface_value_conv_check:325 depth invalid array mode 15
radeon 0000:01:00.0: evergreen_cs_track_validate_depth:645 depth invalid (0xffffffff 0x00000000 0xffffffff)
radeon 0000:01:00.0: evergreen_packet3_check:2015 invalid cmd stream
Same message every time. No other error reported in dmesg or Xorg.log

Hardware is HD 6770. Using DDX,Mesa,libdrm from latest git. Kernel 3.4.0. "ColorTiling" "true"
"ColorTiling2D" "true"
"SwapbuffersWait" "false"
"EnablePageFlip" "true"
radeon.pcie_gen2=1

War3 is invoked as "vblank_mode=0 WINEDEBUG=fps wine war3.exe -opengl" in a wine virtual desktop.

The error might be build related. Building mesa with --enable-debug triggers the error more often it seems. Pipeing the output of wine to file also triggers the error.

Mesa built from gentoo ebuild
./configure --prefix=/usr --build=i686-pc-linux-gnu --host=i686-pc-linux-gnu --mandir=/usr/share/man --infodir=/usr/share/info --datadir=/usr/share --sysconfdir=/etc --localstatedir=/var/lib --disable-dependency-tracking --enable-dri --enable-glx --enable-texture-float --disable-debug --enable-egl --disable-gbm --disable-gles1 --disable-gles2 --enable-glx-tls --disable-osmesa --enable-asm --enable-shared-glapi --disable-xa --disable-xorg --with-dri-drivers= --with-gallium-drivers=,swrast,r600 --with-egl-platforms=x11 --enable-gallium-egl --disable-d3d1x --disable-gallium-g3dvl --enable-gallium-llvm --disable-openvg --disable-r600-llvm-compiler --disable-vdpau --disable-xvmc
Comment 1 Thomas Lindroth 2012-06-04 04:00:47 UTC
Created attachment 62497 [details]
dmesg, Xorg.log
Comment 2 Thomas Lindroth 2012-06-04 04:03:45 UTC
I get a similar error in Psychonauts from the humble bundle. It fails every time and give a slightly different error in dmesg. I applied the patch from here https://bugzilla.icculus.org/show_bug.cgi?id=5540

Attached dmesg is from Psychonauts.
Comment 3 Thomas Lindroth 2012-06-09 01:34:49 UTC
Disregard the previous comment. I forgot Psychonauts is 32bit and therefor don't use my git drivers automatically. There is nothing wrong with it but the first comment still apply.

Turning off ColorTiling2D or using a blank xorg.conf makes no difference. The problem is the same on kernel 3.3 except there is no error in dmesg. It just fails to render anything.
Comment 4 Jerome Glisse 2012-06-09 07:36:43 UTC
Does kernel patch: (apply against 3.5 but need a small diff for 3.4) helps
 http://people.freedesktop.org/~glisse/0001-drm-radeon-fix-tiling-and-command-stream-checking-on.patch
Comment 5 Thomas Lindroth 2012-06-09 14:01:11 UTC
I tested the patch against 3.5 but it didn't help.

I should also mention that I'm experiencing memory/filesystem corruption but only when or directly after I've used some opengl app. After filesystem restoration and reboot everything works fine until the next time I use an opengl app. I can't say for sure it's graphics related yet but I've ruled out hardware error in the disk and ram.

I think it was airlied who on irc told me to try a patch in the 3.5 kernel related to GART but I got the same corruption with 3.5.
Comment 6 Thomas Lindroth 2012-06-13 06:56:07 UTC
I've figured out what cause the performance increase. When dmesg gets flooded with messages syslog use 100% cpu for a while. Performance increase during that time. The same thing can be achieved by running while true;do true;done. I guess it has something to do with the cpu's power states.

It would be nice to always have that boost. Using fthrottle_mode=0 didn't help.
Comment 7 GitLab Migration User 2019-09-18 19:00:22 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/mesa/mesa/issues/412.

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.