[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";
default = "";
example = "gfx902";
type = types.string;
type = types.str;
};
gpuTargets = mkOption {
description = "Override supported GPU ISAs in some ROCm packages.";
@ -105,21 +105,22 @@ in {
nixpkgs.config.rocmSupport = true;
nixpkgs.overlays = mkBefore [(final: prev: {
rocmPackages_5 = final.rocmPackages;
nixpkgs.overlays = mkIf (! isNull localCfg.gpuTargets) (mkBefore [(final: prev: {
#rocmPackages_5 = final.rocmPackages;
rocmPackages = prev.rocmPackages // {
clr = prev.rocmPackages.clr.overrideAttrs (oldAttrs: {
passthru = oldAttrs.passthru // {
# We cannot use this for each ROCm library, as each defines their own supported targets
# See: https://github.com/ROCm/ROCm/blob/77cbac4abab13046ee93d8b5bf410684caf91145/README.md#library-target-matrix
gpuTargets = lib.forEach localCfg.gpuTargets (target: "gfx${target}");
};
});
clr = prev.rocmPackages.clr.override { localGpuTargets = localCfg.gpuTargets; };
# (oldAttrs: {
# passthru = oldAttrs.passthru // {
# # We cannot use this for each ROCm library, as each defines their own supported targets
# # 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 {
gpuTargets = lib.forEach localCfg.gpuTargets (target: "gfx${target}");
};
#rocblas = prev.rocmPackages.rocblas.override {
# gpuTargets = lib.forEach localCfg.gpuTargets (target: "gfx${target}");
#};
};
})];
})]);
};
}