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

Mesa broke rendering in Chromium/Chrome/Electron #244742

Open
RaitoBezarius opened this issue Jul 22, 2023 · 21 comments
Open

Mesa broke rendering in Chromium/Chrome/Electron #244742

RaitoBezarius opened this issue Jul 22, 2023 · 21 comments

Comments

@RaitoBezarius
Copy link
Member

RaitoBezarius commented Jul 22, 2023

Heads-up, Nixpkgs unstable and 23.05 got itself into a https://bugzilla.redhat.com/show_bug.cgi?id=2193335 situation.

Therefore, you may experience garbled fonts in your program, to solve this, you can follow the instructions in https://discussion.fedoraproject.org/t/chromium-based-browsers-display-garbled-web-pages-after-mesa-is-updated/83438 option A) or option B).

Option C) is also possible, though, I do not advise it as Flatpak bypasses classical Nix semantics.

@lorenz
Copy link
Contributor

lorenz commented Jul 23, 2023

Yesterday I also observed this issue on 23.05 stable, so it does not seem to be exclusive to unstable.

@RaitoBezarius
Copy link
Member Author

Yesterday I also observed this issue on 23.05 stable, so it does not seem to be exclusive to unstable.

Thanks, fixed it.

@anoadragon453
Copy link
Member

Therefore, you may experience garbled fonts in your program, to solve this, you can follow the instructions in discussion.fedoraproject.org/t/chromium-based-browsers-display-garbled-web-pages-after-mesa-is-updated/83438 option A) or option B).

Option B works after restarting the program. But after a reboot I find the problem resurfaces.

@SimonBrandner
Copy link
Contributor

Yeah... #242113 seems to be a duplicate of this

(also, hey @anoadragon453 :) )

@nixos-discourse
Copy link

This issue has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/cetain-applications-stopped-rendering-properly/31751/2

@cleeyv
Copy link
Contributor

cleeyv commented Sep 18, 2023

In the past week there was a mesa issue opened for a similar bug: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9761 I would have expected something was reported there earlier but I couldn't find anything.

For a workaround, I have been using the command line flag --disable-gpu-shader-disk-cache which for both electron-based applications and chromium-based browsers has resolved the problem without completely disabling all GPU hardware acceleration as recommended elsewhere.

For element-desktop:

nixpkgs.config.packageOverrides = pkgs: {
  element-desktop = pkgs.element-desktop.overrideAttrs (old: {
    desktopItem = old.desktopItem.override (old: {
      exec = "element-desktop --disable-gpu-shader-disk-cache %u";
    });
  });
};

For brave browser:

nixpkgs.overlays = [
  (self: super: {
    brave = super.brave.override {
      commandLineArgs = "--disable-gpu-shader-disk-cache";
    };
  })
];

@SuperSandro2000
Copy link
Member

option B).

boils down to running rm -rf ~/.config/*/{Default/GPUCache,GrShaderCache,ShaderCache} and for simplicity just delete it for everything chromium based.

@SuperSandro2000
Copy link
Member

SuperSandro2000 commented Sep 27, 2023

I think Ubuntu worked around this by including the build version in some internal mesa version string. see https://bugs.launchpad.net/ubuntu/+source/mesa/+bug/2020604

I don't think that would work for us and I am mostly guessing from the thread because I couldn't find the actual code change in ***** launchpad.

Edit: confirmed by fedora https://bodhi.fedoraproject.org/updates/FEDORA-2023-84965ba750#comment-3162317
The workaround to bump the version number on rebuilds is not going to work for us.

@RaitoBezarius RaitoBezarius unpinned this issue Oct 1, 2023
@SuperSandro2000
Copy link
Member

Why was this issue unpinned? This continues to be an issue for many people (encountered it twice in the last hour on different peoples laptops) especially when staging-next gets merged.

@RaitoBezarius
Copy link
Member Author

The release cycle will soon start and @figsoda issue will have priority on that.

In the meantime, the 2 security vulns ongoing are much worse than broken rendering and we have plenty of folks who can recognize this issue by now.

The limit of pins being 3, here we are.

@SuperSandro2000
Copy link
Member

SuperSandro2000 commented Oct 3, 2023

In the meantime, the 2 security vulns ongoing are much worse than broken rendering and we have plenty of folks who can recognize this issue by now.

This isn't matching my experience. Very few people around me talked about these CVEs compared to having broken chromium based programs.

Therefore, you may experience garbled fonts in your program

I also just noticed that this isn't true for all cases. Every case I experienced myself or saw on other peoples devices, the application was completely blank and most UI elements inside the window where not rendered. So the applications where not usable at all which is a big blocker for the next stable release.

@RaitoBezarius
Copy link
Member Author

In the meantime, the 2 security vulns ongoing are much worse than broken rendering and we have plenty of folks who can recognize this issue by now.

This isn't matching my experience. Very few people around me talked about these CVEs compared to having broken chromium based programs.

Right, but, this is not how we do our prioritization, if you feel like, this is wrong, please bring evidence in the appropriate venues to discuss how we can generalize and ground our decisions based on your experience.

Therefore, you may experience garbled fonts in your program

I also just noticed that this isn't true for all cases. Every case I experienced myself or saw on other peoples devices, the application was completely blank and most UI elements inside the window where not rendered. So the applications where not usable at all which is a big blocker for the next stable release.

Are you certain this is the same bug or not another issue with Electron ongoing? I also noticed this, but this is different IME.

@RaitoBezarius RaitoBezarius pinned this issue Oct 3, 2023
@SuperSandro2000
Copy link
Member

Are you certain this is the same bug or not another issue with Electron ongoing? I also noticed this, but this is different IME.

I think this is the same issue. The fedora thread links to this thread and this bug which is very similar that it feels like the same issues I have seen. Also the mentioned workarounds like deleting the Cache directories fixed the issue everywhere.

@Xyz00777
Copy link
Contributor

i have also a problem with my system, propably connected to these, while i used 23.11 pre build channel all applications worked. after switching to 24.05 pre build channel multiple applications are not rendering normal anymore. As example Obsidian, but it didnt worked with obsidian --disable-gpu instead it worked on my system with rm -rf ~/.config/obsidian/GPUCache/ and than starting it, fixed my problam with obsidian but not with example bitwarden, because it dont have the simmilar folder like obsidian, is it connected?

@AmeerTaweel
Copy link
Contributor

Boils down to running rm -rf ~/.config/*/{Default/GPUCache,GrShaderCache,ShaderCache} and for simplicity just delete it for everything chromium based.

This worked for me on Brave Browser. However it deleted my settings 🥲. Make sure to backup/sync your settings/open tabs.

@SuperSandro2000
Copy link
Member

I am not sure how that could happen.

@PetarKirov
Copy link

It looks like the issue was finally fixed upstream in Chromium, based on this comment: https://bugs.chromium.org/p/chromium/issues/detail?id=1442633#c50. I'm not sure when the commit that fixes the issue - https://chromium.googlesource.com/chromium/src/+/3290d6aee7a53a6b1a811c8b50ff0a3bf84fb6a6%5E%21/#F1 will included in a new chromium and electron release.

@PetarKirov
Copy link

PetarKirov commented Dec 3, 2023

For those interested in the technical details, I really liked the summary made by Tom in the redhat bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2193335#c41. That said looking at the the discussion there, I'm not sure if they're aware that the bug was fixed in chromium (and whether they can QA the fix as well).

@sersorrel
Copy link
Contributor

I'm not sure when the commit that fixes the issue - https://chromium.googlesource.com/chromium/src/+/3290d6aee7a53a6b1a811c8b50ff0a3bf84fb6a6%5E%21/#F1 will included in a new chromium and electron release.

judging by https://storage.googleapis.com/chromium-find-releases-static/329.html#3290d6aee7a53a6b1a811c8b50ff0a3bf84fb6a6, it should be available in Chrome 121, scheduled for release towards the end of January 2024.

@PetarKirov
Copy link

Yeah, I think 121.0.6100.0 is the first version that includes the fix:
https://chromium.googlesource.com/chromium/src/+/refs/tags/121.0.6100.0/gpu/command_buffer/service/shared_context_state.cc#106

According to https://chromiumdash.appspot.com/releases?platform=Linux (not sure if this a canonical or at least reliable source) the dev channel already includes the fix as of Nov 6 2023 (and there are 3 new releases since then).

@raspher
Copy link
Member

raspher commented Jan 3, 2024

Similar problem reappeared with brave. I've ran brave --disable-gpu and it launched, then in brave settings disabled hardware acceleration. After that brave is launching normally (but without acceleration).

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

No branches or pull requests