NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
18.05k stars 14.09k forks source link

Electron apps don't launch: Cannot find target for triple amdgcn #340196

Open mobergmann opened 2 months ago

mobergmann commented 2 months ago

Describe the bug

When launching (unstable) anytype (from terminal or gnome) the GUI is not appearing/ no window is spawned. I updated my system and the next day it stopped working. It seems as some (probably the usual) background processes are started. When running the anytype AppImage, from their website, with appimage-run, the problem does not occure. I have an AMD GPU, if that is important. I also removed the ~/.config/anytype/ directory to reduce the likely hood of an configuration error.

Steps To Reproduce

I am not sure, but the steps to reproduce the behavior on my system are:

  1. get unstable anytype
  2. launch anytype

Expected behavior

A GUI/Window appearing.

Screenshots

~ anytype
[ConfigManager].init: { channel: 'latest', theme: 'system' }
[Server] start /nix/store/7p228scg0h2bs6d8b1w6m6287w099krl-anytype-0.42.5-extracted/resources/app.asar.unpacked/dist/anytypeHelper /home/mobergmann/.config/anytype
mw grpc: build on 2024-08-28 17:25:05 +0000 UTC at #3647351f8c8586b053944c998243cc2e15122d22

gRPC server started at: 127.0.0.1:34861
gRPC Web proxy started at: 127.0.0.1:38831

ac: Unknown GPU, using 0 for raster_config
Cannot find target for triple amdgcn-- Unable to find target for this triple (no targets are registered)
[UpdateManager].init, channel:  latest
[InstallNativeMessaging] Manifest skipped: Chrome
[InstallNativeMessaging] Manifest skipped: Chromium
[InstallNativeMessaging] Manifest written: /home/mobergmann/.config/BraveSoftware/Brave-Browser/NativeMessagingHosts/com.anytype.desktop.json
[InstallNativeMessaging] Manifest skipped: BraveFlatpak
[63352:0906/224845.775714:ERROR:browser_main_loop.cc(278)] Gtk: gtk_widget_add_accelerator: assertion 'GTK_IS_ACCEL_GROUP (accel_group)' failed
[63352:0906/224845.993075:ERROR:gpu_process_host.cc(1002)] GPU process exited unexpectedly: exit_code=139
ac: Unknown GPU, using 0 for raster_config
Cannot find target for triple amdgcn-- Unable to find target for this triple (no targets are registered)
[63352:0906/224846.335839:ERROR:gpu_process_host.cc(1002)] GPU process exited unexpectedly: exit_code=139
ac: Unknown GPU, using 0 for raster_config
Cannot find target for triple amdgcn-- Unable to find target for this triple (no targets are registered)
[63352:0906/224846.677835:ERROR:gpu_process_host.cc(1002)] GPU process exited unexpectedly: exit_code=139

Additional context

None

Notify maintainers

@running-grass

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

[user@system:~]$ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.6.48, NixOS, 24.05 (Uakari), 24.05.4639.6f6c45b5134a`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.5`
 - channels(root): `"home-manager-24.05.tar.gz, home-manager-unstable, nixos-24.05, nixos-unstable"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Add a :+1: reaction to issues you find important.

chaosbiber commented 1 month ago

I get the same problem with some electron-based apps from nixos-unstable and rarely find hints to similar problems (like this).

I have encountered the same problem with: morgen, obsidian and todoist-electron about a week ago. Switched back to stable for them and they keep working.

In common or maybe relevant:

Common error message:

ac: Unknown GPU, using 0 for raster_config
Cannot find target for triple amdgcn-- Unable to find target for this triple (no targets are registered)

Followed by (depending on your shell)

zsh: segmentation fault (core dumped)

I'm not sure where to report this cause I'm not sure if it's related to an upstream electron issue (chrome had related issues recently) or one of the circumstances, or all of them and I am waiting for an electron update in unstable to see if it is fixed by then.

Edit: might be gpu- and libva-related. Github issue search finds chrome, signal, visual studio code startup-, and jellyfin encoding issues. But not a lot.

49RpK5dY commented 1 month ago

Same problem with mpv.

ac: Unknown GPU, using 0 for raster_config
Cannot find target for triple amdgcn-- Unable to find target for this triple (no targets are registered)
zsh: segmentation fault (core dumped)

The system is 24.05 stable 44a71ff39c182edaf25a7ace5c9454e7cba2c658 but mpv is from unstable. AMD GPU RX 5700. When locking unstable packages at 71e91c409d1e654808b2621f28a327acfdad8dc2 works but any update to unstable brakes mpv.

ic4-y commented 1 month ago

Same here with Brave version 1.69.162 from unstable

❯ brave
ac: Unknown GPU, using 0 for raster_config
Cannot find target for triple amdgcn-- Unable to find target for this triple (no targets are registered)
[0914/092126.405725:ERROR:process_memory_range.cc(75)] read out of range
...

Edit: According to this post over at Signal Desktop https://github.com/signalapp/Signal-Desktop/issues/6855#issuecomment-2118305464

Someone fixed the error by removing old Mesa drivers. Mentioned here:

https://dev1galaxy.org/viewtopic.php?pid=46495#p46495

I wonder if there is something similar going on for us :thinking:

Edit2: There is also this post on a Debian bug tracker, which seems to confirm the direction this being an issue with Mesa

https://lists.debian.org/debian-x/2024/05/msg00010.html

Assuming all this is the same issue of course.

shymega commented 1 month ago

I see my issue was mentioned. This happens to me with dwl and 1Password's GUI. If I switch the 1Password package to nixpkgs-unstable's _1password-gui-beta package, it works.

But it's a bit annoying I have this happen randomly.

heraldofsolace commented 1 month ago

Having the same issue with cage:

ac: Unknown GPU, using 0 for raster_config
Cannot find target for triple amdgcn-- Unable to find target for this triple (no targets are registered)

Followed by a seg fault

Plamper commented 1 month ago

Does also happen with onlyoffice desktopeditors


QApplication: invalid style override passed, ignoring it.

(DesktopEditors:445938): Gtk-WARNING **: 11:54:52.356: gtk_disable_setlocale() must be called before gtk_init()
ac: Unknown GPU, using 0 for raster_config
Cannot find target for triple amdgcn-- Unable to find target for this triple (no targets are registered)
ac: Unknown GPU, using 0 for raster_config
Cannot find target for triple amdgcn-- Unable to find target for this triple (no targets are registered)```
shymega commented 1 month ago

This theory may be of interest to those experiencing this bug.

edhemphill commented 1 month ago

Following the link above and then to another forum, I found that this works for me:

LIBVA_DRIVER_NAME="vdpau" code For instance.

Would love an explanation of what this env var does in comparison to above thread.

Interestingly, latest chromium build worked fine in Ubuntu 24.04 for instance (w/ amdgpu) but Chrome official Google release did not. VS Code broken. Basically any electron junk broken and I guess anything using Blink ?

But Slack worked - which is also electron. Maybe they disable GPU acceleration in their build?

spikebike commented 1 week ago

I can confirm the LIBVA_DRIVER_NAME="vdpau" fixed this for google-chrome and signal-desktop for me. For me this problem was caused on an ubuntu 24.04 system with a 7800XT. All was fine until I installed AMD's ROCm.