Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to run test with message: "The given version [19] is not supported, only version 1 to 10 is supported in this build." #935

Open
liqunfu opened this issue Sep 26, 2024 · 3 comments

Comments

@liqunfu
Copy link

liqunfu commented Sep 26, 2024

Describe the bug
follow instructions at
https://onnxruntime.ai/docs/genai/howto/build-from-source.html
the build fails to run unit tests

To Reproduce
Steps to reproduce the behavior:
1.
git clone https://github.com/microsoft/onnxruntime-genai
cd onnxruntime-genai

curl -L https://github.com/microsoft/onnxruntime/releases/download/v1.19.2/onnxruntime-win-x64-1.19.2.zip -o onnxruntime-win-x64-1.19.2.zip
tar xvf onnxruntime-win-x64-1.19.2.zip
move onnxruntime-win-x64-1.19.2 ort

python build.py --config Release

  1. open Generator.sln with vs studio, set unit_tests as the startup program and run.
    got "The given version [19] is not supported, only version 1 to 10 is supported in this build."

Expected behavior
The test shall run and pass

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

@baijumeswani
Copy link
Contributor

@liqunfu could you try copying the onnxruntime dll to the same directory as the sln file or the unit_test.exe file?

@liqunfu
Copy link
Author

liqunfu commented Sep 27, 2024

Thanks @baijumeswani, it works if I copy over onnxruntime.dll to the exe's folder. The issues is caused by having a onnxruntime.dll at "C:\Windows\WinSxS\wow64_microsoft-windows-ai-machinelearning_31bf3856ad364e35_10.0.22621.1_none_7056cab181ea1d5c\onnxruntime.dll". it must be a very old version. It blocks use and develop ort-genai on windows machines. This need to be fixed.

I see it is also confusing work with ort-genai's python api. It used to having a onnxruntime.dll at the genai install location. Now it also uses onnxruntime.dll at onnxrutime's install location. It is hard to know which one is being used.

@baijumeswani
Copy link
Contributor

baijumeswani commented Sep 27, 2024

Ideally, the python build script will try to add the onnxruntime dlls to the same path as the exe:

onnxruntime-genai/build.py

Lines 565 to 567 in 53e3ac9

lib_dir = args.build_dir / "test"
if not args.ort_home:
_ = util.download_dependencies(args.use_cuda, args.use_rocm, args.use_dml, lib_dir)

But I think on windows, we need another folder at the end of the path. If you have bandwidth, would you consider submitting a PR for this? If not, I can get to it.

For python, we load onnxruntime from inside onnxruntime's python package. Two reasons for this:

  • Minimize the onnxruntime-genai package size
  • Avoid problems where users want to use both ort and ort-genai together (since only one dll can be loaded at any given time).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants