diff --git a/pkgs/development/rocm-modules/6/default.nix b/pkgs/development/rocm-modules/6/default.nix index e457eff0879f..ba7a72a117c1 100644 --- a/pkgs/development/rocm-modules/6/default.nix +++ b/pkgs/development/rocm-modules/6/default.nix @@ -231,21 +231,15 @@ let ); mpi = self.openmpi; - ## Meta ## - # Emulate common ROCm meta layout - # These are mainly for users. I strongly suggest NOT using these in nixpkgs derivations - # Don't put these into `propagatedBuildInputs` unless you want PATH/PYTHONPATH issues! - # See: https://rocm.docs.amd.com/en/docs-5.7.1/_images/image.004.png - # See: https://rocm.docs.amd.com/en/docs-5.7.1/deploy/linux/os-native/package_manager_integration.html - meta = with self; rec { + meta = { # eval all pkgsRocm release attrs with # nix-eval-jobs --force-recurse pkgs/top-level/release.nix -I . --select "p: p.pkgsRocm" --no-instantiate - release-attrPaths = (builtins.fromJSON (builtins.readFile ./release-attrPaths.json)).attrPaths; release-packagePlatforms = let platforms = [ "x86_64-linux" ]; + attrPaths = (builtins.fromJSON (builtins.readFile ./release-attrPaths.json)).attrPaths; in lib.foldl' ( acc: path: @@ -253,162 +247,7 @@ let lib.recursiveUpdate acc (lib.setAttrByPath (lib.splitString "." path) platforms) else acc - ) { } self.meta.release-attrPaths; - - rocm-developer-tools = symlinkJoin { - name = "rocm-developer-tools-meta"; - paths = [ - aqlprofile - rocm-core - rocr-debug-agent - roctracer - rocdbgapi - rocprofiler - rocgdb - rocm-language-runtime - ]; - }; - rocm-ml-sdk = symlinkJoin { - name = "rocm-ml-sdk-meta"; - paths = [ - rocm-core - miopen-hip - rocm-hip-sdk - rocm-ml-libraries - ]; - }; - rocm-ml-libraries = symlinkJoin { - name = "rocm-ml-libraries-meta"; - paths = [ - llvm.clang - llvm.openmp - rocm-core - miopen-hip - rocm-hip-libraries - ]; - }; - rocm-hip-sdk = symlinkJoin { - name = "rocm-hip-sdk-meta"; - paths = [ - rocprim - rocalution - hipfft - hiprt - rocm-core - hipcub - hipblas - hipblaslt - rocrand - rocfft - rocsparse - rccl - rocthrust - rocblas - hipsparse - hipfort - rocwmma - hipsolver - rocsolver - rocm-hip-libraries - rocm-hip-runtime-devel - ]; - }; - rocm-hip-libraries = symlinkJoin { - name = "rocm-hip-libraries-meta"; - paths = [ - rocblas - hipfort - rocm-core - rocsolver - rocalution - rocrand - hipblas - hipblaslt - rocfft - hipfft - hiprt - rccl - rocsparse - hipsparse - hipsolver - rocm-hip-runtime - ]; - }; - rocm-openmp-sdk = symlinkJoin { - name = "rocm-openmp-sdk-meta"; - paths = [ - rocm-core - llvm.clang - llvm.openmp # openmp-extras-devel (https://github.com/ROCm/aomp) - rocm-language-runtime - ]; - }; - rocm-opencl-sdk = symlinkJoin { - name = "rocm-opencl-sdk-meta"; - paths = [ - rocm-core - rocm-runtime - clr - clr.icd - rocm-opencl-runtime - ]; - }; - rocm-opencl-runtime = symlinkJoin { - name = "rocm-opencl-runtime-meta"; - paths = [ - rocm-core - clr - clr.icd - rocm-language-runtime - ]; - }; - rocm-hip-runtime-devel = symlinkJoin { - name = "rocm-hip-runtime-devel-meta"; - paths = [ - clr - rocm-core - hipify - rocm-cmake - llvm.clang - llvm.openmp - rocm-runtime - rocm-hip-runtime - ]; - }; - rocm-hip-runtime = symlinkJoin { - name = "rocm-hip-runtime-meta"; - paths = [ - rocm-core - rocminfo - clr - rocm-language-runtime - ]; - }; - rocm-language-runtime = symlinkJoin { - name = "rocm-language-runtime-meta"; - paths = [ - rocm-runtime - rocm-core - rocm-comgr - llvm.openmp # openmp-extras-runtime (https://github.com/ROCm/aomp) - ]; - }; - rocm-all = symlinkJoin { - name = "rocm-all-meta"; - paths = [ - rocm-developer-tools - rocm-ml-sdk - rocm-ml-libraries - rocm-hip-sdk - rocm-hip-libraries - rocm-openmp-sdk - rocm-opencl-sdk - rocm-opencl-runtime - rocm-hip-runtime-devel - rocm-hip-runtime - rocm-language-runtime - ]; - }; + ) { } attrPaths; }; rocm-bandwidth-test = self.callPackage ./rocm-bandwidth-test { diff --git a/pkgs/development/rocm-modules/6/rocm-tests/default.nix b/pkgs/development/rocm-modules/6/rocm-tests/default.nix index 84762ff70e73..794915893917 100644 --- a/pkgs/development/rocm-modules/6/rocm-tests/default.nix +++ b/pkgs/development/rocm-modules/6/rocm-tests/default.nix @@ -1,4 +1,6 @@ { + lib, + linkFarm, clr, ollama, python3Packages, @@ -8,6 +10,22 @@ stdenv, }: # This package exists purely to have a bunch of passthru.tests attrs +let + availableRocmDrvs = lib.pipe rocmPackages [ + (lib.mapAttrsToList ( + name: value: { + inherit name; + evaluated = builtins.tryEval value; + } + )) + (builtins.filter (x: x.evaluated.success)) + (map (x: { + inherit (x) name; + value = x.evaluated.value; + })) + (builtins.filter (x: lib.isDerivation x.value && (x.value.meta.available or true))) + ]; +in stdenv.mkDerivation { name = "rocm-tests"; nativeBuildInputs = [ @@ -20,6 +38,12 @@ stdenv.mkDerivation { inherit rocmPackages; acceleration = "rocm"; }; + rocmPackagesDerivations = linkFarm "rocmPackagesDerivations" ( + map (x: { + name = x.name; + path = x.value; + }) availableRocmDrvs + ); torch = python3Packages.torch.override { inherit rocmPackages; rocmSupport = true;