Open GrabbenD opened 1 year ago
Looks like the GPU (RX 6800 XT) isn't detected any longer (Device: llvmpipe (LLVM 15.0.7, 256 bits) (0xffffffff)
)?
$ nix-shell -p glxinfo --run "glxinfo -B"
name of display: :0
display: :0 screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
Vendor: Mesa (0xffffffff)
Device: llvmpipe (LLVM 15.0.7, 256 bits) (0xffffffff)
Version: 23.0.3
Accelerated: no
Video memory: 64222MB
Unified memory: yes
Preferred profile: core (0x1)
Max core profile version: 4.5
Max compat profile version: 4.5
Max GLES1 profile version: 1.1
Max GLES[23] profile version: 3.2
OpenGL vendor string: Mesa
OpenGL renderer string: llvmpipe (LLVM 15.0.7, 256 bits)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 23.0.3
OpenGL core profile shading language version string: 4.50
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL version string: 4.5 (Compatibility Profile) Mesa 23.0.3
OpenGL shading language version string: 4.50
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 23.0.3
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
Is there a new configuration required to properly use AMDGPU in the unstable channel? Not sure who to ping apart from MESA maintainers, @primeos @vcunat
My dual GPU setup might be causing issues:
boot.blacklistedKernelModules = [ "nouveau" ];
)The second GPU isn't actually registered as intended:
$ head /sys/class/drm/*/status
==> /sys/class/drm/card0-DP-1/status <==
disconnected
==> /sys/class/drm/card0-DP-2/status <==
disconnected
==> /sys/class/drm/card0-DP-3/status <==
connected
==> /sys/class/drm/card0-HDMI-A-1/status <==
disconnected
I've even forced wl-roots to use my primary GPU as the rendering device: WLR_DRM_DEVICES=/dev/dri/card0
Yet the system decided to make my secondary GPU the primary card?
$ nix-shell -p hwinfo --run "sudo hwinfo --gfxcard"
07: PCI c00.0: 0300 VGA compatible controller (VGA)
[Created at pci.386]
Unique ID: zb5c.sSilj9OVYpA
Parent ID: nKpy.wfd8oV4+v2B
SysFS ID: /devices/pci0000:00/0000:00:03.2/0000:0c:00.0
SysFS BusID: 0000:0c:00.0
Hardware Class: graphics card
Model: "nVidia GP106 [GeForce GTX 1060 6GB]"
Vendor: pci 0x10de "nVidia Corporation"
Device: pci 0x1c03 "GP106 [GeForce GTX 1060 6GB]"
SubVendor: pci 0x1043 "ASUSTeK Computer Inc."
SubDevice: pci 0x8618
Revision: 0xa1
Memory Range: 0xfb000000-0xfbffffff (rw,non-prefetchable)
Memory Range: 0x7c20000000-0x7c2fffffff (ro,non-prefetchable)
Memory Range: 0x7c30000000-0x7c31ffffff (ro,non-prefetchable)
I/O Ports: 0xd000-0xdfff (rw)
Memory Range: 0xfc000000-0xfc07ffff (ro,non-prefetchable,disabled)
IRQ: 255 (no events)
Module Alias: "pci:v000010DEd00001C03sv00001043sd00008618bc03sc00i00"
Config Status: cfg=new, avail=yes, need=no, active=unknown
Attached to: #28 (PCI bridge)
17: PCI b00.0: 0300 VGA compatible controller (VGA)
[Created at pci.386]
Unique ID: IluS.iJAqUsK3O8D
Parent ID: cuhJ.CS5kfnTSviA
SysFS ID: /devices/pci0000:00/0000:00:03.1/0000:09:00.0/0000:0a:00.0/0000:0b:00.0
SysFS BusID: 0000:0b:00.0
Hardware Class: graphics card
Model: "ATI Navi 21 [Radeon RX 6800/6800 XT / 6900 XT]"
Vendor: pci 0x1002 "ATI Technologies Inc"
Device: pci 0x73bf "Navi 21 [Radeon RX 6800/6800 XT / 6900 XT]"
SubVendor: pci 0x1462 "Micro-Star International Co., Ltd. [MSI]"
SubDevice: pci 0x3951
Revision: 0xc1
Driver: "amdgpu"
Driver Modules: "amdgpu"
Memory Range: 0x7800000000-0x7bffffffff (ro,non-prefetchable)
Memory Range: 0x7c00000000-0x7c0fffffff (ro,non-prefetchable)
I/O Ports: 0xe000-0xefff (rw)
Memory Range: 0xfcb00000-0xfcbfffff (rw,non-prefetchable)
Memory Range: 0xfcc00000-0xfcc1ffff (ro,non-prefetchable,disabled)
IRQ: 131 (675046 events)
Module Alias: "pci:v00001002d000073BFsv00001462sd00003951bc03sc00i00"
Config Status: cfg=new, avail=yes, need=no, active=unknown
Attached to: #23 (PCI bridge)
Primary display adapter: #7
Vulkan info
$ nix-shell -p vulkan-tools --run "vulkaninfo | grep '^GPU id'"
WARNING: [Loader Message] Code 0 : terminator_CreateInstance: Failed to CreateInstance in ICD 0. Skipping ICD.
WARNING: [Loader Message] Code 0 : terminator_CreateInstance: Failed to CreateInstance in ICD 5. Skipping ICD.
WARNING: [Loader Message] Code 0 : terminator_CreateInstance: Failed to CreateInstance in ICD 6. Skipping ICD.
WARNING: [Loader Message] Code 0 : terminator_CreateInstance: Failed to CreateInstance in ICD 11. Skipping ICD.
vulkan: No DRI3 support detected - required for presentation
Note: you can probably enable DRI3 in your Xorg config
vulkan: No DRI3 support detected - required for presentation
Note: you can probably enable DRI3 in your Xorg config
vulkan: No DRI3 support detected - required for presentation
Note: you can probably enable DRI3 in your Xorg config
vulkan: No DRI3 support detected - required for presentation
Note: you can probably enable DRI3 in your Xorg config
vulkan: No DRI3 support detected - required for presentation
Note: you can probably enable DRI3 in your Xorg config
vulkan: No DRI3 support detected - required for presentation
Note: you can probably enable DRI3 in your Xorg config
vulkan: No DRI3 support detected - required for presentation
Note: you can probably enable DRI3 in your Xorg config
vulkan: No DRI3 support detected - required for presentation
Note: you can probably enable DRI3 in your Xorg config
vulkan: No DRI3 support detected - required for presentation
Note: you can probably enable DRI3 in your Xorg config
vulkan: No DRI3 support detected - required for presentation
Note: you can probably enable DRI3 in your Xorg config
vulkan: No DRI3 support detected - required for presentation
Note: you can probably enable DRI3 in your Xorg config
vulkan: No DRI3 support detected - required for presentation
Note: you can probably enable DRI3 in your Xorg config
GPU id : 2 (llvmpipe (LLVM 15.0.7, 256 bits)):
GPU id : 3 (llvmpipe (LLVM 15.0.7, 256 bits)):
GPU id : 0 (AMD Radeon RX 6800 XT (RADV NAVI21)):
GPU id : 1 (AMD Radeon RX 6800 XT (RADV NAVI21)):
GPU id : 2 (llvmpipe (LLVM 15.0.7, 256 bits)):
GPU id : 3 (llvmpipe (LLVM 15.0.7, 256 bits)):
Config
{ config, pkgs, lib, ... }: {
boot.initrd.kernelModules = [ "amdgpu" ];
services.xserver.videoDrivers = [ "amdgpu" ]; # Wayland?
hardware.opengl = {
# Mesa
enable = true;
# Vulkan
driSupport = true;
extraPackages = with pkgs; [
# Vulkan
#amdvlk # Outdated
# VAAPI
vaapiVdpau
libvdpau-va-gl
];
};
# HIP
systemd.tmpfiles.rules = [
"L+ /opt/rocm/hip - - - - ${pkgs.hip}"
];
# Dual GPU
boot.blacklistedKernelModules = [
"nouveau" # NVIDIA
];
}
I've verified that WLR_DRM_DEVICES=/dev/dri/card0
is correct:
$ l /dev/dri/by-path/
total 0
drwxr-xr-x 2 root root 80 Apr 28 02:21 .
drwxr-xr-x 3 root root 100 Apr 28 2023 ..
lrwxrwxrwx 1 root root 8 Apr 28 02:21 pci-0000:0b:00.0-card -> ../card0
lrwxrwxrwx 1 root root 13 Apr 28 02:21 pci-0000:0b:00.0-render -> ../renderD128
$ nix-shell -p pciutils --run "sudo lspci -Dnn | grep VGA"
0000:0b:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Navi 21 [Radeon RX 6800/6800 XT / 6900 XT] [1002:73bf] (rev c1)
0000:0c:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP106 [GeForce GTX 1060 6GB] [10de:1c03] (rev a1)
Instructing the host to not use my secondary GPU doesn't do anything:
$ nix-shell -p pciutils --run "lspci -Dnn | grep -i NVIDIA"
0000:0c:00.0 VGA compatible controller [0300]: NVIDIA Corporation GP106 [GeForce GTX 1060 6GB] [10de:1c03] (rev a1)
0000:0c:00.1 Audio device [0403]: NVIDIA Corporation GP106 High Definition Audio Controller [10de:10f1] (rev a1)
{
boot.kernelParams = [
"pci-stub.ids=10de:1c03,10de:10f1"
];
}
Neither this:
$ nix-shell -p glxinfo --run "DRI_PRIME=0 glxinfo | grep Device"
Device: llvmpipe (LLVM 15.0.7, 256 bits) (0xffffffff)
My Wayland compositor wasn't updated, just unstable channel.
In case you used a different nixpkgs commit for NixOS (providing kernel and /run/opengl-drivers) and for some of the programs (e.g. compositor or anything OpenGL), I'd suggest to first trying to match the versions here again. I think with mesa >= 23.0 such mismatches are greater risk than before. I've been repeating this advice quite a lot.
Thanks for the details @vcunat!
Kudos to @fufexan for leaving a workaround for the Hyprland compositor (inputs.hyprland.inputs.nixpkgs.follows = "nixpkgs"
). Although I'm not sure how to do it outside of Flakes (in Legacy Nix) which leaves me with no hardware acceleration 🙁
@GrabbenD I've updated Hyprland's Nixpkgs input, it should work again.
@GrabbenD I've updated Hyprland's Nixpkgs input, it should work again.
Thanks! I was going to migrate to Flakes soon anyway but turns out I had to try it sooner than anticipated and your workaround worked as intended! Leaving this here in case someone needs it in the future:
# /etc/nixos/flake.nix
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
hyprland = {
url = "github:hyprwm/Hyprland";
inputs.nixpkgs.follows = "nixpkgs"; # MESA/OpenGL HW workaround
};
};
outputs = { self, nixpkgs, hyprland, ...}: {
nixosConfigurations.unix = nixpkgs.lib.nixosSystem {
system = "x86_64-linux";
modules = [
./configuration.nix
hyprland.nixosModules.default
{
programs.hyprland = {
enable = true;
xwayland = {
enable = true;
hidpi = false;
};
};
}
];
};
};
}
(I couldn't find a simple way of doing it in Legacy Nix).
Also for reference, before successfully working around the issue with Flakes, I unplugged my second GPU which made my main GPU the primary display adapter but this didn't solve the issue.
with mesa >= 23.0 such mismatches are greater risk than before. I've been repeating this advice quite a lot.
@vcunat It feels like there should be a way of mitigating this type of issue to prevent it from happening again in the future. I thought Nix was designed to avoid such dependency issues 🙁
Unfortunately, GPU drivers are an exception, as they're tied to kernel-space code and to particular HW.
@GrabbenD which commit of hyprland are you on (found in flake.lock)? The one I am using is looking for libdisplay-info, which seems to be only available in unstable.
@GrabbenD which commit of hyprland are you on (found in flake.lock)? The one I am using is looking for libdisplay-info, which seems to be only available in unstable.
You can replicate this issue with 5c3684d0cce9b22364afd3515b9b42fb95417d84
commit of Hyprland if you'd like to. fufexan already bumped Flakes in Hyprland Git which is fixed it upstream and there's a workaround of following nixpkgs in case this happens again in the future... It sounds like it's bound to happen if MESA gets updated anyways 🙁
It's been a while since I've added automatic updates of Nixpkgs in Hyprland, when a new Mesa version is found. I believe these problems shouldn't happen and haven't happened for a while. I think this issue can be closed @GrabbenD.
This issue is back since mesa on unstable is 23.3.5, while on stable is 23.1.9.
Unfortunately, inputs.nixpkgs.follows = "nixpkgs"
also does not work, since wlroots does not build with stable nixpkgs.
My workaround:
nixpkgs.overlays = [
(final: prev:
{
hyprland = inputs.hyprland.packages.${pkgs.system}.hyprland;
wlroots-hyprland = inputs.hyprland.packages.${pkgs.system}.wlroots-hyprland;
wlroots = inputs.nixpkgs_unstable.legacyPackages.${pkgs.system}.wlroots;
})
(final: prev: {
wlroots = prev.wlroots.override {
xwayland = prev.xwayland;
mesa = pkgs.mesa;
};
})
(final: prev: {
wlroots = prev.wlroots.overrideAttrs (old: {
nativeBuildInputs = old.nativeBuildInputs ++
[ inputs.nixpkgs_unstable.legacyPackages.${pkgs.system}.libdrm ];
});
})
(final: prev: {
wlroots-hyprland = prev.wlroots-hyprland.override { wlroots = prev.wlroots; };
})
(final: prev: {
hyprland = prev.hyprland.override {
mesa = pkgs.mesa;
wlroots = prev.wlroots-hyprland;
};
})
Just had this issue too. Was scratching my head wondering why all my games just stopped running. So you basically have 2 options:
nixos-XX.XX
or nixos-unstable
, exclusively (for base system <-> compositor-related stuff). I've tried nixos-unstable
in the past, but it was just too rocky for me.nixpkgs
input on hyprland
and wlroots
(as shown by @abmantis). This means that you can't rely on the binary cache, forcing you to suffer through huge build times.Kinda sucks. I wonder if there is any chance that Hyprland updates can be backported to nixos-23.11
?
There haven't been breaking changes since 23.11, so it can be backported. I'll try not to forget next time I update it.
Any movement on this one? Or is someone able to provide a more comprehensive example in their dots (I don't want to bloat this thread with support questions)? Unfortunately I have just jumped onto nix and am seemingly suffering from this bug so I have nothing to rollback to :(
Any movement on this one? Or is someone able to provide a more comprehensive example in their dots (I don't want to bloat this thread with support questions)? Unfortunately I have just jumped onto nix and am seemingly suffering from this bug so I have nothing to rollback to :(
If you use all packages from 23.11 (including hyprland) you should have no issues. If you use hyprland's flake, see my comment above on the overlays you need.
Attempting to do what @abmantis suggested doesn't seem to work for me:
warning: Git tree '/home/simon/Data1/GIT/Other/dotfiles' is dirty
building the system configuration...
warning: Git tree '/home/simon/Data1/GIT/Other/dotfiles' is dirty
error:
… while calling the 'head' builtin
at /nix/store/ngm8a5avsnfk266jha4j5xy93xfhjasf-source/lib/attrsets.nix:922:11:
921| || pred here (elemAt values 1) (head values) then
922| head values
| ^
923| else
… while evaluating the attribute 'value'
at /nix/store/ngm8a5avsnfk266jha4j5xy93xfhjasf-source/lib/modules.nix:807:9:
806| in warnDeprecation opt //
807| { value = builtins.addErrorContext "while evaluating the option `${showOption loc}':" value;
| ^
808| inherit (res.defsFinal') highestPrio;
(stack trace truncated; use '--show-trace' to show the full trace)
error: function 'anonymous lambda' called with unexpected argument 'wlroots'
at /nix/store/piwmiada5ld0vjs7ilpxd8rvm0fvmrfi-source/nix/default.nix:1:1:
1| {
| ^
2| lib,
I suspect it's related to: https://github.com/hyprwm/Hyprland/commit/d8d0d3b20bdb4e4320989349dacd6deb17cfb619
Does anyone know how to fix this?
@SimonBrandner looks like you're still passing wlroots
as an input argument, but it was changed to be wlroots-hyprland
. My guess is you have to change this (as wlroots-hyprland
was already introduced in a previous overlay):
(final: prev: {
hyprland = prev.hyprland.override {
mesa = pkgs.mesa;
- wlroots = prev.wlroots-hyprland;
};
})
The system seems to build fine though I still have the issue...
When adding inputs.nixpkgs.follows = "nixpkgs";
to Hyprland input, I get this:
warning: Git tree '/home/simon/Data1/GIT/Other/dotfiles' is dirty
building the system configuration...
warning: Git tree '/home/simon/Data1/GIT/Other/dotfiles' is dirty
error: builder for '/nix/store/7f2jj772a666gjg9wkrd6ly2pg86k1fh-wlroots-hyprland-2024-04-21_5c1d51c.drv' failed with exit code 1;
last 10 log lines:
> Run-time dependency wayland-server found: YES 1.22.0
> Dependency libdrm found: NO found 2.4.118 but need: '>=2.4.120'
> Did not find CMake 'cmake'
> Found CMake: NO
> Run-time dependency libdrm found: NO (tried pkgconfig and cmake)
> Looking for a fallback subproject for the dependency libdrm
>
> meson.build:108:6: ERROR: Neither a subproject directory nor a libdrm.wrap file was found.
>
> A full log can be found at /build/source/build/meson-logs/meson-log.txt
For full logs, run 'nix log /nix/store/7f2jj772a666gjg9wkrd6ly2pg86k1fh-wlroots-hyprland-2024-04-21_5c1d51c.drv'.
error: 1 dependencies of derivation '/nix/store/izf4yi06phwzsmy27z3r1vg42xrh93kx-hyprland-0.39.1+date=2024-04-25_ecf282d.drv' failed to build
error: 1 dependencies of derivation '/nix/store/qv1bmy5iqbr6vhg27sww89jlrdyx2wn4-hyprland-0.39.1+date=2024-04-25_ecf282d.drv' failed to build
error: 1 dependencies of derivation '/nix/store/wlr00dv1jc40iaajfr0ahh9ivvlqrnac-desktops.drv' failed to build
error: 1 dependencies of derivation '/nix/store/yygwi7i01w6cxyw1dwr5p59gy2wlilmf-system-path.drv' failed to build
error: 1 dependencies of derivation '/nix/store/6q83z7bq1ivykw7qyxwvk82s4r0sk7yh-xdg-desktop-portal-hyprland-1.3.1+date=2024-04-21_9ace6f9.drv' failed to build
error: 1 dependencies of derivation '/nix/store/g8kjlhzrjav5g148dp767mzbq00dj6np-nixos-system-Simon-s-Tuxedo-InfinityBook-14-Gen8-23.11.20240422.b500489.drv' failed to build
@SimonBrandner looks like the overlay that bumps the wayland-protocols version is not applying for some reason. Make sure you're applying inputs.hyprland.overlays.hyprland-packages
, not just .hyprland
.
I'll try to add this info on the wiki, which will hopefully streamline the whole process of getting Hyprland to work on NixOS Stable.
@fufexan, sorry, I am not completely sure what you mean... Could you please provide a bit more code for me to orient myself? :sweat_smile:
Fixed by following docs at: https://wiki.hyprland.org/Nix/Hyprland-on-NixOS/
Issue
It appears that my primary adapter got changed to my secondary card which has no display cable nor drivers loaded (scroll down to https://github.com/NixOS/nixpkgs/issues/228586#issuecomment-1526673843) which results in MESA not using any GPU at all (see https://github.com/NixOS/nixpkgs/issues/228586#issuecomment-1526635572) after updating the unstable channel?
Background
Halo Infinite launched successfully with: Mesa 23.0.1 + Proton Experimental (Proton 8.0-1) as well as Proton-GE 7-55 on Hyprland/Wayland with AMDGPU driver.
However, after updating the unstable channel this is no longer the case. My Wayland compositor wasn't updated, just unstable channel.
For reference, changing between different Proton versions yields the same result.
Logs
Steam:
Launching Halo Infinite
I believe the relevant line is:
System