From 5f4414443c137a9d49f6fcfa8d2bb50f943dcdb6 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Mon, 8 Sep 2025 03:10:36 +0200 Subject: [PATCH] onnxruntime: add option to link full protobuf, not protobuf-lite This can be used to fix the import of tensorflow and onnxruntime in the same python interpreter. --- pkgs/by-name/on/onnxruntime/package.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/on/onnxruntime/package.nix b/pkgs/by-name/on/onnxruntime/package.nix index 2964c8a1ac37..9bd15499960e 100644 --- a/pkgs/by-name/on/onnxruntime/package.nix +++ b/pkgs/by-name/on/onnxruntime/package.nix @@ -23,6 +23,7 @@ pythonSupport ? true, cudaSupport ? config.cudaSupport, ncclSupport ? config.cudaSupport, + withFullProtobuf ? false, cudaPackages ? { }, }@inputs: @@ -195,7 +196,7 @@ effectiveStdenv.mkDerivation rec { (lib.cmakeFeature "ONNX_CUSTOM_PROTOC_EXECUTABLE" (lib.getExe protobuf)) (lib.cmakeBool "onnxruntime_BUILD_SHARED_LIB" true) (lib.cmakeBool "onnxruntime_BUILD_UNIT_TESTS" doCheck) - (lib.cmakeBool "onnxruntime_USE_FULL_PROTOBUF" false) + (lib.cmakeBool "onnxruntime_USE_FULL_PROTOBUF" withFullProtobuf) (lib.cmakeBool "onnxruntime_USE_CUDA" cudaSupport) (lib.cmakeBool "onnxruntime_USE_NCCL" (cudaSupport && ncclSupport)) (lib.cmakeBool "onnxruntime_ENABLE_LTO" (!cudaSupport || cudaPackages.cudaOlder "12.8"))