support hardware.graphics
This commit is contained in:
parent
071c95f049
commit
c9a89035b5
@ -1,4 +1,20 @@
|
||||
{ config, pkgs, lib, ... }:
|
||||
let
|
||||
extraPackages = with pkgs; [
|
||||
mesa.drivers
|
||||
intel-media-driver
|
||||
# not added due to collision
|
||||
# https://github.com/NixOS/nixos-hardware/issues/1170
|
||||
#(if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11")
|
||||
# then vaapiIntel
|
||||
# else intel-vaapi-driver)
|
||||
vaapiVdpau
|
||||
libvdpau-va-gl
|
||||
intel-ocl
|
||||
intel-compute-runtime # OpenCL filter support (hardware tonemapping and subtitle burn-in)
|
||||
(pkgs.nvtopPackages.intel or pkgs.nvtop-intel)
|
||||
];
|
||||
in
|
||||
lib.mkMerge [
|
||||
|
||||
{
|
||||
@ -19,25 +35,15 @@ lib.mkMerge [
|
||||
intel-vaapi-driver = pkgs.intel-vaapi-driver.override { enableHybridCodec = true; };
|
||||
};
|
||||
|
||||
hardware.opengl.enable = true;
|
||||
}
|
||||
(lib.optionalAttrs (lib.versionOlder (lib.versions.majorMinor lib.version) "24.11") {
|
||||
hardware.opengl.driSupport = true;
|
||||
hardware.opengl.enable = true;
|
||||
hardware.opengl.extraPackages = extraPackages;
|
||||
})
|
||||
{
|
||||
hardware.opengl.extraPackages = with pkgs; [
|
||||
mesa.drivers
|
||||
intel-media-driver
|
||||
# not added due to collision
|
||||
# https://github.com/NixOS/nixos-hardware/issues/1170
|
||||
#(if (lib.versionOlder (lib.versions.majorMinor lib.version) "23.11")
|
||||
# then vaapiIntel
|
||||
# else intel-vaapi-driver)
|
||||
vaapiVdpau
|
||||
libvdpau-va-gl
|
||||
intel-ocl
|
||||
intel-compute-runtime # OpenCL filter support (hardware tonemapping and subtitle burn-in)
|
||||
(pkgs.nvtopPackages.intel or pkgs.nvtop-intel)
|
||||
];
|
||||
}
|
||||
(lib.optionalAttrs (lib.versionAtLeast (lib.versions.majorMinor lib.version) "24.11") {
|
||||
hardware.graphics.enable = true;
|
||||
hardware.graphics.extraPackages = extraPackages;
|
||||
})
|
||||
|
||||
]
|
||||
|
@ -1,12 +1,18 @@
|
||||
{ pkgs, lib, options, ... }: lib.mkMerge [
|
||||
{
|
||||
# assumes common-gpu-amd from nixos-hardware is also added
|
||||
# TODO: should we move it from flake.nix to here?
|
||||
# https://github.com/NixOS/nixos-hardware/blob/master/common/gpu/amd/default.nix
|
||||
# assumes common-gpu-amd from nixos-hardware is also added
|
||||
# TODO: should we move it from flake.nix to here?
|
||||
# https://github.com/NixOS/nixos-hardware/blob/master/common/gpu/amd/default.nix
|
||||
|
||||
(lib.mkIf (lib.versionOlder (lib.versions.majorMinor lib.version) "24.11") {
|
||||
hardware.opengl.enable = true;
|
||||
hardware.opengl.driSupport = true;
|
||||
hardware.opengl.driSupport32Bit = true;
|
||||
})
|
||||
(lib.mkIf (lib.versionAtLeast (lib.versions.majorMinor lib.version) "24.11") {
|
||||
hardware.graphics.enable = true;
|
||||
hardware.graphics.enable32Bit = true;
|
||||
})
|
||||
{
|
||||
|
||||
nixpkgs.config.openglSupport = true; # why is this not set by hardware.opengl.enable ?
|
||||
nixpkgs.config.rocmSupport = true;
|
||||
@ -14,19 +20,11 @@
|
||||
nixpkgs.config.vaapiSupport = true;
|
||||
|
||||
services.ollama.acceleration = lib.mkDefault "rocm";
|
||||
}
|
||||
(lib.mkIf (lib.versionAtLeast (lib.versions.majorMinor lib.version) "24.05") {
|
||||
|
||||
hardware.amdgpu.opencl.enable = lib.mkDefault true;
|
||||
#hardware.amdgpu.amdvlk.enable = lib.mkDefault true;
|
||||
#hardware.amdgpu.amdvlk.support32Bit.enable = lib.mkDefault true;
|
||||
})
|
||||
#(lib.mkIf (lib.versionOlder (lib.versions.majorMinor lib.version) "24.05") {
|
||||
# # nixos-hardware common-amd options
|
||||
# # https://github.com/NixOS/nixos-hardware/blob/master/common/gpu/amd/default.nix
|
||||
# hardware.amdgpu.opencl = lib.mkDefault true;
|
||||
# #hardware.amdgpu.amdvlk = lib.mkDefault true;
|
||||
#})
|
||||
{
|
||||
|
||||
# https://libreddit.noximilien.pbsds.net/r/archlinux/comments/nih9c9/amdgpu_vs_modesetting_in_current_510_kernels_xorg/
|
||||
services.xserver.videoDrivers = [ "amdgpu" ]; # use gpu, adaptive sync and and hardware page flipping
|
||||
#services.xserver.videoDrivers = [ "modesetting" ]; # integrated (non-accelerated) framebuffer, KMS (default in nixos-hardware)
|
||||
|
@ -29,14 +29,17 @@ lib.mkMerge [
|
||||
|
||||
];
|
||||
|
||||
hardware.opengl.enable = true;
|
||||
}
|
||||
(lib.optionalAttrs (lib.versionOlder (lib.versions.majorMinor lib.version) "24.11") {
|
||||
hardware.opengl.enable = true;
|
||||
hardware.opengl.driSupport = true;
|
||||
hardware.opengl.driSupport32Bit = true;
|
||||
hardware.opengl.extraPackages32 = with pkgs.pkgsi686Linux; [ libva ];
|
||||
})
|
||||
(lib.optionalAttrs (lib.versionAtLeast (lib.versions.majorMinor lib.version) "24.11") {
|
||||
hardware.graphics.enable = true;
|
||||
hardware.graphics.enable32Bit = true;
|
||||
hardware.graphics.extraPackages32 = with pkgs.pkgsi686Linux; [ libva ];
|
||||
})
|
||||
{
|
||||
hardware.opengl.driSupport32Bit = true;
|
||||
hardware.opengl.extraPackages32 = with pkgs.pkgsi686Linux; [ libva ];
|
||||
|
||||
}
|
||||
]
|
||||
|
@ -66,14 +66,19 @@ lib.mkMerge [
|
||||
|
||||
#services.joycond.enable = true;
|
||||
|
||||
hardware.opengl.enable = true;
|
||||
}
|
||||
(lib.optionalAttrs (lib.versionOlder (lib.versions.majorMinor lib.version) "24.11") {
|
||||
hardware.opengl.enable = true;
|
||||
hardware.opengl.driSupport = true;
|
||||
hardware.opengl.driSupport32Bit = true;
|
||||
hardware.opengl.extraPackages32 = with pkgs.pkgsi686Linux; [ libva ];
|
||||
})
|
||||
(lib.optionalAttrs (lib.versionAtLeast (lib.versions.majorMinor lib.version) "24.11") {
|
||||
hardware.graphics.enable = true;
|
||||
hardware.graphics.enable32Bit = true;
|
||||
hardware.graphics.extraPackages32 = with pkgs.pkgsi686Linux; [ libva ];
|
||||
})
|
||||
{
|
||||
hardware.opengl.driSupport32Bit = true;
|
||||
hardware.opengl.extraPackages32 = with pkgs.pkgsi686Linux; [ libva ];
|
||||
|
||||
environment.systemPackages = with pkgs; [
|
||||
steam-tui
|
||||
|
Loading…
Reference in New Issue
Block a user