Pytorch cannot load libtorch_cpu.so when running in a Gramine Enclave #1293
Replies: 3 comments 7 replies
-
Interestingly enough running the application with |
Beta Was this translation helpful? Give feedback.
-
Hi @hop-along-polly, thanks for your report! Would you pls kindly try increasing the |
Beta Was this translation helpful? Give feedback.
-
So after setting However I was using That error literally makes no sense, like zero sense, because with the |
Beta Was this translation helpful? Give feedback.
-
I'm trying to get a FastAPI app that uses
torch
to run within Gramine. I've gotten to a point where the API will start and handle requests but the API endpoint that deals with pytorch models fails with this errorImportError: libtorch_cpu.so: failed to map segment from shared object
. I'm fairly certain I'm doing something wrong with thefs.mounts
orsgx.trusted_files
but I can't see what I've done wrong.I'm not sure what information is all needed so It's probably information overload.
is-sgx-available output
Environment
Server
: Intel SGX enabled VM running in Azure (I verified this with is-sgx-OS
: Ubuntu 20.04Python
:- Ver: 3.11
- Location: /usr/bin/python -> /usr/bin/python3.11
Pip
:- Ver: 23.0.1
- Location: /home/modelscan/.local/bin/pip
Directory Structure
Contents of App.py (Redacted for IP protection)
The Gramine Manifest File
Commands Run
The Problem
When I use the
api/upload
endpoint I get the previously mentioned error. Here is the entire stacktraceThe Question
With all that being said I know that libtorch_cpu.so is on the base Ubuntu system.
find . -name libtorch_cpu.so
finds it in 2 locationsThe second location is also mounted and trusted in the gramine manifest file so there should be no issues with reading it.
Any help is greatly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions