Bug 98578 - AMDGPU white glitches in some games
Summary: AMDGPU white glitches in some games
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Gallium/radeonsi (show other bugs)
Version: git
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Default DRI bug account
QA Contact: Default DRI bug account
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-03 17:20 UTC by Lukas Jirkovsky
Modified: 2016-12-02 16:17 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
screenshot of the glitch (2.72 MB, image/png)
2016-11-03 17:20 UTC, Lukas Jirkovsky
Details
glxinfo (100.94 KB, text/plain)
2016-11-03 17:22 UTC, Lukas Jirkovsky
Details
the glitch on the last frame of the trace (1.75 MB, image/png)
2016-11-03 20:57 UTC, Lukas Jirkovsky
Details

Description Lukas Jirkovsky 2016-11-03 17:20:40 UTC
Created attachment 127732 [details]
screenshot of the glitch

I noticed white glitches in some games (namely The Vanishing of Ethan Carter run using wine and Dreamfall Chapters, which is native). The glitches seem random at first, as they manifest as random white specks, but they repeatedly happen at the same place. This is true for both games - if I play the game and I see the glitch in some place, I can be sure the glitch will be there the next time I play.

I'm running current mesa from git with LLVM from git on Arch Linux. The package versions are:

clang-svn 285849-1 
lib32-libdrm-git 5936.6493860-1 
lib32-llvm-libs-svn 285855-1 
lib32-mesa-git 86198.1d75d68-1 
lib32-mesa-libgl-git 86198.1d75d68-1 
libdrm-git 5936.6493860-1 
llvm-libs-svn 285849-1 
llvm-svn 285849-1 
mesa-git 86198.1d75d68-1 
mesa-libgl-git 86198.1d75d68-1

I have apitrace trace for the Vanishing of Ethan Carter with the glitch, but the trace has almost 700MB when compressed, so I would need some place to upload it.
Comment 1 Lukas Jirkovsky 2016-11-03 17:22:18 UTC
Created attachment 127733 [details]
glxinfo
Comment 2 Nicolai Hähnle 2016-11-03 19:05:26 UTC
Hi Lukas, thanks for the report. People often use Google Drive to upload traces, that would be helpful.
Comment 3 Andy Furniss 2016-11-03 19:19:33 UTC
(In reply to Nicolai Hähnle from comment #2)
> Hi Lukas, thanks for the report. People often use Google Drive to upload
> traces, that would be helpful.

I recently files a LLVM bug that looks similar(ish) corruption wise (small squares). If this started recently then maybe it's -

https://llvm.org/bugs/show_bug.cgi?id=30894
Comment 4 Lukas Jirkovsky 2016-11-03 20:56:50 UTC
I was able to get a smaller trace:
https://drive.google.com/open?id=0B2YvkwbBDwKYY1pPaUh0T1dlWjQ

The glitch appears on the last frame on the top of the tower for me. See the attached screenshot.

I can't tell for sure, but according to the update logs it must have been occurring with llvm 282xxx, too.
Comment 5 Lukas Jirkovsky 2016-11-03 20:57:50 UTC
Created attachment 127735 [details]
the glitch on the last frame of the trace
Comment 6 Lukas Jirkovsky 2016-11-06 19:14:15 UTC
Another trace (a big one), this time from Dreamfall Chapters. There are some small white glitches throughout the trace (which look a bit different than the reported glitch), but at the end of the trace there's supposed to be a liquid dripping and it's all covered with white specks. It may be a different problem, but it looks very similar to the one in Ethan Carter.

https://drive.google.com/open?id=0B2YvkwbBDwKYTzI4Q2V6QzNSWXM
Comment 7 Nicolai Hähnle 2016-11-07 12:10:26 UTC
Thanks for the trace, I can reproduce this and will look into it.
Comment 8 Nicolai Hähnle 2016-11-14 11:37:24 UTC
This took a while to track down. There is a shader (source @9633678, linked into program 1127) which relies on -inf * +F == -inf. LLVM transforms the shader in such a way that the result becomes a NaN instead (visible at a single pixel @ 953,0 in the final frame of the trimmed trace at @14722003), which then propagates to an ugly white square in post-processing. The LLVM transform is simply incorrect and fixed by https://reviews.llvm.org/D26602.
Comment 9 Lukas Jirkovsky 2016-11-15 20:07:32 UTC
Nicolai, you are awesome! I tried the patch and haven't seen a single glitch in The Vanishing of Ethan Carter.

I noticed one interesting thing. With current llvm (r286840), I got glitches all over the screen making the game absolutely unplayable. However, with your patch, all glitches (both old and the new) are fixed.

I tried Dreamfall Chapters, too. However, it's seriously broken with current llvm, so I can't provide any results. But given the fact Ethan Carter works fine with the patch, it's likely it's a different issue after all.
Comment 10 Nicolai Hähnle 2016-12-02 16:17:01 UTC
Fixed in LLVM trunk r288506.


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.