mesa-dri 23.1.8 and Radeon 570 and "failed to build shader variant"

wblock@

Developer
Hello again, all. My desktop system is running 13-stable with a Radeon 570 card, and was working great.
Today, I updated ports, including mesa-dri.

Now, X starts and appears to work, but with a display so corrupted it is basically just colors and patterns. Like a modulus is way off. The mouse pointer is visible, and the display changes when things are done like opening a window, but not readably. There is no crash, and I can close X cleanly because the icon is/would be in the lower right corner.

I have so far fired the parts cannon at this, including rebuilding all ports that changed recently, everything that xorg depends on, doing a source upgrade to the latest 13-stable, and trying rebuilding mesa-dri with and without the ZSTD option for shaders due to the errors shown below.

None of this has made any difference. I would really kind of like to have a desktop back.

Important notes:
I build from ports (sometimes with portmaster) and source. Not using Poudriere.
I don't know if the "failed to build shader" and "LLVM failed to upload shader" errors were shown before. I don't think so, but didn't look at it much when it was working.
Please pardon errors in formatting, it's been quite a while. And thanks for looking!

Console output from running startx:
Code:
X.Org X Server 1.21.1.9
X Protocol Version 11, Revision 0
Current Operating System: FreeBSD lightning 13.2-STABLE FreeBSD 13.2-STABLE stable/13-n256711-e7a86775f751 LIGHTNING amd64

Current version of pixman: 0.42.2
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
        (++) from command line, (!!) notice, (II) informational,
        (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.0.log", Time: Tue Nov 21 20:32:44 2023
(==) Using config directory: "/usr/local/etc/X11/xorg.conf.d"
(==) Using system config directory "/usr/local/share/X11/xorg.conf.d"
amdgpu: os_same_file_description couldn't determine if two DRM fds reference the same file description.
If they do, bad things may happen!
ac_rtld error: !data || data->d_size != shdr->sh_size
LLVM failed to upload shader
ac_rtld error: !data || data->d_size != shdr->sh_size
LLVM failed to upload shader
EE ../src/gallium/drivers/radeonsi/si_state_shaders.cpp:2505 si_build_shader_variant - Failed to build shader variant (type=0)
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Could not resolve keysym XF86CameraAccessEnable
> Warning:          Could not resolve keysym XF86CameraAccessDisable
> Warning:          Could not resolve keysym XF86CameraAccessToggle
> Warning:          Could not resolve keysym XF86NextElement
> Warning:          Could not resolve keysym XF86PreviousElement
> Warning:          Could not resolve keysym XF86AutopilotEngageToggle
> Warning:          Could not resolve keysym XF86MarkWaypoint
> Warning:          Could not resolve keysym XF86Sos
> Warning:          Could not resolve keysym XF86NavChart
> Warning:          Could not resolve keysym XF86FishingChart
> Warning:          Could not resolve keysym XF86SingleRangeRadar
> Warning:          Could not resolve keysym XF86DualRangeRadar
> Warning:          Could not resolve keysym XF86RadarOverlay
> Warning:          Could not resolve keysym XF86TraditionalSonar
> Warning:          Could not resolve keysym XF86ClearvuSonar
> Warning:          Could not resolve keysym XF86SidevuSonar
> Warning:          Could not resolve keysym XF86NavInfo
Errors from xkbcomp are not fatal to the X server
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning:          Could not resolve keysym XF86CameraAccessEnable
> Warning:          Could not resolve keysym XF86CameraAccessDisable
> Warning:          Could not resolve keysym XF86CameraAccessToggle
> Warning:          Could not resolve keysym XF86NextElement
> Warning:          Could not resolve keysym XF86PreviousElement
> Warning:          Could not resolve keysym XF86AutopilotEngageToggle
> Warning:          Could not resolve keysym XF86MarkWaypoint
> Warning:          Could not resolve keysym XF86Sos
> Warning:          Could not resolve keysym XF86NavChart
> Warning:          Could not resolve keysym XF86FishingChart
> Warning:          Could not resolve keysym XF86SingleRangeRadar
> Warning:          Could not resolve keysym XF86DualRangeRadar
> Warning:          Could not resolve keysym XF86RadarOverlay
> Warning:          Could not resolve keysym XF86TraditionalSonar
> Warning:          Could not resolve keysym XF86ClearvuSonar
> Warning:          Could not resolve keysym XF86SidevuSonar
> Warning:          Could not resolve keysym XF86NavInfo
Errors from xkbcomp are not fatal to the X server
/usr/local/bin/startxfce4: X server already running on display :0
xrdb:  "Xft.hinting" on line 8 overrides entry on line 5
xrdb:  "Xft.hintstyle" on line 10 overrides entry on line 6
amdgpu: os_same_file_description couldn't determine if two DRM fds reference the same file description.
If they do, bad things may happen!
/usr/local/bin/iceauth:  creating new authority file /var/run/user/1001/ICEauthority
xfce4-session-Message: 20:37:10.953: SSH authentication agent is already running
ac_rtld error: !data || data->d_size != shdr->sh_size
LLVM failed to upload shader
EE ../src/gallium/drivers/radeonsi/si_state_shaders.cpp:2505 si_build_shader_variant - Failed to build shader variant (type=0)
amdgpu: os_same_file_description couldn't determine if two DRM fds reference the same file description.
If they do, bad things may happen!
ac_rtld error: !data || data->d_size != shdr->sh_size
LLVM failed to upload shader
ac_rtld error: !data || data->d_size != shdr->sh_size
LLVM failed to upload shader
EE ../src/gallium/drivers/radeonsi/si_state_shaders.cpp:2505 si_build_shader_variant - Failed to build shader variant (type=0)
ac_rtld error: !data || data->d_size != shdr->sh_size
LLVM failed to upload shader
ac_rtld error: !data || data->d_size != shdr->sh_size
LLVM failed to upload shader
EE ../src/gallium/drivers/radeonsi/si_state_shaders.cpp:2505 si_build_shader_variant - Failed to build shader variant (type=0)
ac_rtld error: !data || data->d_size != shdr->sh_size
LLVM failed to upload shader
EE ../src/gallium/drivers/radeonsi/si_state_shaders.cpp:2505 si_build_shader_variant - Failed to build shader variant (type=0)
ac_rtld error: !data || data->d_size != shdr->sh_size
LLVM failed to upload shader
EE ../src/gallium/drivers/radeonsi/si_state_shaders.cpp:2505 si_build_shader_variant - Failed to build shader variant (type=0)
Warning:          Could not resolve keysym XF86CameraAccessEnable
Warning:          Could not resolve keysym XF86CameraAccessDisable
Warning:          Could not resolve keysym XF86CameraAccessToggle
Warning:          Could not resolve keysym XF86NextElement
Warning:          Could not resolve keysym XF86PreviousElement
Warning:          Could not resolve keysym XF86AutopilotEngageToggle
Warning:          Could not resolve keysym XF86MarkWaypoint
Warning:          Could not resolve keysym XF86Sos
Warning:          Could not resolve keysym XF86NavChart
Warning:          Could not resolve keysym XF86FishingChart
Warning:          Could not resolve keysym XF86SingleRangeRadar
Warning:          Could not resolve keysym XF86DualRangeRadar
Warning:          Could not resolve keysym XF86RadarOverlay
Warning:          Could not resolve keysym XF86TraditionalSonar
Warning:          Could not resolve keysym XF86ClearvuSonar
Warning:          Could not resolve keysym XF86SidevuSonar
Warning:          Could not resolve keysym XF86NavInfo
ac_rtld error: !data || data->d_size != shdr->sh_size
LLVM failed to upload shader

(xfce4-panel:1118): xfce4-panel-CRITICAL **: 20:37:11.549: Plugin xfsm-logout-plugin: The Desktop file /usr/local/share/xfce4/panel-plugins/xfsm-logout-plugin.desktop requested the Gtk2 API (v1.0), which is no longer supported.
ac_rtld error: !data || data->d_size != shdr->sh_size
LLVM failed to upload shader
EE ../src/gallium/drivers/radeonsi/si_state_shaders.cpp:2505 si_build_shader_variant - Failed to build shader variant (type=0)
ac_rtld error: !data || data->d_size != shdr->sh_size
LLVM failed to upload shader
EE ../src/gallium/drivers/radeonsi/si_state_shaders.cpp:2505 si_build_shader_variant - Failed to build shader variant (type=0)
ac_rtld error: !data || data->d_size != shdr->sh_size
LLVM failed to upload shader
ac_rtld error: !data || data->d_size != shdr->sh_size
LLVM failed to upload shader
EE ../src/gallium/drivers/radeonsi/si_state_shaders.cpp:2505 si_build_shader_variant - Failed to build shader variant (type=0)
ac_rtld error: !data || data->d_size != shdr->sh_size
LLVM failed to upload shader
EE ../src/gallium/drivers/radeonsi/si_state_shaders.cpp:2505 si_build_shader_variant - Failed to build shader variant (type=0)
xfce4-notifyd-Message: 20:37:11.772: Your sqlite library does not support OFFSET/LIMIT with DELETE; falling back to less-efficient deletion method
ac_rtld error: !data || data->d_size != shdr->sh_size
LLVM failed to upload shader
xinit: connection to X server lost

waiting for X server to shut down (II) Server terminated successfully (0). Closing log file.
 

Attachments

  • Xorg0log.txt
    31.1 KB · Views: 59
Do you have rebuild mesa-libs and other ports aswell?

I can confirm that x11 continues running using AMD RX 6700 XT

I have rebuild mesa-dri, mesa-libs, mesa-gallum-va and mesa-gallium-vpdau by hand while all other things are from latest repository.
 
All mesa ports installed have been rebuilt, including dependencies. But I don't have mesa-gallium-va or mesa-gallium-vdpau installed, and nothing required them.
 
Noticed a fresh patch release of the mesa-dri port. The log mentions that the Haswell driver does not work, and has been removed. So I updated that port... with no noticeable change.

But wait, I generally use Haswell CPU optimizations without trouble. So I removed that from make.conf, and rebuilt the new mesa-dri... with no noticeable change. Rebuilt a few other ports like mesa-libs and xf86-video-amdgpu, no change.

Now I'm rebuilding llvm15, just because.

It's not clear to me how this whole shader business works. Is llvm used at runtime to build code to run on the GPU?
 
After a day, I have switched back to my newer, faster, much inferior Nvidia card. If I don't see similar problems elsewhere, I might submit a PR.
 
Same here Freebsd 14 Navi 21 Radeon RX 6800 after update only colors and patterns when starting x11, wrong colors in the shell (with bpytop).
Went back to 22.* and everything is ok.
I also think about submitting a PR, but i have to update again and make the Desktop unusable, to get the details of the failure.
Maybe on the WE
 
Just tried
Upgrade of mesa-libs-22.3.7_2 to mesa-libs-23.1.9
Upgrade of libosmesa-22.3.7 to libosmesa-23.1.9
Upgrade of mesa-dri-22.3.7_3 to mesa-dri-23.1.9_1
Upgrade of mesa-gallium-va-22.3.7 to mesa-gallium-va-23.1.9_1
Upgrade of mesa-gallium-xa-22.3.7 to mesa-gallium-xa-23.1.9
with running xfce4
then started ungoogled-chromium as a test, and
amdgpu: os_same_file_description couldn't determine if two DRM fds reference the same file description.
If they do, bad things may happen!
ac_rtld error: !data || data->d_size != shdr->sh_size
LLVM failed to upload shader
ac_rtld error: !data || data->d_size != shdr->sh_size
LLVM failed to upload shader
ac_rtld error: !data || data->d_size != shdr->sh_size
LLVM failed to upload shader
ac_rtld error: !data || data->d_size != shdr->sh_size
LLVM failed to upload shader
ac_rtld error: !data || data->d_size != shdr->sh_size
LLVM failed to upload shader
ac_rtld error: !data || data->d_size != shdr->sh_size
LLVM failed to upload shader
ac_rtld error: !data || data->d_size != shdr->sh_size
LLVM failed to upload shader
ac_rtld error: !data || data->d_size != shdr->sh_size
LLVM failed to upload shader
ac_rtld error: !data || data->d_size != shdr->sh_size
LLVM failed to upload shader
ac_rtld error: !data || data->d_size != shdr->sh_size
LLVM failed to upload shader
EE ../src/gallium/drivers/radeonsi/si_state_shaders.cpp:2505 si_build_shader_variant - Failed to build shader variant (type=0)
ac_rtld error: !data || data->d_size != shdr->sh_size
LLVM failed to upload shader
ac_rtld error: !data || data->d_size != shdr->sh_size
LLVM failed to upload shader
EE ../src/gallium/drivers/radeonsi/si_state_shaders.cpp:2505 si_build_shader_variant - Failed to build shader variant (type=0)
ac_rtld error: !data || data->d_size != shdr->sh_size
LLVM failed to upload shader
EE ../src/gallium/drivers/radeonsi/si_state_shaders.cpp:2505 si_build_shader_variant - Failed to build shader variant (type=0)
ac_rtld error: !data || data->d_size != shdr->sh_size
LLVM failed to upload shader
ac_rtld error: !data || data->d_size != shdr->sh_size
LLVM failed to upload shader
ac_rtld error: !data || data->d_size != shdr->sh_size
LLVM failed to upload shader
EE ../src/gallium/drivers/radeonsi/si_state_shaders.cpp:2505 si_build_shader_variant - Failed to build shader variant (type=0)
ac_rtld error: !data || data->d_size != shdr->sh_size
LLVM failed to upload shader
EE ../src/gallium/drivers/radeonsi/si_state_shaders.cpp:2505 si_build_shader_variant - Failed to build shader variant (type=0)
ac_rtld error: !data || data->d_size != shdr->sh_size
LLVM failed to upload shader
EE ../src/gallium/drivers/radeonsi/si_state_shaders.cpp:2505 si_build_shader_variant - Failed to build shader variant (type=0)
ac_rtld error: !data || data->d_size != shdr->sh_size
LLVM failed to upload shader
EE ../src/gallium/drivers/radeonsi/si_state_shaders.cpp:2505 si_build_shader_variant - Failed to build shader variant (type=0)
ac_rtld error: !data || data->d_size != shdr->sh_size
LLVM failed to upload shader
EE ../src/gallium/drivers/radeonsi/si_state_shaders.cpp:2505 si_build_shader_variant - Failed to build shader variant (type=0)
ac_rtld error: !data || data->d_size != shdr->sh_size
LLVM failed to upload shader
EE ../src/gallium/drivers/radeonsi/si_state_shaders.cpp:2505 si_build_shader_variant - Failed to build shader variant (type=0)
ac_rtld error: !data || data->d_size != shdr->sh_size
LLVM failed to upload shader
EE ../src/gallium/drivers/radeonsi/si_state_shaders.cpp:2505 si_build_shader_variant - Failed to build shader variant (type=0)

Window is window is only
colors and patterns
restored old mesa version and after

amdgpu: os_same_file_description couldn't determine if two DRM fds reference the same file description.
If they do, bad things may happen!
it starts and everything is working.
By the way, i'm only able to load the amd drivers if i build and install gpu-firmware-amd-kmod with FLAVOR=sienna_cichlid - otherwise i got a black screen when loading firmware.
 
The only difference is on my setup that i do use x11-drivers/xf86-video-amdgpu

To tell Xorg to use xf86-video-amdgpu create /usr/local/etc/X11/xorg.conf.d/amdgpu.conf with:

Code:
Section "Device"

Identifier "Card0"

Driver "amdgpu"

EndSection

I even have played yesterday some games etc... still no problems.
 
Same problem here, same messages. What I did to get it working again:

Code:
# pkg remove mesa-dri-23.1.8_1 mesa-libs-23.1.8
Updating database digests format: 100%
Checking integrity... done (0 conflicting)
Deinstallation has been requested for the following 13 packages (of 0 packages in the universe):

Installed packages to be REMOVED:
        mesa-dri: 23.1.8_1
        mesa-libs: 23.1.8
        sdl2: 2.28.5
        xf86-input-keyboard: 1.9.0_5
        xf86-input-libinput: 1.3.0
        xf86-input-mouse: 1.9.3_4
        xf86-video-amdgpu: 22.0.0_1
        xf86-video-ati: 19.1.0_6,1
        xf86-video-scfb: 0.0.7_1
        xf86-video-vesa: 2.5.0_2
        xorg: 7.7_3
        xorg-drivers: 7.7_7
        xorg-server: 21.1.9,1

Number of packages to be removed: 13
[...]

# pkg install xorg

This might not be the perfect solution, but I got my X running again without a glitched matrix screen.
The one thing that was left for me to clean up was firefox starting with a blank profile (because I killed the X server a hundred times with Ctrl-Alt-Backspace, killing firefox in the process. Apparently this confuses firefox to the point of dementia).
 
Same happens to me, on my radeon machine

66.956] (II) AMDGPU(0): glamor X acceleration enabled on AMD Radeon RX 550 / 550 Series (polaris12, LLVM 16.0.6, DRM 3.40, 13.2-RELEASE-p2)


Works fine until I upgrade mesa:

Installed packages to be UPGRADED:
mesa-dri: 22.3.7_3 -> 23.1.8_1 [pkgd]
mesa-libs: 22.3.7_2 -> 23.1.8 [pkgd]

After the upgrade the graphics is messed up and I get the new log messages

ac_rtld error: !data || data->d_size != shdr->sh_size
LLVM failed to upload shader

I have an older machine that used an onboard intel card, it has no issues.

Has someone filed a PR?
 
Back
Top