NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.37k stars 13.6k forks source link

Prismlauncher is using software rendering after update #296277

Closed nonetrix closed 5 months ago

nonetrix commented 6 months ago

Describe the bug

For some reason after updating it seems Minecraft ran via Prismlauncher is using llvmpipe instead of my AMD GPU drivers despite me explicitly installing them and having a RX 6800. Other OpenGL applications seem to be unaffected

{pkgs, ...}: {
  boot.initrd.kernelModules = ["amdgpu"];
  services.xserver.videoDrivers = ["amdgpu"];

  hardware.opengl = {
    enable = true;
    driSupport = true;
    driSupport32Bit = true; # Let's 32Bit GPU accelrated aplications run

    # System-wide packages for ROCm (Radeon Open Compute), e.g. AI, etc
    extraPackages = with pkgs; [
      rocmPackages.clr.icd
      rocm-opencl-icd
      rocm-opencl-runtime
    ];
  };

  # Makes sure ROCm can be found by aplications
  systemd.tmpfiles.rules = [
    "L+    /opt/rocm/hip   -    -    -     -    ${pkgs.rocmPackages.clr}"
  ];

  # Packages for ROCm e.g. AI, etc.
  environment.systemPackages = [
    pkgs.rocmPackages.rocm-smi # Gives GPU info e.g. RX 6800, 16GBs VRAM, core usage 12%, 2043MB VRAM used. Clone of nvidia-smi, not much to do with compute actually
    pkgs.rocmPackages.rocminfo
  ];
}

Steps To Reproduce

Steps to reproduce the behavior: 1.Try to play game

  1. Get 10 FPS
  2. See that it is using llvmpipe in f3 menu

Expected behavior

  1. Game runs on GPU and gives much more FPS

Screenshots

As you can see on the right it is using llvmpipe which is software 2024-03-15-183130_hyprshot

Notify maintainers

@minion3665 @Scrumplex @getchoo

Metadata

❯ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.8.0, NixOS, 24.05 (Uakari), 24.05.20240314.d691274`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.18.1`
 - channels(root): `"home-manager, nixos"`
 - nixpkgs: `/nix/store/9mf8fkjw3vw1gm4s6j5fqlwrv5wf2knf-source`

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

Scrumplex commented 6 months ago

Can you re-set the Java runtime in Prism Launcher? It might be using an older JVM, as it sadly doesn't update automatically whenever the JRE derivation changes.

nonetrix commented 6 months ago

I just tried that if I understood correctly at least nothing happened, I clicked refresh here and picked the newest version image

Scrumplex commented 6 months ago

Hmm. Select the 17.x version and click OK. Note that that dialog doesn't reflect the current value in the Java path text box. After setting it there (and also making sure it's not overridden by the instance), does it change anything?

nonetrix commented 6 months ago

I did exactly that

nonetrix commented 5 months ago

Factorio is also effected

nonetrix commented 5 months ago

Godot too, I am not sure what is wrong at this point tbh since it seems no one else is having issues seemingly

Also Godot is hilariously broken with llvmpipe lol image image

Should I close this as it's a broader OpenGL issue? Seems to only effect some OpenGL programs which is why I was confused, for example Spotify and Firefox are perfectly fine. Not sure why I am the only one having this issue, I also have had Steams UI be software rendering for a while but that is unrelated. Many GPU issues on NixOS seemingly compared to other dsitros

nonetrix commented 5 months ago

I have downgraded as much as I can realistically, at this point I am going to assume it is a issue with my configs. But I am extremely confused what could be causing it as I haven't changed anything relating to GPU acceleration, I assumed it was a update that caused it

huantianad commented 5 months ago

I know there was some recent change to the OpenGL library search path, but no idea if it's related

nonetrix commented 5 months ago

I did find this when running glxinfo

DRI3 not available
failed to load driver: zink
OpenGL renderer string: llvmpipe (LLVM 17.0.6, 256 bits)

I am not using Zink so I am really confused why it would be trying to use Zink, I have only messed with Zink once and uninstalled it because it's just worse usually and not worth it. I can't find anything relating to Zink in my configs either I think it was on Arch anyway when I tested it out of pure curiosity

Also only files relating to Zink at all are in Flatpak image

I also removed flatpak completely from my system and no effect, I have zero clue why it's trying to use Zink out of all things. Seems like Zink isn't even packaged in NixOS as well. I also checked that $MESA_LOADER_DRIVER_OVERRIDE is not set to anything

Final edit: I figured out the issue, it is Hyprland seemingly. I had to downgrade Hyprland to one commit because of breaking changes that broke Wezterm for me and a plugin that I need for my workflow so I am basically out of luck I guess something is causing it to be incompatible with something I think I am getting into dependency hell

jtrees commented 5 months ago

I figured out the issue, it is Hyprland seemingly. I had to downgrade Hyprland to one commit

I'm also running into this (or something similar). Can you provide more details on your workaround?

nonetrix commented 5 months ago

The work around was to upgrade Hyprland instead of manually using a older version, sorry for the confusion this caused. But it was my fault