Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Element desktop starts with blank screen #1074

Closed
dunnock opened this issue Jul 11, 2023 · 13 comments · Fixed by #1332
Closed

Element desktop starts with blank screen #1074

dunnock opened this issue Jul 11, 2023 · 13 comments · Fixed by #1332

Comments

@dunnock
Copy link

dunnock commented Jul 11, 2023

Steps to reproduce

  1. Started happening after I clicked on one communication, now it's always white after I start element
  2. It seems the buttons are in their places, they are just all white, as there is some reaction on rollover

Outcome

What did you expect?

Expected regular element desktop screen to recover after restart

What happened instead?

I see only white screen.

If I start element from console in the log I see lots of messages like this:

/home/xxx/.config/Element exists: yes
/home/xxx/.config/Riot exists: no
Starting auto update with base URL: https://packages.element.io/desktop/update/
Auto update not supported on this platform
Fetching translation json for locale: en_EN
Changing application language to en-us
Fetching translation json for locale: en-us
Resetting the UI components after locale change
Resetting the UI components after locale change
Changing application language to en-us
Fetching translation json for locale: en-us
Resetting the UI components after locale change

[12851:0711/194234.993144:ERROR:shared_context_state.cc(81)] Skia shader compilation error
------------------------
// Vertex SKSL
#extension GL_NV_shader_noperspective_interpolation: require
uniform float4 sk_RTAdjust;uniform float3x3 umatrix_S1_c0;in float2 position;in half4 color;in float2 localCoord;flat out half4 vcolor_S0;noperspective out float2 vTransformedCoords_3_S0;void main() {// Primitive Processor QuadPerEdgeAAGeometryProcessor
vcolor_S0 = color;sk_Position = position.xy01;{
vTransformedCoords_3_S0 = float3x2(umatrix_S1_c0) * localCoord.xy1;
}
}
// Fragment SKSL
#extension GL_NV_shader_noperspective_interpolation: require
uniform float3x3 umatrix_S1_c0;uniform sampler2D uTextureSampler_0_S1;
flat in half4 vcolor_S0;noperspective in float2 vTransformedCoords_3_S0;half4 TextureEffect_S1_c0_c0(half4 _input) {
return sample(uTextureSampler_0_S1, vTransformedCoords_3_S0);}

half4 MatrixEffect_S1_c0(half4 _input) {
return TextureEffect_S1_c0_c0(_input);
}

half4 DisableCoverageAsAlpha_S1(half4 _input) {
_input = MatrixEffect_S1_c0(_input);
half4 _tmp_0_inColor = _input;
return half4(_input);
}

void main() {// Stage 0, QuadPerEdgeAAGeometryProcessor
half4 outputColor_S0;outputColor_S0 = vcolor_S0;const half4 outputCoverage_S0 = half4(1);half4 output_S1;output_S1 = DisableCoverageAsAlpha_S1(outputColor_S0);{ // Xfer Processor: Porter Duff
sk_FragColor = output_S1 * 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;
uniform highp mat3 umatrix_S1_c0;
in highp vec2 position;
in mediump vec4 color;
in highp vec2 localCoord;
flat out mediump vec4 vcolor_S0;
noperspective out highp vec2 vTransformedCoords_3_S0;
void main() {
    vcolor_S0 = color;
    gl_Position = vec4(position, 0.0, 1.0);
    {
        vTransformedCoords_3_S0 = mat3x2(umatrix_S1_c0) * vec3(localCoord, 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;
uniform highp mat3 umatrix_S1_c0;
uniform sampler2D uTextureSampler_0_S1;
flat in mediump vec4 vcolor_S0;
noperspective in highp vec2 vTransformedCoords_3_S0;
void main() {
    mediump vec4 outputColor_S0;
    outputColor_S0 = vcolor_S0;
    mediump vec4 output_S1;
    mediump vec4 _0_input = outputColor_S0;
    _0_input = texture(uTextureSampler_0_S1, vTransformedCoords_3_S0, -0.5);
    output_S1 = _0_input;
    {
        sk_FragColor = output_S1;
    }
}


Errors:
link failed but did not provide an info log
[10776:0711/193132.630666:ERROR:shared_context_state.cc(81)] Skia shader compilation error
------------------------
// Vertex SKSL
#extension GL_NV_shader_noperspective_interpolation: require
uniform float4 sk_RTAdjust;in float2 position;in float2 localCoord;noperspective out float2 vlocalCoord_S0;void main() {// Primitive Processor QuadPerEdgeAAGeometryProcessor
vlocalCoord_S0 = localCoord;sk_Position = position.xy01;}
// Fragment SKSL
#extension GL_NV_shader_noperspective_interpolation: require
uniform sampler2D uTextureSampler_0_S0;
noperspective in float2 vlocalCoord_S0;void main() {// Stage 0, QuadPerEdgeAAGeometryProcessor
half4 outputColor_S0 = half4(1);float2 texCoord;texCoord = vlocalCoord_S0;outputColor_S0 = (blend_modulate(sample(uTextureSampler_0_S0, texCoord), half4(1)));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 highp vec2 localCoord;
noperspective out highp vec2 vlocalCoord_S0;
void main() {
    vlocalCoord_S0 = localCoord;
    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;
uniform sampler2D uTextureSampler_0_S0;
noperspective in highp vec2 vlocalCoord_S0;
void main() {
    mediump vec4 outputColor_S0 = vec4(1.0);
    highp vec2 texCoord;
    texCoord = vlocalCoord_S0;
    outputColor_S0 = texture(uTextureSampler_0_S0, texCoord, -0.5);
    {
        sk_FragColor = outputColor_S0;
    }
}

When I try to get logs via /rangeshake command it does not work either

Operating system

Ubuntu 22.04 / 5.19.0-46-generic #47~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Jun 21 15:35:31 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

Application version

1.11.35

How did you install the app?

following guide on element insallation page via apt-get

Homeserver

matrix.org

Will you send logs?

No

@spacemanspiff2007
Copy link

Same on Linux Mint 21.1 Cinnamon

@townsend2010
Copy link

I had the same exact symptom as described in this issue and saw #1029 (comment) which also fixed it for me. I would say this issue here is the same as #1029.

@Skunkietronic
Copy link

Same issue here on Manjaro. I've been fixing it slightly different.

  1. Run element-desktop from terminal with the mesa shader cache disabled.
MESA_SHADER_CACHE_DISABLE=true element-desktop
  1. Sign out of the session
  2. Launch element-desktop as normal and sign back in.

This seems to happen whenever mesa 23.1.3 gets rebuild and pushed to the repos in Manjaro.

@bbhtt
Copy link

bbhtt commented Jul 12, 2023

Chromium upstream is probably working on a fix https://bugs.chromium.org/p/chromium/issues/detail?id=1442633

Meanwhile, deleting the GPUCache folder inside ${XDG_CONFIG_HOME}/Element/ after a mesa upgrade should be enough to make it start normally.

The issue as I understand:

Whenever mesa updates from one version to another (major/minor/release/patch), it can introduce internal code changes that make the Chromium/Electron's existing GL shader cache incompatible with newer mesa.

Chromium calculates a shaderprefixkey from the GPU driver info to check whether it needs regenerating (ie. if the driver mesa changed versions) https://source.chromium.org/chromium/chromium/src/+/refs/heads/main:components/viz/host/gpu_host_impl.cc;l=415;drc=4a0c2a8e5a4de735817463162218bbf84aa2bd74

But sometimes even minor patch level changes can have breaking changes that might cause the shaderprefixkey to remain the same but the actual cache to become incompatible.

Thus chromium won't regenerate the cache and show the above error due to the incompatibility.

@dunnock
Copy link
Author

dunnock commented Jul 12, 2023

Thank you, that helped. I did not have XDG_CONFIG_HOME env var, but located that cache on Ubuntu under ~/.cache/Element/GPUCache

@t3chguy t3chguy changed the title Element desktop starts with white screen, Element desktop starts with blank screen Jul 14, 2023
@pschonmann
Copy link

Thank you, that helped. I did not have XDG_CONFIG_HOME env var, but located that cache on Ubuntu under ~/.cache/Element/GPUCache

In some cases when somebody installed Element before renaming, can see files in

~/.config/Riot/GPUCache

@Taranchul
Copy link

Taranchul commented Jul 22, 2023

Meanwhile, deleting the GPUCache folder inside ${XDG_CONFIG_HOME}/Element/ after a mesa upgrade should be enough to make it start normally.

Thanks! That fixed it for me. 😀 I hope that it's okay that I spread the word around a bit in similar issues.

joebonrichie pushed a commit to solus-packages/element that referenced this issue Aug 14, 2023
Release notes for Element v1.11.36 can be found [here](https://github.com/vector-im/element-desktop/releases/tag/v1.11.36).
Includes a security fix for CVE-2023-37259. More details can be found [here](GHSA-c9vx-2g7w-rp65).

The Mesa shader cache is disabled as workaround for Element starting with a blank screen.
More details about this issue can be found [here](element-hq/element-desktop#1074).
@michel-zimmer
Copy link

This issue has reached my NixOS installation, now.

The workaround from above worked for me, too. I didn't even have to sing out and back in again. I just had to launch it once with the mesa cache disable like so: MESA_SHADER_CACHE_DISABLE=true element-desktop.

@skorpy2009
Copy link

I have to open it every time with MESA_SHADER_CACHE_DISABLE=true element-desktop nothing with "once" on my NixOS

@Taranchul
Copy link

The prefix MESA_SHADER… only sets this value for the single invocation of the command behind it, so it's not surprising that you have to use it every time.

You could try to delete the contents of GPUCache inside ${XDG_CONFIG_HOME}/Element/ like @bbhtt suggested before. This works for me for some time at least until the next Element update.

@haslersn
Copy link

located that cache on Ubuntu under ~/.cache/Element/GPUCache

For me on NixOS it was ~/.config/Element/GPUCache

@orangecms
Copy link

orangecms commented Nov 1, 2023

And for Flatpak, because they put things in different directories, I did:

cd $HOME/.var/app/im.riot.Riot && rm -rf cache/* && rm -rf config/Element/GPUCache

or for short in one shot for shells supporting it...

rm -rf $HOME/.var/app/im.riot.Riot/{cache/*,config/Element/GPUCache}

@t3chguy
Copy link
Member

t3chguy commented Nov 15, 2023

Upstream fix electron/electron#40467

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.