The issue is still reproducible on Debian 13 amd64 with
libonnxruntime1.21 1.21.0+dfsg-1 and libonnx1t64 1.17.0-3+b1, through
the C API as well (not only Python).
Here is a minimal reproducer: a Python ctypes script using only the C
API: dlopen("libonnxruntime.so.1.21"),
OrtGetApiBase()->GetApi(21), CreateEnv(level, "probe", &env),
CreateSessionOptions, CreateSession(env, "<any .onnx>", opts, &s).
Nothing is printed after dlopen or CreateEnv. At the first
CreateSession, stderr gets 567 messages like:
Schema error: Trying to register schema with name Abs (domain:
version: 1) from file ./onnx/defs/math/old.cc line 2729, but it is
already registered from file ./onnx/defs/math/old.cc line 2729
each followed by an empty line (1134 lines). Later sessions in the same
process print nothing.
libonnx registers the ONNX schemas statically and onnxruntime registers
them **again**.
Building onnxruntime against an onnx with
ONNX_DISABLE_STATIC_REGISTRATION=ON should fix it.