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

[Tracking] AMD GPUs and NixOS - 'Cannot find target for triple amdgcn-- Unable to find target for this triple (no targets are registered)'. #343806

Closed
shymega opened this issue Sep 22, 2024 · 33 comments

Comments

@shymega
Copy link

shymega commented Sep 22, 2024

Issue description

I've been experiencing a bug with my AMD iGPU (780M), but it appears this is a bug affecting more than a few NixOS users.

For me, it affects 1Password, and dwl. I'm also having issues with Steam crashing when the web component loads. I am curious if this is related, but I am certain 1Password and dwl are affected by the amdgcn triple error.

This issue, therefore, will act as a tracking issue.

Below is a list of issues I've found with the characteristic signature error:

#343580
#340196
#339520

There has been talk of a possible Mesa bug causing this.

@shymega shymega changed the title [Trackinng] AMD GPUs and NixOS - 'Cannot find target for triple amdgcn-- Unable to find target for this triple (no targets are registered)'. [Tracking] AMD GPUs and NixOS - 'Cannot find target for triple amdgcn-- Unable to find target for this triple (no targets are registered)'. Sep 22, 2024
@Eisfunke
Copy link
Contributor

My guess this is a problem with a mismatch of the Mesa version between the one used by the system and for building the package rather than a bug in Mesa itself. This seems to fit the pattern so far as all of the issues you linked mention using an unstable package. I experience the same bug with launch unstable youtube-music, an Electron app, but the stable package is fine.

Currently mesa is at 24.0.7 on stable and at 24.2.2 on unstable. There was a minor update for mesa on unstable from 24.1 to 24.2 last month (see https://github.com/NixOS/nixpkgs/commits/nixos-unstable/pkgs/development/libraries/mesa/common.nix), so this might be what launched the recently increased amount of problem reports.

To confirm the mismatch is the problem it'd be interesting if someone tried running the affected package unmodified, but on an unstable NixOS.

My guess stems from the fact that when I had problems with Vivaldi (which is based on Chromium) not starting in the past that I was able to fix by overriding the mesa input:

(pkgs.unstable.vivaldi.override { mesa = pkgs.mesa; })

If this is the problem, I guess it isn't actually be a bug or something nixpkgs could fix. Although noting somewhere that using unstable chromium/electron on a stable NixOS is problematic and providing an easy override for the mesa input would be helpful.

@shymega
Copy link
Author

shymega commented Sep 23, 2024

Hm, that's an interesting hypothesis.

For my use with dwl, I'm currently using nixpkgs-master (so I can use dwl v0.7), but I will try overriding Mesa on that.

EDIT: I was too naive. I can't just 'override' Mesa on dwl like that.

@shymega
Copy link
Author

shymega commented Sep 23, 2024

OK, so I did try and override wlroots and pass that modified derivation to dwl. I'm still working it out, but it seems by overriding the Mesa input of wlroots, it then can't find things like libdrm or cmake.

We should likely document this behaviour with Mesa, though.

@KczBen
Copy link

KczBen commented Sep 24, 2024

I stumbled upon this issue when searching for the error message. For what it's worth, this is also happening on Debian Sid/unstable at the moment, with Mesa 24.2.3. Downgrading to Mesa 24.2.2 fixes the issue there.

@shymega
Copy link
Author

shymega commented Sep 24, 2024

Yeah, it may well be an upstream issue then. Do you have a link to a Debian Sid bug report?

We might need to work together across distros/packagers to fix this. Perhaps there's a breaking change with Mesa.

@KczBen
Copy link

KczBen commented Sep 24, 2024

I don't see a report yet for Debian, though I may just be looking in the wrong place since Mesa has lots of packages. I'll see if I can make one once I find the package that's causing the issue

@shymega
Copy link
Author

shymega commented Sep 24, 2024

My guess this is a problem with a mismatch of the Mesa version between the one used by the system and for building the package rather than a bug in Mesa itself. This seems to fit the pattern so far as all of the issues you linked mention using an unstable package. I experience the same bug with launch unstable youtube-music, an Electron app, but the stable package is fine.

Currently mesa is at 24.0.7 on stable and at 24.2.2 on unstable. There was a minor update for mesa on unstable from 24.1 to 24.2 last month (see https://github.com/NixOS/nixpkgs/commits/nixos-unstable/pkgs/development/libraries/mesa/common.nix), so this might be what launched the recently increased amount of problem reports.

To confirm the mismatch is the problem it'd be interesting if someone tried running the affected package unmodified, but on an unstable NixOS.

My guess stems from the fact that when I had problems with Vivaldi (which is based on Chromium) not starting in the past that I was able to fix by overriding the mesa input:

(pkgs.unstable.vivaldi.override { mesa = pkgs.mesa; })

If this is the problem, I guess it isn't actually be a bug or something nixpkgs could fix. Although noting somewhere that using unstable chromium/electron on a stable NixOS is problematic and providing an easy override for the mesa input would be helpful.

Hey @Eisfunke - just wanted to get your thoughts on my fix for dwl here. I was going to document it on my wiki once I get it working.

@shymega
Copy link
Author

shymega commented Sep 24, 2024

I don't see a report yet for Debian, though I may just be looking in the wrong place since Mesa has lots of packages. I'll see if I can make one once I find the package that's causing the issue

No rush, if you're able to get anywhere, let us know! Thanks.

@KczBen
Copy link

KczBen commented Sep 26, 2024

I updated my Debian machine to Mesa 24.2.3 again, and rather annoyingly everything just works now. There was no Mesa nor LLVM version change in Debian, so I can't really blame any package for causing this. I wonder if it's something cache related? There were issues before with Chromium/Electron applications having broken rendering after a Mesa update, and wiping the application's shader cache resolved those.

@shymega
Copy link
Author

shymega commented Sep 26, 2024

Yeah, that could be why. However, I can't see a dwl cache in $XDG_CACHE_HOME.

@KczBen
Copy link

KczBen commented Sep 26, 2024

I don't know where dwl puts its cache, so I can't help with that sadly. But for Electron apps, they put their shader cache in ~/.config/<app_name>/GPUCache, because... Electron. That's just how they do things.

@AgentElement
Copy link

I could not reproduce this with dwl, but mpv and prusa-slicer also have this issue.

@NyCodeGHG
Copy link
Member

I got this error while trying to package an app with electron_31, while my system is on 24.05

@shymega
Copy link
Author

shymega commented Sep 26, 2024

I could not reproduce this with dwl, but mpv and prusa-slicer also have this issue.

Are you using dwl v0.7? That's the issue I'm having. My repo is currently private, whilst I try and prepare for a work laptop.

@shymega
Copy link
Author

shymega commented Sep 27, 2024

I've just made the repo public again.

@AgentElement I meant to tag you in my previous message - the repo is here.

Thanks.

@jalseth
Copy link

jalseth commented Sep 29, 2024

+1, unable to use mpv with 780M amdgpu on nixos-stable @ fbca5e7.

@quinnvoker
Copy link

I run into the same error trying to run the cinny-desktop package from unstable on a system on the 24.05 branch.

@shymega
Copy link
Author

shymega commented Sep 30, 2024

I think, ultimately, the issue comes down to mixing packages from unstable (with a newer version of Mesa), with stable.

One solution would be to override the unstable package's mesa input with stable's mesa package, as previously described in this thread.

@workflow
Copy link
Contributor

Same for unstable.brave to make it searchable, syncing the mesa versions worked!

ede1998 added a commit to ede1998/nix-config that referenced this issue Oct 25, 2024
@ebr
Copy link

ebr commented Oct 27, 2024

The fix suggested in signalapp/Signal-Desktop#6855 worked for me on Framework16, which has an integrated AMD Phoenix1 GPU.

export LIBVA_DRIVER_NAME="vdpau"

downgrading or uninstalling mesa-va-drivers did not work.
same linked issue suggests this might be also related to ROCm being installed. But I have not uninstalled it to verify.

@nixos-discourse
Copy link

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

https://discourse.nixos.org/t/cannot-run-chrome-nor-chromium/54373/5

@shymega
Copy link
Author

shymega commented Oct 27, 2024

I don't think this is related to libva. The issue was [originally] due to mixing unstable Mesa and stable Mesa.

If people are experiencing the same issue, even when overriding the mesa input, please update the issue. For libva, I believe that is a separate issue.

@Wraaath
Copy link

Wraaath commented Oct 28, 2024

Yeah setting export LIBVA_DRIVER_NAME="vdpau" doesn't fix it for me using MPV unstable.

@le0nAg
Copy link

le0nAg commented Oct 31, 2024

As mentioned in the thread on discourse I'm experiencing the same error on the stable channel that I always used.
Is there the possibility that some stable packages where contaminated by some unstable dependencies? Actually this hypothesis it the only one that I have that would explain the issue

tesujimath added a commit to tesujimath/home.nix that referenced this issue Nov 13, 2024
@antoniocorbi
Copy link

Hi!

I use NixOS with a mix from stable + unstable pkgs.

I have this video card from AMD:

03:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon RX 470/480/570/570X/580/580X/590] (rev ef)

My main 'desktop' works ok and is based on swayfx (0.4) but I'm also experimenting this problem when trying to launch sway-1.10 or hyprland from unstable.

Is there a fix for this or if we update to 24.11 when it is available will experiment the same problem, I mean if I want to use sway-1.10 by then 'stable'?

@so-lar-is
Copy link

so-lar-is commented Nov 24, 2024

I'm experiencing this bug now as well, the LIBVA_DRIVER_NAME workaround didn't work for me either.

05:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Cezanne [Radeon Vega Series / Radeon Vega Mobile Series] (rev c5)

@maxammann
Copy link
Contributor

I'm using this workaround:

    (
      let
        wrapped = pkgs.writeShellScriptBin "prusa-slicer" ''
          export LIBGL_ALWAYS_SOFTWARE=1
          exec ${pkgs.prusa-slicer}/bin/prusa-slicer "$@"
        '';
      in
      pkgs.symlinkJoin {
        name = "prusa-slicer";
        paths = [
          wrapped
          pkgs.prusa-slicer
        ];
      }
    )

@bgamari bgamari mentioned this issue Nov 27, 2024
13 tasks
@so-lar-is
Copy link

This has been fixed for me, as far as I can tell, when I updated to 24.11

@Wraaath
Copy link

Wraaath commented Dec 5, 2024

Same for me :)

@le0nAg
Copy link

le0nAg commented Dec 6, 2024

Also for me

@shymega
Copy link
Author

shymega commented Dec 7, 2024

I think the lesson to be learned here is that mixing unstable packages that - in this case, rely on Mesa - with stable systems, cause this particular manifestation.

As 24.11 has resolved this issue, for me included, are people alright if I go ahead and close this issue as resolved?

@antoniocorbi
Copy link

I think the lesson to be learned here is that mixing unstable packages that - in this case, rely on Mesa - with stable systems, cause this particular manifestation.

As 24.11 has resolved this issue, for me included, are people alright if I go ahead and close this issue as resolved?

Yes, just updated to 24.11 and it works now.
Thanks for your work in Nixos.

@shymega
Copy link
Author

shymega commented Dec 8, 2024

Will close now. I'll open an issue to see if we should document this behaviour.

@shymega shymega closed this as completed Dec 8, 2024
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