AMD r600, Radeon HD, MESA Linux driver - workaround that solves the problem, scroll through the comments

By now it is from February 2019 that EEVEE on AMD GPUs pre gcn 1.0 (Mesa Gallium R600) is broken and unusable on linux …
This is because the acceleration of the Shaders was done with the Gallium Backend Shaders (also this a good link) on Mesa drivers, even before the standard and the new generations (on linux) of GPUs took hold, and therefore probably something is not totally compatible …
In this story there is good news, and it is that until January-February EEVEE on Linux on these GPUs worked well and had good performances, then something was changed in the GLSL code of the EEVEE Shaders (I assume) and the lights and the shadow broke.

I had created a bug report on the portal developers collecting videos and information … but then we chose to exclude these gpu support (even if on windows they work very well) and therefore it remained pending.
Radeon HD, MESA Linux Gallium r600, Light and Shadows Broken

The purpose of this thread, is to better investigate where the problem is, (I am convinced that it is something really small) and in case to be able to solve the problem.

the videos are from 5 months ago, but the situation until today has not changed

some useful comments from the bug report:

good and bad news

I’ve just tested the latest blender build with the latest mesa-devel driver…

the standard settings situation remained predominantly the same.
the good news is that if you launch blender with these parameters:
“DRI_PRIME=1 R600_DEBUG=nosb ./blender”
( DRI_PRME=1 …My radeon gpu is a discrete GPU, and the R600_DEBUG=nosb disable the shader backend acceleration) blender with eevee works perfectly.

the bad news is that the performance goes fuckoff …

so the problem is of the gallium drivers in particular of the shader compiler …

if someone understands what happens with the damned shader backend compiler … here the sources …

https://github.com/mesa3d/mesa/tree/master/src/gallium/drivers/r600/sb

in my opinion it is some trivial parameter wrongly interpreted, which breaks the proper functioning of lights and shadows in blender …

without the acceleration backend shader, eevee’s performances are really poor

I finally found “a workaround” that manages to use these GPUs to the best of their ability with the shader backend acceleration.

you need to start belender with:

R600_DEBUG=nosb,hyperz,llvm,sisched,forcedma AMD_DEBUG=nir ./blender
(more info https://www.phoronix.com/scan.php?page=news_item&px=RadeonSI-NIR-Civ6-Bits)
with the radeon mesa drivers there are still very small defects but the situation has improved a lot,

there is another possibility for improvement
I’m not sure if it works with all the GPUs in this HD generation, but on my radeon hd 7600m (a discrete gpu), I was able to start them with the amdgpu mesa xorg driver, instead of radeon mesa driver, and so all display defects were eliminated.

/etc/X11/xorg.conf.d/20-amdgpu.conf

Section "Device"
     Identifier "AMD"
     Driver "amdgpu"
 EndSection

(more info https://wiki.archlinux.org/index.php/AMDGPU)

now I have good performances and all the visual defects are gone.

I did these test with the last mesa-devel drivers from the oibaf ppa, I don’t know if it works with other previous mesa
https://launchpad.net/~oibaf/+archive/ubuntu/graphics-drivers

I made a video showing how the mesa drivers work well.
This video was made on a radeon HD 7670m, but out of curiosity I also did tests on a laptop that has a radeon HD 2600 XT with 512 mb ram, a 2007 laptop! and the workaround also works for them (obviously everything is slower, but visually it’s perfect.)

@fclem @mano-wii 10 year gpu’s generation of Radeon HD work well now on linux! (with accelerated shader backend)