diff --git a/home/linux/gui/hyprland/options/nvidia.nix b/home/linux/gui/hyprland/options/nvidia.nix index 609a8aa7..b144d75b 100644 --- a/home/linux/gui/hyprland/options/nvidia.nix +++ b/home/linux/gui/hyprland/options/nvidia.nix @@ -14,12 +14,13 @@ in { wayland.windowManager.hyprland.settings.env = [ # for hyprland with nvidia gpu, ref https://wiki.hyprland.org/Nvidia/ "LIBVA_DRIVER_NAME,nvidia" - "XDG_SESSION_TYPE,wayland" - "GBM_BACKEND,nvidia-drm" - "AQ_DRM_DEVICES,/dev/dri/card1" "__GLX_VENDOR_LIBRARY_NAME,nvidia" - # fix https://github.com/hyprwm/Hyprland/issues/1520 - "WLR_NO_HARDWARE_CURSORS,1" + # enable native Wayland support for most Electron apps + "ELECTRON_OZONE_PLATFORM_HINT,auto" + # VA-API hardware video acceleration + "NVD_BACKEND,direct" + + "GBM_BACKEND,nvidia-drm" ]; }; } diff --git a/home/linux/gui/hyprland/values/hyprland.nix b/home/linux/gui/hyprland/values/hyprland.nix index 53ec711e..9d337626 100644 --- a/home/linux/gui/hyprland/values/hyprland.nix +++ b/home/linux/gui/hyprland/values/hyprland.nix @@ -64,6 +64,7 @@ in { "QT_QPA_PLATFORM,wayland" "SDL_VIDEODRIVER,wayland" "GDK_BACKEND,wayland" + "XDG_SESSION_TYPE,wayland" ]; }; # gammastep/wallpaper-switcher need this to be enabled. diff --git a/hosts/idols-ai/hardware-configuration.nix b/hosts/idols-ai/hardware-configuration.nix index 005cf7f5..3a2abd5e 100644 --- a/hosts/idols-ai/hardware-configuration.nix +++ b/hosts/idols-ai/hardware-configuration.nix @@ -18,8 +18,8 @@ boot.loader.efi.efiSysMountPoint = "/boot"; boot.loader.systemd-boot.enable = true; - # boot.kernelPackages = pkgs.linuxPackages_latest; - boot.kernelPackages = pkgs.linuxPackages_xanmod_latest; + boot.kernelPackages = pkgs.linuxPackages_latest; + # boot.kernelPackages = pkgs.linuxPackages_xanmod_latest; boot.initrd.availableKernelModules = ["xhci_pci" "ahci" "nvme" "usbhid" "usb_storage" "sd_mod"]; boot.initrd.kernelModules = []; diff --git a/hosts/idols-ai/nvidia.nix b/hosts/idols-ai/nvidia.nix index ab9acde8..37f259da 100644 --- a/hosts/idols-ai/nvidia.nix +++ b/hosts/idols-ai/nvidia.nix @@ -1,21 +1,22 @@ -{pkgs-unstable, ...}: { +{config, ...}: { # =============================================================================================== # for Nvidia GPU + # https://wiki.nixos.org/wiki/NVIDIA + # https://wiki.hyprland.org/Nvidia/ # =============================================================================================== - # https://wiki.hyprland.org/Nvidia/ boot.kernelParams = [ - "nvidia.NVreg_PreserveVideoMemoryAllocations=1" # Since NVIDIA does not load kernel mode setting by default, # enabling it is required to make Wayland compositors function properly. "nvidia-drm.fbdev=1" ]; services.xserver.videoDrivers = ["nvidia"]; # will install nvidia-vaapi-driver by default hardware.nvidia = { - open = false; + # Open-source kernel modules are preferred over and planned to steadily replace proprietary modules + open = true; # Optionally, you may need to select the appropriate driver version for your specific GPU. # https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/os-specific/linux/nvidia-x11/default.nix - # package = config.boot.kernelPackages.nvidiaPackages.stable; + package = config.boot.kernelPackages.nvidiaPackages.beta; # required by most wayland compositors! modesetting.enable = true; @@ -28,18 +29,9 @@ # needed by nvidia-docker enable32Bit = true; }; - # disable cudasupport before this issue get fixed: - # https://github.com/NixOS/nixpkgs/issues/338315 - nixpkgs.config.cudaSupport = false; nixpkgs.overlays = [ (_: super: { - blender = super.blender.override { - # https://nixos.org/manual/nixpkgs/unstable/#opt-cudaSupport - cudaSupport = true; - waylandSupport = true; - }; - # ffmpeg-full = super.ffmpeg-full.override { # withNvcodec = true; # };