-
Hi, I am trying to bootstrap ONNXRuntime with TensorRT Provider and PyTorch inside a docker container. My research shows that I need to build the onnxruntime wheel myself, so I do something like the following in my Dockerfile
In the above, essentially in stage one I build the wheel with TensorRT Provider, and in the second stage from NVIDIA's PyTorch container simply copy it and try to install. However, in the second stage, when I try to install the wheel I generated in the first stage, I run into the following issue
Both stages start with the same NVIDIA versioned base containers, and contain the same Python, nvcc, OS, etc. Note, that I am using NVIDIA's 21.03 containers, as opposed to 20.12 containers used in the Dockerfile.tensorrt example. Also, curiously I notice that the compiled wheel is for cp37, while the host OS where I compiled the wheel has Python 3.8. Is the difference in the base image version causing this issue? Thank you! (I would also appreciate any advice if there is an easier way to accomplish the above, I feel like the multi-stage Docker build is a bit of an overkill...) Edit: I run into the exact same issue when I use the 20.12 NVIDIA base images... 😢 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Ok, I eventually found out why this was not working. Sorry for the trouble. In case, somebody else runs into something similar, the issue was that in the first stage, the following script line
was overwriting the default Python installation from 3.8 to 3.7, thus generating a wheel that was not suitable for use in the second stage. I basically removed the script and did some parts manually in my docker image to get it fully working. Here's the final Dockerfile that works.
|
Beta Was this translation helpful? Give feedback.
Ok, I eventually found out why this was not working. Sorry for the trouble.
In case, somebody else runs into something similar, the issue was that in the first stage, the following script line
was overwriting the default Python installation from 3.8 to 3.7, thus generating a wheel that was not suitable for use in the second stage. I basically removed the script and did some parts manually in my docker image to get it fully working.
Here's the final Dockerfile that works.