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

Black screen when setting env = AQ_DRM_DEVICES,/dev/dri/card0:/dev/dri/card1 #9113

Closed
3 of 6 tasks
ShelpAm opened this issue Jan 18, 2025 · 9 comments
Closed
3 of 6 tasks
Labels
bug Something isn't working

Comments

@ShelpAm
Copy link

ShelpAm commented Jan 18, 2025

Already reported ? *

  • I have searched the existing open and closed issues.

Regression?

I don't know, I started using Hyprland only recently

System Info and Hyprland Version

System/Version info
Hyprland, built from branch  at commit 4520b30d498daca8079365bdb909a8dea38e8d55  (version: bump to 0.44.1).
Date: Wed Oct 9 12:54:39 2024
Tag: v0.44.1, commits: 5309
built against aquamarine 0.4.2


flags: (if any)


System Information:
System name: Linux
Node name: shelpams-fedora
Release: 6.12.8-200.fc41.x86_64
Version: #1 SMP PREEMPT_DYNAMIC Thu Jan  2 19:26:03 UTC 2025


GPU information: 
00:02.0 VGA compatible controller [0300]: Intel Corporation Raptor Lake-S UHD Graphics [8086:a788] (rev 04) (prog-if 00 [VGA controller])
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation AD107M [GeForce RTX 4060 Max-Q / Mobile] [10de:28e0] (rev a1) (prog-if 00 [VGA controller])
NVRM version: NVIDIA UNIX Open Kernel Module for x86_64  565.77  Release Build  (akmods@shelpams-fedora)  Sun Jan 12 19:23:02 CST 2025


os-release: NAME="Fedora Linux"
VERSION="41 (Workstation Edition)"
RELEASE_TYPE=stable
ID=fedora
VERSION_ID=41
VERSION_CODENAME=""
PLATFORM_ID="platform:f41"
PRETTY_NAME="Fedora Linux 41 (Workstation Edition)"
ANSI_COLOR="0;38;2;60;110;180"
LOGO=fedora-logo-icon
CPE_NAME="cpe:/o:fedoraproject:fedora:41"
DEFAULT_HOSTNAME="fedora"
HOME_URL="https://fedoraproject.org/"
DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/f41/system-administrators-guide/"
SUPPORT_URL="https://ask.fedoraproject.org/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=41
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=41
SUPPORT_END=2025-12-15
VARIANT="Workstation Edition"
VARIANT_ID=workstation


plugins:


Description

I want to use NVIDIA dgpu to start hyprland, so I found in the wiki.

But when setting environment variable by env = AQ_DRM_DEVICES,/dev/dri/card0:/dev/dri/card1 (where card0 is my nvidia card), it shows black screen sadly.

How to reproduce

  1. Select nvidia card by env = AQ_DRM_DEVICES,/dev/dri/xxxx_nvidia_card in configuration file.
  2. Launch Hyprland.

Attach not paste

  • I understand that all text files must be attached, and not pasted directly. If not respected, this issue will likely get closed as spam

Checklist of files to include below

  • Hyprland config - hyprctl systeminfo -c (always include)
  • Crash report (always include in case of crash)
  • Video (always include in case of a visual bug)
  • Logs (might contain useful info such as errors)

Additional info & File uploads

The file hyprland1.log (I got it by HYPRLAND_TRACE=1 AQ_TRACE=1 Hyprland > hyprland1.log 2>&1) says that src/gbm_drv_common.c:131: GBM-DRV error (get_bytes_per_component): Unknown or not supported format: 808669784 . This may be the cause, but I don't know much about what this means :( Sorry

@ShelpAm ShelpAm added the bug Something isn't working label Jan 18, 2025
@gksudolol
Copy link

You're reading from the wiki that relates to git/master branch

Here's 44.1: https://wiki.hyprland.org/0.41.1/Configuring/Multi-GPU/#telling-hyprland-which-gpu-to-use

(your HL/AQ versions are also severly out of date)

@ShelpAm
Copy link
Author

ShelpAm commented Jan 19, 2025

Thank you for your reply!

Since you mentioned my Hyprland version was severely outdated, I’ve updated it to 0.46.2. While the screen is no longer black, it’s now frozen.

I've also tried to run Hyprland with AQ_DRM_DEVICES=$HOME/.config/hypr/nvidia-card, but got the same result.

I’m currently following the latest documentation—should I continue with that?

@gksudolol
Copy link

I've also tried to run Hyprland with AQ_DRM_DEVICES=$HOME/.config/hypr/nvidia-card, but got the same result.

Can you try with full path to cards? `env = AQ_DRM_DEVICES,/dev/dri/card0:/dev/dri/card1'

@ShelpAm
Copy link
Author

ShelpAm commented Jan 19, 2025

I've also tried to run Hyprland with AQ_DRM_DEVICES=$HOME/.config/hypr/nvidia-card, but got the same result.

Can you try with full path to cards? `env = AQ_DRM_DEVICES,/dev/dri/card0:/dev/dri/card1'

It gives the same result...

@gksudolol
Copy link

You might need to look through https://wiki.hyprland.org/0.46.0/Nvidia/

And set up some extra variables for Nvidia

@ShelpAm
Copy link
Author

ShelpAm commented Jan 19, 2025

I've already followed the steps on that page before, but I'm not sure if I did it successfully. Is there any way to verify it? Or should I go through the setup again to double-check?

Edit:

And here is my config about envs:

env = XCURSOR_SIZE,24
env = HYPRCURSOR_SIZE,24

# fcitx5
env = XMODIFIERS,@im=fcitx
env = XIM,fcitx
# env = GTK_IM_MODULE,fcitx # Fcitx asked me not to set this.
env = QT_IM_MODULE,fcitx

# Nvidia
# env = WLR_DRM_DEVICES,$HOME/.config/hypr/nvidia-card
# env = AQ_DRM_DEVICES,/dev/dri/card0:/dev/dri/card1 # Leads to frozen screen
env = LIBVA_DRIVER_NAME,nvidia
env = NVD_BACKEND,direct # VA-API hardware video acceleration, see https://wiki.hyprland.org/Nvidia/#va-api-hardware-video-acceleration
# env = GBM_BACKEND,nvidia-drm # Forces NVIDIA GPU

# Force wayland
env = ELECTRON_OZONE_PLATFORM_HINT,auto # Fixes softwares built with Electron.
env = GDK_BACKEND,wayland,x11,*
env = QT_QPA_PLATFORM,wayland;xcb
env = SDL_VIDEODRIVER,wayland
env = CLUTTER_BACKEND,wayland

In .zshenv:

export __NV_PRIME_RENDER_OFFLOAD=1       # Default to use NVIDIA card
export __GLX_VENDOR_LIBRARY_NAME=nvidia  # GLX
export __VK_LAYER_NV_optimus=NVIDIA_only # Vulkan
export GBM_BACKEND=nvidia-drm # Copied from hyprland.conf
export __GL_GSYNC_ALLOWED=1
export __GL_VRR_ALLOWED=0

@gksudolol
Copy link

Does HL freeze when setting env = AQ_DRM_DEVICES,/dev/dri/card1 # Only use Intel card

And comment out anything Nvidia-related?

Ideally you should set environment variables in hyprland.conf, or just launch like AQ_DRM_DEVICES=/dev/dri/card1 Hyprland and not export them in the shell

@theayusharma
Copy link

@ShelpAm are you using a laptop without mux switch?

@vaxerski
Copy link
Member

you cannot use your dgpu to drive your internal display unless you have a mux switch to completely disable the igpu.

This is a hardware limitation of Nvidia's cards

@vaxerski vaxerski closed this as not planned Won't fix, can't repro, duplicate, stale Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants