From 1fad1163579bfa93d804283378c915704876a5a1 Mon Sep 17 00:00:00 2001 From: "T.J. Alumbaugh" Date: Sat, 27 Jul 2024 22:19:55 -0600 Subject: [PATCH] Update docs for dynamic loading of libpython (#101) BUG=https://b.corp.google.com/issues/322386436 Co-authored-by: Chunnien Chan <121328115+chunnienc@users.noreply.github.com> --- README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/README.md b/README.md index f8788548..d088c0a5 100644 --- a/README.md +++ b/README.md @@ -102,6 +102,17 @@ Alternately, the nightly version can be installed with: pip install ai-edge-torch-nightly ``` +### Update LD_LIBRARY_PATH if necessary + +Torch XLA builds a shared library, `_XLAC.so` that needs to link to the version of Python +it was built with (currently 3.10 or 3.11). In order to ensure that `import _XLAC` can succeed, +update the LD_LIBRARY_PATH to the lib directory of your Python environment: + +```bash +export LD_LIBRARY_PATH=/lib:$LD_LIBRARY_PATH +``` + + * The list of versioned releases can be seen [here](https://github.com/google-ai-edge/ai-edge-torch/releases). * The full list of PyPi releases (including nightly builds) can be seen [here](https://pypi.org/project/ai-edge-torch/#history).