Ort::InitApi() is only called after Generator related code is invoked
skyline75489 opened this issue · comments
OrtEnv
is created at
onnxruntime-genai/src/generators.cpp
Line 14 in a6bec83
Calling other APIs before initializing OrtEnv
:
import onnxruntime_genai as ort_genai
ort_genai.get_current_gpu_device_id()
Will fail:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
onnxruntime_genai.onnxruntime_genai.OrtException: /onnxruntime_src/include/onnxruntime/core/common/logging/logging.h:320 static const onnxruntime::logging::Logger& onnxruntime::logging::LoggingManager::DefaultLogger() Attempt to use DefaultLogger but none has been registered.