streamlink / streamlink-twitch-gui

A multi platform Twitch.tv browser for Streamlink
https://streamlink.github.io/streamlink-twitch-gui/
MIT License
2.7k stars 204 forks source link

Skia shader compilation error on Arch Linux after upgrading llvm-libs 17.0.6-4 -> 17.0.6-5 #1017

Open bastimeyer opened 6 months ago

bastimeyer commented 6 months ago

Edit: In order to fix the issue, please remove the Default/GPUCache directory inside the application's config directory:

rm -r "${XDG_CONFIG_HOME:-~/.config}"/streamlink-twitch-gui/Default/GPUCache

And another breaking issue with llvm-libs... :angry:

1004 started the recent mess with llvm-libs 17.0.6-4 (on Arch) while STG v2.4.1 was running on NW.js 0.78.1 (Chromium 115).

Now llvm-libs 17.0.6-5 causes shader compilation errors once again after NW.js got bumped to 0.83.0 (Chromium 120) in v2.5.2.


[9469:9469:0521/232751.993229:ERROR:shared_context_state.cc(100)] Skia shader compilation error
------------------------
// Vertex SKSL
#extension GL_NV_shader_noperspective_interpolation: require
uniform float4 sk_RTAdjust;in float2 position;in half4 color;flat out half4 vcolor_S0;void main() {// Primitive Processor QuadPerEdgeAAGeometryProcessor
vcolor_S0 = color;sk_Position = position.xy01;}
// Fragment SKSL
#extension GL_NV_shader_noperspective_interpolation: require
flat in half4 vcolor_S0;void main() {// Stage 0, QuadPerEdgeAAGeometryProcessor
half4 outputColor_S0;outputColor_S0 = vcolor_S0;const half4 outputCoverage_S0 = half4(1);{ // Xfer Processor: Porter Duff
sk_FragColor = outputColor_S0 * outputCoverage_S0;}}
// Vertex GLSL
#version 300 es

#extension GL_NV_shader_noperspective_interpolation : require
precision mediump float;
precision mediump sampler2D;
uniform highp vec4 sk_RTAdjust;
in highp vec2 position;
in mediump vec4 color;
flat out mediump vec4 vcolor_S0;
void main() {
    vcolor_S0 = color;
    gl_Position = vec4(position, 0.0, 1.0);
    gl_Position = vec4(gl_Position.xy * sk_RTAdjust.xz + gl_Position.ww * sk_RTAdjust.yw, 0.0, gl_Position.w);
}

// Fragment GLSL
#version 300 es

#extension GL_NV_shader_noperspective_interpolation : require
precision mediump float;
precision mediump sampler2D;
out mediump vec4 sk_FragColor;
flat in mediump vec4 vcolor_S0;
void main() {
    mediump vec4 outputColor_S0 = vcolor_S0;
    {
        sk_FragColor = outputColor_S0;
    }
}

Errors:
Location of variable sk_FragColor conflicts with another variable.
bastimeyer commented 6 months ago

Bumping NW.js to 0.84 seems to work from a quick test so far.

diff --git a/build/tasks/configs/nwjs.js b/build/tasks/configs/nwjs.js
index 4fedaa73..4d41de6d 100644
--- a/build/tasks/configs/nwjs.js
+++ b/build/tasks/configs/nwjs.js
@@ -60,7 +60,7 @@ module.exports = {
    linux32: {
        options: {
            platforms: [ "linux32" ],
-           version: "0.83.0",
+           version: "0.84.0",
            files: [
                ...files,
                ignoreBinWin32,
@@ -71,7 +71,7 @@ module.exports = {
    linux64: {
        options: {
            platforms: [ "linux64" ],
-           version: "0.83.0",
+           version: "0.84.0",
            files: [
                ...files,
                ignoreBinWin32,

I can't set NW.js to 0.84 on Windows though, because of other issues mentioned in #1015, which is why the version was set to 0.83 on all platforms in v2.5.2. Any version higher than 0.85 also causes issues on Linux systems with Intel or Nvidia GPUs. This is a dead end right now and 0.84 might be the last chance.

Before I'm continuing here with bumping NW.js and releasing a new version once again, I will have a look at the upstream changes and post a bug report.

bastimeyer commented 6 months ago

Hm...

https://gitlab.archlinux.org/archlinux/packaging/packages/llvm/-/commit/31fedbbb507eb5be41cf1e6f405153b6bc370df7

From 31fedbbb507eb5be41cf1e6f405153b6bc370df7 Mon Sep 17 00:00:00 2001
From: Evangelos Foutras <foutrelis@archlinux.org>
Date: Tue, 21 May 2024 21:42:51 +0300
Subject: [PATCH] upgpkg: 17.0.6-5: remove zstd CMake find module

It reportedly breaks if it gets out of sync with upstream zstd.
---
 .SRCINFO | 2 +-
 PKGBUILD | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/.SRCINFO b/.SRCINFO
index 8d77a61..a1bcefb 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
 pkgbase = llvm
    pkgver = 17.0.6
-   pkgrel = 4
+   pkgrel = 5
    url = https://llvm.org/
    arch = x86_64
    license = custom:Apache 2.0 with LLVM Exception
diff --git a/PKGBUILD b/PKGBUILD
index 61d87bb..a3c7e89 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -3,7 +3,7 @@

 pkgname=('llvm' 'llvm-libs')
 pkgver=17.0.6
-pkgrel=4
+pkgrel=5
 arch=('x86_64')
 url="https://llvm.org/"
 license=('custom:Apache 2.0 with LLVM Exception')
@@ -59,6 +59,9 @@ prepare() {
   rename -v -- "-$pkgver.src" '' {cmake,third-party}-$pkgver.src
   cd llvm-$pkgver.src
   mkdir build
+
+  # Remove CMake find module for zstd; breaks if out of sync with upstream zstd
+  rm cmake/modules/Findzstd.cmake
 }

 build() {
-- 
GitLab
bastimeyer commented 6 months ago

I've updated the OP and deleted my previous comment.

bastimeyer commented 6 months ago

So what I believe is happening here is that this simple pkgrel bump in Arch's repos (no bump of the actual llvm version) is causing shader cache integrity issues on the side of NW.js / Chromium, which then causes the errors. I don't have any experience in this regard though, so this could of course be nonsense. A change of the used NW.js version then triggers a rebuild of the shaders, so the old cache gets ignored. This also further means that the actual NW.js version is irrelevant.

I will accept the solution which I've added to the OP for now without bumping NW.js and releasing yet another version. Please delete the old shader cache if you're running into this issue.

ChrisLauinger77 commented 2 months ago

I just got updates

2024-09-15 08:21:29 status installed libqt6multimediawidgets6:amd64 6.6.2-4+b1
2024-09-15 08:21:30 status installed firmware-sof-signed:all 2024.06-1
2024-09-15 08:21:30 status installed libmanette-0.2-0:amd64 0.2.9-1
2024-09-15 08:21:30 status installed power-profiles-daemon:amd64 0.23-1
2024-09-15 08:21:30 status installed libqt6spatialaudio6:amd64 6.6.2-4+b1
2024-09-15 08:21:30 status installed libldacbt-enc2:amd64 2.0.2.3+git20200429+ed310a0-5
2024-09-15 08:21:30 status installed python3-tk:amd64 3.12.6-1
2024-09-15 08:21:30 status installed libvo-aacenc0:amd64 0.1.3-3
2024-09-15 08:21:30 status installed python3-pyqt6.qtmultimedia:amd64 6.7.1-1
2024-09-15 08:21:30 status installed openjdk-17-jre-headless:amd64 17.0.13~6ea-1
2024-09-15 08:21:30 status installed libldacbt-abr2:amd64 2.0.2.3+git20200429+ed310a0-5
2024-09-15 08:21:30 status installed calibre-bin:amd64 7.18.0+ds-1
2024-09-15 08:21:30 status installed mawk:amd64 1.3.4.20240905-1
2024-09-15 08:21:31 status installed libfuse2t64:amd64 2.9.9-9
2024-09-15 08:21:31 status installed libllvm18:amd64 1:18.1.8-11
2024-09-15 08:21:31 status installed libllvm18:i386 1:18.1.8-11
2024-09-15 08:21:33 status installed calibre:all 7.18.0+ds-1
2024-09-15 08:21:34 status installed libc-bin:amd64 2.40-2
2024-09-15 08:21:36 status installed man-db:amd64 2.13.0-1
2024-09-15 08:21:36 status installed libglib2.0-0t64:i386 2.82.0-1
2024-09-15 08:21:36 status installed evolution-common:all 3.53.3-1
2024-09-15 08:21:36 status installed libglib2.0-0t64:amd64 2.82.0-1
2024-09-15 08:21:36 status installed dbus:amd64 1.14.10-4+b1
2024-09-15 08:21:41 status installed shared-mime-info:amd64 2.4-5
2024-09-15 08:21:41 status installed mailcap:all 3.72
2024-09-15 08:21:41 status installed desktop-file-utils:amd64 0.27-2
2024-09-15 08:21:41 status installed hicolor-icon-theme:all 0.18-1
2024-09-15 08:21:41 status installed libevolution:amd64 3.53.3-1
2024-09-15 08:21:41 status installed gnome-menus:amd64 3.36.0-1.1+b2
2024-09-15 08:21:41 status installed evolution:amd64 3.53.3-1
2024-09-15 08:21:41 status installed evolution-plugins:amd64 3.53.3-1
2024-09-15 08:21:41 status installed evolution-plugin-bogofilter:amd64 3.53.3-1
2024-09-15 08:21:41 status installed evolution-plugin-pstimport:amd64 3.53.3-1
2024-09-15 08:21:41 status installed openjdk-17-jre-headless:amd64 17.0.13~6ea-1
2024-09-15 08:21:42 status installed ca-certificates-java:all 20240118
2024-09-15 08:21:42 status installed openjdk-17-jre:amd64 17.0.13~6ea-1

in debian trixie (testing) - it only starts with an empty black window (yesterday it worked fine):

Errors:
Location of variable sk_FragColor conflicts with another variable.

[27071:27071:0915/093023.024281:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 2 times!
[27075:27081:0915/093031.944174:ERROR:cert_verify_proc_builtin.cc(625)] No net_fetcher for performing AIA chasing.
ChrisLauinger77 commented 2 months ago

I deleted the GPUCache in .config folder - but in multiple places. In Default was one and in some other places. Getting rid of all of them made it work again :) grafik