From d7fb1a74f5bd9e3bc312cb422c28f53608496169 Mon Sep 17 00:00:00 2001 From: WolframRhodium Date: Sun, 7 Aug 2022 15:43:45 +0800 Subject: [PATCH] vsort/vs_onnxruntime.cpp: disable memory pattern optimization related issue: https://github.com/AmusementClub/vs-mlrt/issues/3#issuecomment-1204967697 this optimization is enabled in vs-mlrt v9 by https://github.com/AmusementClub/vs-mlrt/commit/dbd68032d30fdd9ec3893d48e0db72950c6516e9 --- vsort/vs_onnxruntime.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/vsort/vs_onnxruntime.cpp b/vsort/vs_onnxruntime.cpp index e8fd4a0..c7566f7 100644 --- a/vsort/vs_onnxruntime.cpp +++ b/vsort/vs_onnxruntime.cpp @@ -958,7 +958,16 @@ static void VS_CC vsOrtCreate( session_options, ExecutionMode::ORT_SEQUENTIAL )); - // checkError(ortapi->EnableMemPattern(session_options)); + + // it is important to disable the memory pattern optimization + // for use in vapoursynth + // + // this optimization merges memory allocation calls, but it is useless + // during inference in vs since the memory usage is fixed + // + // it also prevents the use of cuda graphs which requires a static + // memory configuration + checkError(ortapi->DisableMemPattern(session_options)); // TODO: other providers #ifdef ENABLE_CUDA