Commit 850d76d
Fix libaoti_cuda_shims.so not found when importing _portable_lib on Linux (#17632)
When ExecuTorch is built with CUDA support and installed as a pip
package, importing `_portable_lib` fails with:
ImportError: libaoti_cuda_shims.so: cannot open shared object file
This happens because:
1. `_portable_lib.so` links against `libaoti_cuda_shims.so` (via
`aoti_cuda_backend`), but the RPATH only contains a stale build-time
temp directory path that no longer exists after installation.
2. `setup.py` only installs the Windows `.lib` import library, not the
Linux `.so` shared library.
Fix both issues:
- Add `$ORIGIN/../../backends/cuda` to the `_portable_lib` RPATH when
CUDA is enabled, following the same pattern used for QNN.
- Add a `BuiltFile` entry in `setup.py` to install
`libaoti_cuda_shims.so` into `executorch/backends/cuda/` in the pip
package.
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 67f1d19 commit 850d76d
2 files changed
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
947 | 947 | | |
948 | 948 | | |
949 | 949 | | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
950 | 954 | | |
951 | 955 | | |
952 | 956 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
869 | 869 | | |
870 | 870 | | |
871 | 871 | | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
872 | 879 | | |
873 | 880 | | |
874 | 881 | | |
| |||
0 commit comments