diff --git a/pkgs/development/rocm-modules/miopen/default.nix b/pkgs/development/rocm-modules/miopen/default.nix index 90845f67582e..56e6cbb66c48 100644 --- a/pkgs/development/rocm-modules/miopen/default.nix +++ b/pkgs/development/rocm-modules/miopen/default.nix @@ -274,6 +274,19 @@ stdenv.mkDerivation (finalAttrs: { requiredSystemFeatures = [ "big-parallel" ]; + passthru.impureTests = { + # bash $(nix-build -A rocmPackages.miopen.passthru.impureTests.conv) + conv = callPackage ./test-runtime-compilation.nix { + miopen = finalAttrs.finalPackage; + name = "conv"; + testScript = "MIOpenDriver conv -n 1 -c 1 -H 4 -W 4 -k 1 -y 3 -x 3 -p 0 -q 0 -V 0"; + }; + pool = callPackage ./test-runtime-compilation.nix { + miopen = finalAttrs.finalPackage; + name = "pool"; + testScript = "MIOpenDriver pool -W 1x1x4x4 -y 2 -x 2 -p 0 -q 0 -F 1 -V 0"; + }; + }; passthru.tests = { # Ensure all .tn.model files can be loaded by whatever version of frugally-deep we have # This is otherwise hard to verify as MIOpen will only use these models on specific, diff --git a/pkgs/development/rocm-modules/miopen/test-runtime-compilation.nix b/pkgs/development/rocm-modules/miopen/test-runtime-compilation.nix new file mode 100644 index 000000000000..c781d3646251 --- /dev/null +++ b/pkgs/development/rocm-modules/miopen/test-runtime-compilation.nix @@ -0,0 +1,37 @@ +{ + lib, + makeImpureTest, + writableTmpDirAsHomeHook, + miopen, + clr, + rocm-smi, + name, + testScript, +}: + +makeImpureTest { + inherit name; + testedPackage = "rocmPackages.miopen"; + + sandboxPaths = [ + "/sys" + "/dev/dri" + "/dev/kfd" + ]; + + nativeBuildInputs = [ + writableTmpDirAsHomeHook + miopen + clr + rocm-smi + ]; + + testScript = '' + rocm-smi + ${testScript} + ''; + + meta = { + teams = [ lib.teams.rocm ]; + }; +}