hitagi: Switch to Intel Arc A770

Things are not very smooth yet. Hwmon only works with Kernel 6.2 and
only supports energy monitoring (and even that doesn’t look too good).
Fan control and temperature is not supported. To get at least usage
statistics, intel_gpu_top can be used. Mangohud in its newest unreleased
version also supports getting stats from it. However, intel_gpu_top
needs cap_perfmon, which is a pain to get working inside the double
bubblewrap sandbox for steam, therefore it is not yet available.

On the positive side, OpenCL works well and oneAPI also works with
blender-bin from nix-warez (nixpkgs doesn’t yet have blender with oneAPI
support).
This commit is contained in:
Simon Bruder 2023-02-11 22:53:54 +01:00
parent f760e2cee4
commit f4efa9b1fc
Signed by: simon
GPG key ID: 8D3C82F9F309F8EC
3 changed files with 62 additions and 10 deletions

View file

@ -6,6 +6,23 @@
];
boot = {
# Intel arc
#kernelPackages = pkgs.linuxPackages_latest;
kernelPackages = pkgs.unstable.recurseIntoAttrs (pkgs.unstable.linuxPackagesFor (pkgs.unstable.callPackage
({ fetchurl, buildLinux, ... } @ args: buildLinux (args // rec {
version = "6.2.0-rc7";
modDirVersion = version;
src = fetchurl {
url = "https://git.kernel.org/torvalds/t/linux-6.2-rc7.tar.gz";
sha256 = "sha256-6klAGw+J0usyY55dTMb/reUbAobJdheG/6YvNGz7SwM=";
};
kernelPatches = [ ];
extraMeta.branch = "6.2";
} // (args.argsOverride or { })))
{ }));
# fan control configuration from https://gist.github.com/bakman2/e801f342aaa7cade62d7bd54fd3eabd8
kernelModules = [ "kvm-amd" "it87" ];
kernelParams = [ "acpi_enforce_resources=lax" ]; # allow it87 to load
@ -75,16 +92,33 @@
];
# GPU
hardware.opengl.extraPackages = with pkgs; [
rocm-opencl-icd
];
hardware.opengl = {
package = pkgs.unstable.mesa.drivers;
package32 = pkgs.unstable.pkgsi686Linux.mesa.drivers;
extraPackages = with pkgs; [
intel-media-driver
libvdpau-va-gl
vaapiIntel
vaapiVdpau
] ++ (with pkgs.unstable; [
intel-compute-runtime
intel-compute-runtime.drivers
level-zero
]);
};
environment.systemPackages = with pkgs; [
clinfo
radeontop
rocm-smi
nvtop-amd # also returns basic stats for intel
];
security.wrappers."intel_gpu_top" = {
owner = "root";
group = "root";
capabilities = "cap_perfmon+p";
source = "${pkgs.unstable.intel-gpu-tools}/bin/intel_gpu_top";
};
# https://www.reddit.com/r/gigabyte/comments/p5ewjn/b550i_pro_ax_f13_bios_sleep_issue_on_linux/
systemd.services.suspend-fix = {
wantedBy = [ "multi-user.target" ];
@ -105,7 +139,7 @@
};
sbruder.fancontrol = {
enable = true;
enable = false; # no hwmon for intel arc (yet)
enableDefaultMapping = true;
fans = {
front = {

View file

@ -30,6 +30,24 @@ in
'';
});
# FIXME: remove once manghud > 0.6.8 is in nixpkgs/intel arc works
mangohud = prev.mangohud.overrideAttrs (o: {
version = "unstable-2023-02-05";
src = prev.fetchFromGitHub {
owner = "flightlessmango";
repo = "MangoHud";
rev = "319077808668c589523853313d028cf81837ce72";
fetchSubmodules = true;
sha256 = "sha256-FHm5CcLKpD6R2XmGvlQrIU/OlkX1TGEN/ld3vrms2Lk=";
};
mesonFlags = o.mesonFlags ++ [
"-Dappend_libdir_mangohud=false" # new default incompatible with current packaging
"-Dtests=disabled" # tests require new subproject
];
});
vimPlugins = prev.vimPlugins // {
# TODO: Remove once (if?) https://github.com/LnL7/vim-nix/pull/28 lands
vim-nix = prev.vimPlugins.vim-nix.overrideAttrs (o: {

View file

@ -91,8 +91,9 @@ let
'';
in
lib.mkIf cfg.enable {
home.packages = with pkgs; [ ]
++ lib.optionals (cfg.performanceIndex >= 2) [
home.packages = with pkgs; [
unstable.mangohud
] ++ lib.optionals (cfg.performanceIndex >= 2) [
mgba
] ++ lib.optionals (cfg.performanceIndex >= 4) [
desmume
@ -100,8 +101,7 @@ lib.mkIf cfg.enable {
] ++ lib.optionals (cfg.performanceIndex >= 8) [
unstable.ryujinx
unstable.yuzu-mainline
]
++ lib.optionals unfree.allowSoftware [
] ++ lib.optionals unfree.allowSoftware [
unstable.osu-lazer-sandbox
steam-sandbox-with-icons
];