From eb4009247f671b346012a87302b8e3c29f496f41 Mon Sep 17 00:00:00 2001 From: Mitchell Pleune Date: Mon, 17 Feb 2025 19:17:52 +0000 Subject: [PATCH] python3Packages.onnxruntime: buildInputs dep on onnxruntime The onnxruntime libs are patched to look for additional runtime libraries in `${onnxruntime}/lib`, so we must depend on it. Alternatively, onnxruntime could be built twice, once for each lib path patch, but onnxruntime takes a vert long time to build with cuda support. --- pkgs/development/python-modules/onnxruntime/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/development/python-modules/onnxruntime/default.nix b/pkgs/development/python-modules/onnxruntime/default.nix index 48c342c1626f..90df4cb2aff0 100644 --- a/pkgs/development/python-modules/onnxruntime/default.nix +++ b/pkgs/development/python-modules/onnxruntime/default.nix @@ -50,6 +50,13 @@ buildPythonPackage { oneDNN re2 onnxruntime.protobuf + + # https://github.com/NixOS/nixpkgs/pull/357656 patches the onnx lib to ${pkgs.onnxruntime}/lib + # but these files are copied into this package too. If the origional non-python onnxruntime + # package is GC-ed, cuda support in this python package will break. + # Two options, rebuild onnxruntime twice with the different paths hard-coded, or just hold a runtime + # dependency between the two. Option 2, because onnxruntime takes forever to build with cuda support. + onnxruntime ] ++ lib.optionals onnxruntime.passthru.cudaSupport ( with onnxruntime.passthru.cudaPackages;