[Hardware/AMD/ROCm] attempt fix

This commit is contained in:
Antoine Viallon 2025-05-16 10:48:41 +02:00
parent 183a38ec0b
commit 60ee53b417
Signed by: aviallon
GPG key ID: 186FC35EDEB25716

View file

@ -45,7 +45,7 @@ in {
description = "What is the GFX ISA of your system. Leave blank if you have several GPUs of incompatible ISAs"; description = "What is the GFX ISA of your system. Leave blank if you have several GPUs of incompatible ISAs";
default = ""; default = "";
example = "gfx902"; example = "gfx902";
type = types.string; type = types.str;
}; };
gpuTargets = mkOption { gpuTargets = mkOption {
description = "Override supported GPU ISAs in some ROCm packages."; description = "Override supported GPU ISAs in some ROCm packages.";
@ -105,21 +105,22 @@ in {
nixpkgs.config.rocmSupport = true; nixpkgs.config.rocmSupport = true;
nixpkgs.overlays = mkBefore [(final: prev: { nixpkgs.overlays = mkIf (! isNull localCfg.gpuTargets) (mkBefore [(final: prev: {
rocmPackages_5 = final.rocmPackages; #rocmPackages_5 = final.rocmPackages;
rocmPackages = prev.rocmPackages // { rocmPackages = prev.rocmPackages // {
clr = prev.rocmPackages.clr.overrideAttrs (oldAttrs: { clr = prev.rocmPackages.clr.override { localGpuTargets = localCfg.gpuTargets; };
passthru = oldAttrs.passthru // { # (oldAttrs: {
# We cannot use this for each ROCm library, as each defines their own supported targets # passthru = oldAttrs.passthru // {
# See: https://github.com/ROCm/ROCm/blob/77cbac4abab13046ee93d8b5bf410684caf91145/README.md#library-target-matrix # # We cannot use this for each ROCm library, as each defines their own supported targets
gpuTargets = lib.forEach localCfg.gpuTargets (target: "gfx${target}"); # # See: https://github.com/ROCm/ROCm/blob/77cbac4abab13046ee93d8b5bf410684caf91145/README.md#library-target-matrix
}; # gpuTargets = lib.forEach localCfg.gpuTargets (target: "gfx${target}");
}); # };
#});
rocblas = prev.rocmPackages.rocblas.override { #rocblas = prev.rocmPackages.rocblas.override {
gpuTargets = lib.forEach localCfg.gpuTargets (target: "gfx${target}"); # gpuTargets = lib.forEach localCfg.gpuTargets (target: "gfx${target}");
}; #};
}; };
})]; })]);
}; };
} }