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

[BUG] Significant worse performance in games on 0.37.0 then on 0.32.3 #5148

Closed
coffeeispower opened this issue Mar 17, 2024 · 15 comments
Closed
Labels
bug Something isn't working Nix NixOS issue

Comments

@coffeeispower
Copy link

coffeeispower commented Mar 17, 2024

Hyprland Version

System/Version info
Hyprland, built from branch  at commit 19c90048d65a5660384d2fb865926a366696d6be  ().
Date: 2024-03-15
Tag: 

flags: (if any)


System Information:
System name: Linux
Node name: nixos-lenovo
Release: 6.1.81
Version: #1-NixOS SMP PREEMPT_DYNAMIC Wed Mar  6 14:45:20 UTC 2024


GPU information: 
00:02.0 VGA compatible controller [0300]: Intel Corporation Iris Plus Graphics G1 (Ice Lake) [8086:8a56] (rev 07) (prog-if 00 [VGA controller])


os-release: BUG_REPORT_URL="https://github.com/NixOS/nixpkgs/issues"
BUILD_ID="23.11.20240308.2be119a"
DOCUMENTATION_URL="https://nixos.org/learn.html"
HOME_URL="https://nixos.org/"
ID=nixos
LOGO="nix-snowflake"
NAME=NixOS
PRETTY_NAME="NixOS 23.11 (Tapir)"
SUPPORT_END="2024-06-30"
SUPPORT_URL="https://nixos.org/community.html"
VERSION="23.11 (Tapir)"
VERSION_CODENAME=tapir
VERSION_ID="23.11"


plugins:

Bug or Regression?

Regression

Description

Games and applications that require the GPU seem to get a lot less FPS on newer hyprland versions. When i run for example geometry dash on hyprland that's on the nixpkgs stable version 23.11 which is hyprland 0.32.3, it runs smoothly on 60fps. However, I wanted to customize the layers' animations which is only available on newer versions of hyprland, so I switched to the hyprland flake to get a newer version, and for some reason it has significantly worse performance in games. Games start to lag a lot and reach the incredible peak of 15 FPS when it before could reach 60.

How to reproduce

Just compare the performance of any game in hyprland 0.32.3 and 0.37.0.

Also I use NixOS so probably my configuration can help reproduce the issue: https://github.com/coffee-is-power/nix-configuration

Crash reports, logs, images, videos

No response

@coffeeispower coffeeispower added the bug Something isn't working label Mar 17, 2024
@fufexan
Copy link
Member

fufexan commented Mar 17, 2024

This is most likely due to mesa incompatibilities between NixOS 23.11 and Hyprland's NixOS unstable.

I run NixOS unstable and have no issues in games.

@coffeeispower
Copy link
Author

@fufexan i don't really want to change the channel of my whole system, will it solve the issue if I update mesa to the unstable channel?

@fufexan
Copy link
Member

fufexan commented Mar 17, 2024

Not sure how you'd do that, but feel free to try. Sadly we always end up having breaking changes in the package so we can't backport the latest versions to 23.11.

@vaxerski vaxerski added the Nix NixOS issue label Mar 17, 2024
@coffeeispower
Copy link
Author

coffeeispower commented Mar 17, 2024

@fufexan Yeah it actually solved the issue, would it be a good idea to add this to the wiki in the nix os section?

Here's what i changed in my config:
coffeeispower/nix-configuration@f2784a2

@fufexan
Copy link
Member

fufexan commented Mar 17, 2024

Sure, feel free to PR.

@coffeeispower
Copy link
Author

@fufexan just sent a PR rn hyprwm/hyprland-wiki#542

@ajmasia
Copy link

ajmasia commented Apr 2, 2024

Hi @coffeeispower @fufexan, I test this solution and don't works for me!

I have problems with Firefox (Mozilla Firefox 124.0.1) over extensions forms like 1Password, Bitwarden or some notes extensions.

I'm using stable nixpkgs flake.

I'm getting this erros on xdg-desktop-portal-hyprland.service:

xdg-desktop-portal-hyprland.service - Portal service (Hyprland implementation)
     Loaded: loaded (/etc/systemd/user/xdg-desktop-portal-hyprland.service; static)
     Active: active (running) since Tue 2024-04-02 22:06:20 CEST; 11s ago
   Main PID: 1816 (.xdg-desktop-po)
      Tasks: 4 (limit: 37782)
     Memory: 12.9M
        CPU: 97ms
     CGroup: /user.slice/user-1000.slice/user@1000.service/session.slice/xdg-desktop-portal-hyprland.service
             └─1816 /nix/store/5y0isgi3gahrff83j6b09km4nbrsxqy9-xdg-desktop-portal-hyprland-1.2.4/libexec/xdg-desktop-porta>

abr 02 22:06:20 viserion xdg-desktop-portal-hyprland[1816]: DRI driver not from this Mesa build ('24.0.3' vs '23.1.9')
abr 02 22:06:20 viserion xdg-desktop-portal-hyprland[1816]: failed to bind extensions
abr 02 22:06:20 viserion xdg-desktop-portal-hyprland[1816]: DRI driver not from this Mesa build ('24.0.3' vs '23.1.9')
abr 02 22:06:20 viserion xdg-desktop-portal-hyprland[1816]: failed to bind extensions
abr 02 22:06:20 viserion xdg-desktop-portal-hyprland[1816]: DRI driver not from this Mesa build ('24.0.3' vs '23.1.9')
abr 02 22:06:20 viserion xdg-desktop-portal-hyprland[1816]: failed to bind extensions
abr 02 22:06:20 viserion xdg-desktop-portal-hyprland[1816]: DRI driver not from this Mesa build ('24.0.3' vs '23.1.9')
abr 02 22:06:20 viserion xdg-desktop-portal-hyprland[1816]: failed to bind extensions
abr 02 22:06:20 viserion xdg-desktop-portal-hyprland[1816]: DRI driver not from this Mesa build ('24.0.3' vs '23.1.9')
abr 02 22:06:20 viserion xdg-desktop-portal-hyprland[1816]: failed to bind extensions

My hyprland module:

{ inputs, pkgs, ... }:

let
  openglPackage = pkgs.unstable.mesa.drivers;
  openglPackage32 = pkgs.unstable.pkgsi686Linux.mesa.drivers;
in
{
  programs.hyprland = {
    enable = true;

    package = inputs.hyprland.packages.${pkgs.system}.hyprland;
  };

  environment.sessionVariables = {
    NIXOS_OZONE_WL = "1"; # hint electron apps to use wayland
    MOZ_ENABLE_WAYLAND = "1"; # ensure enable wayland for Firefox
    WLR_RENDERER_ALLOW_SOFTWARE = "1"; # enable software rendering for wlroots
    WLR_NO_HARDWARE_CURSORS = "1"; # disable hardware cursors for wlroots
  };

  hardware = {
    opengl =
      {
        enable = true;

        package = openglPackage;
        package32 = openglPackage32;

        driSupport = true;
        driSupport32Bit = true;
      };

    # opentabletdriver.enable = true;
  };
}

@fufexan
Copy link
Member

fufexan commented Apr 2, 2024

@ajmasia you can add this to your config:

programs.hyprland.portalPackage = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland.override {
  inherit (pkgs.unstable) mesa;
};

This will override the mesa used by xdph and force it to be the same as the one on your system. Should fix the issue you're facing (driver mismatch).

@ajmasia
Copy link

ajmasia commented Apr 3, 2024

@fufexan now service works fine but problems with firefox persists 😊

{ inputs, pkgs, ... }:

let
 openglPackage = pkgs.unstable.mesa.drivers;
 openglPackage32 = pkgs.unstable.pkgsi686Linux.mesa.drivers;
in
{
 programs.hyprland = {
   enable = true;

   package = inputs.hyprland.packages.${pkgs.system}.hyprland;

   portalPackage = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland.override {
     inherit (pkgs.unstable) mesa;
   };
 };

 environment.sessionVariables = {
   NIXOS_OZONE_WL = "1"; # hint electron apps to use wayland
   MOZ_ENABLE_WAYLAND = "1"; # ensure enable wayland for Firefox
   WLR_RENDERER_ALLOW_SOFTWARE = "1"; # enable software rendering for wlroots
   WLR_NO_HARDWARE_CURSORS = "1"; # disable hardware cursors for wlroots
 };

 xdg = {
   portal = {
     extraPortals = with pkgs; [
       xdg-desktop-portal-gtk
     ];
     configPackages = [
       pkgs.xdg-desktop-portal-gtk
     ];
   };
 };

 hardware = {
   opengl =
     {
       enable = true;

       package = openglPackage;
       package32 = openglPackage32;

       driSupport = true;
       driSupport32Bit = true;
     };

 };
}

@fufexan
Copy link
Member

fufexan commented Apr 3, 2024

That is a separate issue. See #5333.

@ajmasia
Copy link

ajmasia commented Jun 3, 2024

@fufexan now using las versión with unstable system in NixOS I have this issue

video_2024-06-03_20-32-21.mp4

Flake

inputs.hyprland.url = "git+https://github.com/hyprwm/Hyprland?submodules=1";

Hyprland module

{ inputs, pkgs, ... }:
# let
#   openglPackage = pkgs.mesa.drivers;
#   openglPackage32 = pkgs.pkgsi686Linux.mesa.drivers;
# in
{

  programs.hyprland = {
    enable = true;

    package = inputs.hyprland.packages.${pkgs.system}.hyprland;
    xwayland.enable = true;

    portalPackage = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland.override
      {
        inherit (pkgs) mesa;
      };

    # https://github.com/hyprwm/Hyprland/issues/5148
    # portalPackage = inputs.hyprland.packages.${pkgs.system}.xdg-desktop-portal-hyprland.override {
    #   inherit (pkgs) mesa;
    # };
  };

  programs.dconf.enable = true;

  environment.sessionVariables = {
    NIXOS_OZONE_WL = "1"; # hint electron apps to use wayland
    MOZ_ENABLE_WAYLAND = "1"; # ensure enable wayland for Firefox
    WLR_RENDERER_ALLOW_SOFTWARE = "1"; # enable software rendering for wlroots
    WLR_NO_HARDWARE_CURSORS = "1"; # disable hardware cursors for wlroots
    NIXOS_XDG_OPEN_USE_PORTAL = "1"; # needed to open apps after web login
  };


  services = {
    # Applications messaging system
    dbus = {
      enable = true;

      packages = with pkgs; [
        gcr # crypto services (from gnome)
        dconf # settings daemon (from gnome)
      ];
    };
  };


  xdg = {
    portal = {
      enable = true;

      extraPortals = with pkgs; [
        xdg-desktop-portal-gtk
      ];
      configPackages = [
        pkgs.xdg-desktop-portal-gtk
      ];
    };
  };

  hardware = {
    opengl =
      {
        enable = true;

        # package = openglPackage;
        # package32 = openglPackage32;

        driSupport = true;
        driSupport32Bit = true;
      };
  };

}

@fufexan
Copy link
Member

fufexan commented Jun 3, 2024

@ajmasia which issue exactly? Also, what should I notice in the video? I only see a flicker.

@ajmasia
Copy link

ajmasia commented Jun 4, 2024

@fufexan just the fliker in green color that makes the image (now using nixpkgs unstable)

@fufexan
Copy link
Member

fufexan commented Jun 4, 2024

I believe it's a different issue then, as this issue was referring to performance problems, not visual artifacts.

@sleroq
Copy link

sleroq commented Sep 2, 2024

If someone is still experiencing a similar issue, this solved it for me - NixOS/nixpkgs#228586 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Nix NixOS issue
Projects
None yet
Development

No branches or pull requests

5 participants