nixpkgs/pkgs/development/rocm-modules/5/clr/test-rocm-smi.nix
Flakebi 01cada7dc6
rocmPackages.clr: Add OpenCL test
Add a test that runs a simple OpenCL example on the GPU.
Run with `eval $(nix-build -A rocmPackages.impureTests.opencl-example)`.
2023-10-11 22:29:24 +02:00

24 lines
447 B
Nix

{ lib
, makeImpureTest
, clinfo
, clr
, rocm-smi
}:
makeImpureTest {
name = "rocm-smi";
testedPackage = "rocmPackages_5.clr";
nativeBuildInputs = [ clinfo rocm-smi ];
OCL_ICD_VENDORS = "${clr.icd}/etc/OpenCL/vendors";
testScript = ''
# Test fails if the number of platforms is 0
clinfo | grep -E 'Number of platforms * [1-9]'
rocm-smi | grep -A1 GPU
'';
meta = with lib; {
maintainers = teams.rocm.members;
};
}