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

Cannot add ONNNX runtime library to final binary. #8083

Open
trohit920 opened this issue Nov 8, 2023 · 6 comments
Open

Cannot add ONNNX runtime library to final binary. #8083

trohit920 opened this issue Nov 8, 2023 · 6 comments
Labels
triage Please triage and relabel this issue

Comments

@trohit920
Copy link

trohit920 commented Nov 8, 2023

I am trying to build a project involving Onnx runtime gpu library on Nvidia Jetson NX Board. I ran the

nvidia@ubuntu:/media/nvidia/Extreme_Pro/train_project$ pyinstaller --onefile --name="osn_tcms" --add-binary /home/nvidia/.local/lib/python3.8/site-packages/onnxruntime/capi/libonnxruntime_providers_cuda.so:lib --upx-dir=/usr/local/cuda-11.4/targets/aarch64-linux/lib/ main_v3.py --runtime-tmpdir /media/nvidia/Extreme_Pro/train_project/tmp -d bootloader

command to successfully build the final binary using Pyinstaller. But on running the final binay from dist folder gives me below error.

nvidia@ubuntu:/media/nvidia/Extreme_Pro/train_project$ ./dist/osn_tcms [283456] PyInstaller Bootloader 6.x [283456] LOADER: executable is /media/nvidia/Extreme_Pro/train_project/dist/osn_tcms [283456] LOADER: _MEIPASS2 is not set [283456] LOADER: archivename is /media/nvidia/Extreme_Pro/train_project/dist/osn_tcms [283456] LOADER: Cookie found at offset 0x23DFCCB9 [283456] LOADER: creating temporary directory... [283456] LOADER: Found runtime-tmpdir /media/nvidia/Extreme_Pro/train_project/tmp [283456] Cannot create temporary directory!

Please suggest what am I doing wrong and how to resolve this issue.

@trohit920 trohit920 added the triage Please triage and relabel this issue label Nov 8, 2023
@rokm
Copy link
Member

rokm commented Nov 8, 2023

I think the directory pointed to via --runtime-tmpdir must already exist, and we try to create a _MEIXXXX directory inside that. So this is probably failing because /media/nvidia/Extreme_Pro/train_project/tmp does not exist.

But why are you overriding --runtime-tmpdir in the first place?

@trohit920
Copy link
Author

Thanks for the quick reply after correcting it I encountered another issue.

./dist/osn_tcms 
[295386] PyInstaller Bootloader 6.x
[295386] LOADER: executable is /media/nvidia/Extreme_Pro/train_project/dist/osn_tcms
[295386] LOADER: _MEIPASS2 is not set
[295386] LOADER: archivename is /media/nvidia/Extreme_Pro/train_project/dist/osn_tcms
[295386] LOADER: Cookie found at offset 0x23DFCCB9
[295386] LOADER: creating temporary directory...
[295386] LOADER: Found runtime-tmpdir /media/nvidia/Extreme_Pro/train_project/tmp
[295386] LOADER: created temporary directory: /media/nvidia/Extreme_Pro/train_project/tmp/_MEIazijTR
[295386] LOADER: Extracting binaries
[295386] Failed to create symbolic link libQt5Core-9e162752.so.5.15.0!
[295386] LOADER: temppath is /media/nvidia/Extreme_Pro/train_project/tmp/_MEIazijTR
[295386] LOADER: Error extracting binaries

@trohit920 trohit920 reopened this Nov 8, 2023
@rokm
Copy link
Member

rokm commented Nov 8, 2023

Hmmm, we fail to create symlink for libQt5Core-9e162752.so.5.15.0 for some reason. Is /media/nvidia/Extreme_Pro/train_project/tmp on a filesystem that does not support symbolic links?

Can you try without --runtime-tmpdir to have the application unpack itself in the default temporary directory (presumably /tmp)?

As a side note, libQt5Core-9e162752.so.5.15.0 likely comes from python-opencv, and if you are not using OpenCV's HighGUI for GUI, you should probably be using python-opencv-headless instead...

@trohit920
Copy link
Author

The /media/nvidia/Extreme_Pro/train_project/tmp is an external hard drive as the Jetson module is not having enough space in /tmp folder. So is there any work around to this.

@rokm
Copy link
Member

rokm commented Nov 8, 2023

The /media/nvidia/Extreme_Pro/train_project/tmp is an external hard drive as the Jetson module is not having enough space in /tmp folder. So is there any work around to this.

If the fileystem does not support symbolic links, then no. Except maybe using PyInstaller 5.x, which collects only hard copies.

@bwoodsend
Copy link
Member

If your application needs so much space that it doesn't fit in /tmp then you probably shouldn't be using onefile mode.

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

No branches or pull requests

3 participants