[R600] background pixels drawn above foreground ones on RV630 and RV635 (depth sorting issue?)
Description
Graphical glitches that looks like some depth sorting issues are visible on RV630
and RV635
(TeraScale 1
) GPUs when this bug is not seen in other ATI/AMD GPUs including TeraScale 1
GPUs that are not RV630
or RV635
.
System details
Distribution: Ubuntu 20.04 LTS focal
Linux kernel: 5.4.0-40-generic
Mesa: 20.0.8-0ubuntu1~20.04.1
GPUs:
01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] RV630 PRO [Radeon HD 2600 PRO AGP] [1002:9587]
07:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] RV635 [Radeon HD 3650/3750/4570/4580] [1002:9598]
Context
I found the bug while testing the free open source game Unvanquished on a wide range of GPUs and configurations. Among the GPUs I tested, I tested four TeraScale 1
GPUs, two of them reproduce the bug.
The two GPUs reproducing the bugs were tested on different computers sharing no hardware component, and I tested one buggy GPU and one non-buggy GPU on each computer.
I used Ubuntu 20.04 (Linux 5.4.0, Mesa 20.0.8) on both computers but they were installed separately (one is upgraded from Ubuntu 19.10, one is a fresh install).
TeraScale 1 reproduceability matrix
A Saint Andrew's cross (Status
column means the bug is reproduced on given hardware:
Vendor | Name | Code name | Micro arch. | Bus | Lith. | Mem. size | GL Core | Status |
---|---|---|---|---|---|---|---|---|
Sapphire | Radeon HD 2600 PRO | RV630 | TeraScale 1 | AGP 8x | 65nm | 512MB, 128-bit, DDR2 | 3.3 | |
HP | Radeon HD 3650 | RV635 PRO | TeraScale 1 | PCIe 2.0 x16 | 55nm | 256MB, 128-bit, DDR2 | 3.3 | |
HIS | Radeon HD 4670 IceQ | RV730 XT | TeraScale 1 | AGP 8x | 40nm | 1GB, 128-bit, DDR3 | 3.3 | |
Sapphire | Radeon HD 4890 Vapor-X | RV790 XT | TeraScale 1 | PCIe 2.0 x16 | 55nm | 1GB, 256-bit, GDDR5 | 3.3 |
How to reproduce
As seen on the previous table, I'm not able to reproduce the bug with TeraScale 1
ATI GPUs that are not RV630
/RV635
.
Also, I'm not able to reproduce the bug with other GPUs from other architecture and generation I may have access to (TeraScale 2
, TeraScale 3
, GCN 2
, GCN 5
)
So you may require an RV630
/RV635
GPU to reproduce the bug. Because this is very hardware specific I may free some time to make me available for help if access to the hardware is hard to get on your side (see below).
If you have access to the hardware, you can reproduce the bug this way:
wget https://github.com/Unvanquished/Unvanquished/releases/download/v0.51.1/unvanquished_0.51.1.zip
unzip unvanquished_0.51.1.zip
cd unvanquished_0.51.1
unzip linux-amd64.zip
./daemon +devmap plat23
The default scene is displayed below (nightly industrial platform).
To get the other scene (snowy cloudy chasm), you may run /devmap chasm
in game's console ([Shift + Escape]
to open it) or quit the game and restart it this way:
./daemon +devmap chasm
To reproduce the special variant of the bug with tris
lines displayed, type /r_showTris 1
in game's console (/r_showTris 0
) to revert to the default behaviour).
Visual depiction of the bug
So, the Radeon HD 2600 PRO (RV630) and HD 3650 (RV635 PRO) produce the same graphical bugs in game.
Those are screenshots taken using the Radeon HD 2600 PRO (RV630):
Same scene using the Radeon HD 4670 (RV730 XT) on the same computer:
Doing screenshots with Radeon HD 3650 (RV635 PRO) on the other computer would display the exact same garbage of Radeon HD 2600 PRO (RV630), while the Radeon HD 4890 Vapor-X (RV790 XT) on that other computer would display things correctly like the Radeon HD 4670 IceQ (RV730 XT).
I noticed one interesting thing, when I ask the game engine to render some line showing the tris, the lines repaint the background texture with the foreground texture, as seen on this screenshot taken with Radeon HD 3650 (RV635 PRO):
So when drawing those lines, some pixels that were badly rendered are now properly rendered when next to a line.
Some logs
For the AGP Radeon HD 2600 PRO (RV630):
lspci -nn -vvv s 01:00.0
01:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] RV630 PRO [Radeon HD 2600 PRO AGP] [1002:9587] (prog-if 00 [VGA controller])
Subsystem: Advanced Micro Devices, Inc. [AMD/ATI] RV630 PRO [Radeon HD 2600 PRO AGP] [1002:0028]
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 64 (2000ns min), Cache Line Size: 64 bytes
Interrupt: pin A routed to IRQ 16
NUMA node: 0
Region 0: Memory at e0000000 (32-bit, prefetchable) [size=256M]
Region 1: I/O ports at e000 [size=256]
Region 2: Memory at fbff0000 (32-bit, non-prefetchable) [size=64K]
Expansion ROM at 000c0000 [disabled] [size=128K]
Capabilities: [50] Power Management version 3
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [58] AGP version 3.0
Status: RQ=256 Iso- ArqSz=0 Cal=0 SBA+ ITACoh- GART64- HTrans- 64bit- FW+ AGP3+ Rate=x4,x8
Command: RQ=32 ArqSz=0 Cal=0 SBA+ AGP+ GART64- 64bit- FW- Rate=x8
Kernel driver in use: radeon
Kernel modules: radeon
glxinfo -B
name of display: :0
display: :0 screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
Vendor: X.Org (0x1002)
Device: AMD RV630 (DRM 2.50.0 / 5.4.0-40-generic, LLVM 10.0.0) (0x9587)
Version: 20.0.8
Accelerated: yes
Video memory: 512MB
Unified memory: no
Preferred profile: core (0x1)
Max core profile version: 3.3
Max compat profile version: 3.0
Max GLES1 profile version: 1.1
Max GLES[23] profile version: 3.0
Memory info (GL_ATI_meminfo):
VBO free memory - total: 511 MB, largest block: 511 MB
VBO free aux. memory - total: 253 MB, largest block: 253 MB
Texture free memory - total: 511 MB, largest block: 511 MB
Texture free aux. memory - total: 253 MB, largest block: 253 MB
Renderbuffer free memory - total: 511 MB, largest block: 511 MB
Renderbuffer free aux. memory - total: 253 MB, largest block: 253 MB
Memory info (GL_NVX_gpu_memory_info):
Dedicated video memory: 512 MB
Total available memory: 765 MB
Currently available dedicated video memory: 511 MB
OpenGL vendor string: X.Org
OpenGL renderer string: AMD RV630 (DRM 2.50.0 / 5.4.0-40-generic, LLVM 10.0.0)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 20.0.8
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL version string: 3.0 Mesa 20.0.8
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 20.0.8
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00
For the PCI Express Radeon HD 3650 (RV635 PRO):
lspci -nn -vvv -s 07:00.0
07:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] RV635 [Radeon HD 3650/3750/4570/4580] [1002:9598] (prog-if 00 [VGA controller])
Subsystem: Dell RV635 [Radeon HD 3650/3750/4570/4580] [1028:2242]
Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx+
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
Latency: 0, Cache Line Size: 64 bytes
Interrupt: pin A routed to IRQ 74
NUMA node: 0
Region 0: Memory at c0000000 (64-bit, prefetchable) [size=256M]
Region 2: Memory at fe520000 (64-bit, non-prefetchable) [size=64K]
Region 4: I/O ports at b000 [size=256]
Expansion ROM at fe500000 [disabled] [size=128K]
Capabilities: [50] Power Management version 3
Flags: PMEClk- DSI- D1+ D2+ AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
Capabilities: [58] Express (v2) Legacy Endpoint, MSI 00
DevCap: MaxPayload 128 bytes, PhantFunc 0, Latency L0s <4us, L1 unlimited
ExtTag+ AttnBtn- AttnInd- PwrInd- RBE+ FLReset-
DevCtl: CorrErr- NonFatalErr- FatalErr- UnsupReq-
RlxdOrd- ExtTag+ PhantFunc- AuxPwr- NoSnoop+
MaxPayload 128 bytes, MaxReadReq 128 bytes
DevSta: CorrErr- NonFatalErr- FatalErr- UnsupReq- AuxPwr- TransPend-
LnkCap: Port #1, Speed 5GT/s, Width x16, ASPM L0s L1, Exit Latency L0s <64ns, L1 <1us
ClockPM- Surprise- LLActRep- BwNot- ASPMOptComp-
LnkCtl: ASPM Disabled; RCB 64 bytes Disabled- CommClk+
ExtSynch- ClockPM- AutWidDis- BWInt- AutBWInt-
LnkSta: Speed 5GT/s (ok), Width x8 (downgraded)
TrErr- Train- SlotClk+ DLActive- BWMgmt- ABWMgmt-
DevCap2: Completion Timeout: Not Supported, TimeoutDis-, NROPrPrP-, LTR-
10BitTagComp-, 10BitTagReq-, OBFF Not Supported, ExtFmt-, EETLPPrefix-
EmergencyPowerReduction Not Supported, EmergencyPowerReductionInit-
FRS-
AtomicOpsCap: 32bit- 64bit- 128bitCAS-
DevCtl2: Completion Timeout: 50us to 50ms, TimeoutDis-, LTR-, OBFF Disabled
AtomicOpsCtl: ReqEn-
LnkCtl2: Target Link Speed: 5GT/s, EnterCompliance- SpeedDis-
Transmit Margin: Normal Operating Range, EnterModifiedCompliance- ComplianceSOS-
Compliance De-emphasis: -6dB
LnkSta2: Current De-emphasis Level: -6dB, EqualizationComplete-, EqualizationPhase1-
EqualizationPhase2-, EqualizationPhase3-, LinkEqualizationRequest-
Capabilities: [a0] MSI: Enable+ Count=1/1 Maskable- 64bit+
Address: 00000000fee00000 Data: 0000
Capabilities: [100 v1] Vendor Specific Information: ID=0001 Rev=1 Len=010 <?>
Kernel driver in use: radeon
Kernel modules: radeon
glxinfo -B
name of display: :0
display: :0 screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
Vendor: X.Org (0x1002)
Device: AMD RV635 (DRM 2.50.0 / 5.4.0-40-generic, LLVM 10.0.0) (0x9598)
Version: 20.0.8
Accelerated: yes
Video memory: 256MB
Unified memory: no
Preferred profile: core (0x1)
Max core profile version: 3.3
Max compat profile version: 3.0
Max GLES1 profile version: 1.1
Max GLES[23] profile version: 3.0
Memory info (GL_ATI_meminfo):
VBO free memory - total: 255 MB, largest block: 255 MB
VBO free aux. memory - total: 508 MB, largest block: 508 MB
Texture free memory - total: 255 MB, largest block: 255 MB
Texture free aux. memory - total: 508 MB, largest block: 508 MB
Renderbuffer free memory - total: 255 MB, largest block: 255 MB
Renderbuffer free aux. memory - total: 508 MB, largest block: 508 MB
Memory info (GL_NVX_gpu_memory_info):
Dedicated video memory: 256 MB
Total available memory: 765 MB
Currently available dedicated video memory: 255 MB
OpenGL vendor string: X.Org
OpenGL renderer string: AMD RV635 (DRM 2.50.0 / 5.4.0-40-generic, LLVM 10.0.0)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 20.0.8
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL version string: 3.0 Mesa 20.0.8
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 20.0.8
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00
Provided help
I used upcoming 0.52 version of Unvanquished to produce the screenshots but the official 0.51.1 release reproduces the bug too.
The Unvanquished game uses the open source Daemon game engine.
I first reported the issue on engine issue tracker there: github.com:DaemonEngine/Daemon#343.
I'm one of the core developers of the Unvanquished game and the Dæmon game engine but I'm not a renderer wizard, so you may not expect a magical patch from me but you can expect the best goodwill possible to help to figure out the bug.
The AGP Radeon HD 2600 PRO (RV630) is available for testing, its host computer is also dedicated for testing.
The PCI Express Radeon HD 3650 (RV635 PRO) is currently plugged in my main computer as a secondary provider (I can use it with DRI_PRIME=1
and is available for testing for the future days).
What can I do to help to figure out the root cause of the bug?