-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
[AMDGPU/Mesa] Wrong primary adapter with dual GPU setup? #228586
Comments
Looks like the GPU (RX 6800 XT) isn't detected any longer ( $ 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? |
My dual GPU setup might be causing issues:
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: 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 $ 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) |
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. |
@GrabbenD I've updated Hyprland's Nixpkgs input, it should work again. |
Thanks! # /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. |
@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. |
You can replicate this issue with |
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. |
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:
Kinda sucks. I wonder if there is any chance that Hyprland updates can be backported to |
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 :( |
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. |
The issue involved using the hyprland flake directly without overriding the nixpkgs version it uses. This means that the version of mesa used was not the same one that my system was configured with and would result in games being unable to launch from hyprland specifically. I was able to figure this out thanks to NixOS/nixpkgs#228586 It appears that steam still only launches properly when I start it from a terminal, so there is further work to be done.
Attempting to do what @abmantis suggested doesn't seem to work for me:
I suspect it's related to: hyprwm/Hyprland@d8d0d3b Does anyone know how to fix this? |
@SimonBrandner looks like you're still passing (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
|
@SimonBrandner looks like the overlay that bumps the wayland-protocols version is not applying for some reason. Make sure you're applying 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? 😅 |
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 #228586 (comment)) which results in MESA not using any GPU at all (see #228586 (comment)) 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
The text was updated successfully, but these errors were encountered: