From 71228337e5da42af00d5fda8f991a79ff9e46261 Mon Sep 17 00:00:00 2001 From: Connor Baker Date: Tue, 23 Sep 2025 17:23:25 +0000 Subject: [PATCH] cudaPackages.tests.onnx-tensorrt: init Signed-off-by: Connor Baker --- .../packages/tests/onnx-tensorrt/long.nix | 40 +++++++++++++++++ .../packages/tests/onnx-tensorrt/short.nix | 43 +++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 pkgs/development/cuda-modules/packages/tests/onnx-tensorrt/long.nix create mode 100644 pkgs/development/cuda-modules/packages/tests/onnx-tensorrt/short.nix 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[@]}" + ''; +}