rocm-opencl-icd: add nixos test

This commit is contained in:
Sebastian Neubauer 2022-11-11 21:24:46 +01:00
parent 76a4adc19c
commit fded5825fd
2 changed files with 22 additions and 1 deletions

View File

@ -1,4 +1,4 @@
{ lib, stdenv, rocm-opencl-runtime }:
{ lib, callPackage, stdenv, rocm-opencl-runtime }:
stdenv.mkDerivation rec {
pname = "rocm-opencl-icd";
@ -11,6 +11,8 @@ stdenv.mkDerivation rec {
echo "${rocm-opencl-runtime}/lib/libamdocl64.so" > $out/etc/OpenCL/vendors/amdocl64.icd
'';
passthru.impureTests = { rocm-opencl = callPackage ./test.nix {}; };
meta = with lib; {
description = "OpenCL ICD definition for AMD GPUs using the ROCm stack";
license = licenses.mit;

View File

@ -0,0 +1,19 @@
{ lib, makeImpureTest, clinfo, rocm-opencl-icd, rocm-smi }:
makeImpureTest {
name = "rocm-opencl";
testedPackage = "rocm-opencl-icd";
nativeBuildInputs = [ clinfo rocm-smi ];
OCL_ICD_VENDORS = "${rocm-opencl-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;
};
}