microsoft / onnxruntime

ONNX Runtime: cross-platform, high performance ML inferencing and training accelerator
https://onnxruntime.ai
MIT License
14.61k stars 2.92k forks source link

Filenames in OrtTensorRTProviderOptionsV2 should be std::filesystem::path or at least const ORTCHAR_T* #22182

Open BengtGustafsson opened 1 month ago

BengtGustafsson commented 1 month ago

Describe the issue

With 8 bit file paths there is a high risk that applications won't run in all countries due to many characters not being representable in a char. Using filesystem::path is of course the preferred way to solve this in C++ but maybe const ORTCHAR_T* is more consistent as it is used in ort::Session ctor for some reason.

I doubt we can deliver products using Tensor RT caching to our Asian customers if this is not fixed. And we can definitely not deliver Tensor RT without caching, the setup times are far too long.

As std::filesystem::path has a non-explicit constructor from const char* replacing the member types to std::filesystem::path seems to be less intrusive, most user code would still work. Python bindings etc. would benefit from being updated to ensure that all characters are supported across the language boundary.

I think this is a Windows only issue as Linux is usually UTF-8 through and through.

To reproduce

Put your TensorRT cache in a directory with a name containing characters not in the code page of the computer. Try running a program using TensorRT caching of any kind.

Urgency

No response

Platform

Windows

OS Version

11

ONNX Runtime Installation

Built from Source

ONNX Runtime Version or Commit ID

1.19.2

ONNX Runtime API

C++

Architecture

X64

Execution Provider

TensorRT

Execution Provider Library Version

TensorRT 10.4.0.26 on CUDA 11.6

github-actions[bot] commented 1 week ago

This issue has been automatically marked as stale due to inactivity and will be closed in 30 days if no further activity occurs. If further support is needed, please provide an update and/or more details.