diff --git a/pkgs/development/cuda-modules/packages/tests/onnx-tensorrt/long.nix b/pkgs/development/cuda-modules/packages/tests/onnx-tensorrt/long.nix new file mode 100644 index 000000000000..eb0fa74db933 --- /dev/null +++ b/pkgs/development/cuda-modules/packages/tests/onnx-tensorrt/long.nix @@ -0,0 +1,40 @@ +{ + cuda_cudart, + cudaNamePrefix, + onnx-tensorrt, + python3, + writeShellApplication, +}: +writeShellApplication { + derivationArgs = { + __structuredAttrs = true; + strictDeps = true; + }; + name = "${cudaNamePrefix}-tests-onnx-tensorrt-long"; + runtimeInputs = [ + cuda_cudart + (python3.withPackages (ps: [ + ps.onnx-tensorrt + ps.pytest + ps.six + ])) + ]; + text = '' + args=( + python3 + "${onnx-tensorrt.test_script}/onnx_backend_test.py" + ) + + if (( $# != 0 )) + then + args+=( "$@" ) + else + args+=( --verbose ) + echo "Running with default arguments: ''${args[*]}" >&2 + fi + + mkdir -p "$HOME/.onnx" + chmod -R +w "$HOME/.onnx" + "''${args[@]}" + ''; +} diff --git a/pkgs/development/cuda-modules/packages/tests/onnx-tensorrt/short.nix b/pkgs/development/cuda-modules/packages/tests/onnx-tensorrt/short.nix new file mode 100644 index 000000000000..9415246f7c67 --- /dev/null +++ b/pkgs/development/cuda-modules/packages/tests/onnx-tensorrt/short.nix @@ -0,0 +1,43 @@ +{ + cuda_cudart, + cudaNamePrefix, + onnx-tensorrt, + python3, + writeShellApplication, +}: +writeShellApplication { + derivationArgs = { + __structuredAttrs = true; + strictDeps = true; + }; + name = "${cudaNamePrefix}-tests-onnx-tensorrt-short"; + runtimeInputs = [ + cuda_cudart + (python3.withPackages (ps: [ + ps.onnx-tensorrt + ps.pytest + ps.six + ])) + ]; + text = '' + args=( + python3 + "${onnx-tensorrt.test_script}/onnx_backend_test.py" + ) + + if (( $# != 0 )) + then + args+=( "$@" ) + else + args+=( + --verbose + OnnxBackendRealModelTest + ) + echo "Running with default arguments: ''${args[*]}" >&2 + fi + + mkdir -p "$HOME/.onnx" + chmod -R +w "$HOME/.onnx" + "''${args[@]}" + ''; +}