Closed roomrys closed 1 year ago
The test on the new build:
# The original LD_LIBRARY_PATH
(sleap_build) talmolab@talmolab-01-ubuntu:~/sleap-estimates-animal-poses/pull-requests/sleap$ echo $LD_LIBRARY_PATH
# Activate the environment with the new build installed, note the LD_LIBRARY_PATH
(sleap_build) talmolab@talmolab-01-ubuntu:~/sleap-estimates-animal-poses/pull-requests/sleap$ mm activate nb0
(nb0) talmolab@talmolab-01-ubuntu:~/sleap-estimates-animal-poses/pull-requests/sleap$ echo $LD_LIBRARY_PATH
/home/talmolab/micromamba/envs/nb0/lib:
(nb0) talmolab@talmolab-01-ubuntu:~/sleap-estimates-animal-poses/pull-requests/sleap$ echo $SLEAP_OLD_LD_LIBRARY_PATH
# Now lets deactivate the environment and check that LD_LIBRARY_PATH is reset
(nb0) talmolab@talmolab-01-ubuntu:~/sleap-estimates-animal-poses/pull-requests/sleap$ mm deactivate
(sleap_build) talmolab@talmolab-01-ubuntu:~/sleap-estimates-animal-poses/pull-requests/sleap$ echo $LD_LIBRARY_PATH
This update enhances the Conda environment handling for SLEAP by ensuring both activation and deactivation scripts are properly copied. It also introduces a mechanism to manage LD_LIBRARY_PATH
during environment activation/deactivation, and updates the documentation with instructions related to these changes and TensorFlow version management.
File | Summary |
---|---|
.conda/build.sh |
Modified to copy both activate and deactivate scripts using a loop. |
.conda/sleap_activate.sh |
Updated to export SLEAP_OLD_LD_LIBRARY_PATH and modify LD_LIBRARY_PATH . |
.conda/sleap_deactivate.sh |
Resets LD_LIBRARY_PATH to its old value during environment deactivation. |
docs/installation.md |
Added instructions for managing TensorFlow version and setting/resetting LD_LIBRARY_PATH . |
🐇💻
In the land of code where the shadows lie,
The rabbit hops, his gaze held high.
With each leap, an improvement made,
In the realm of Conda, his mark is laid.
Scripts activated, deactivated in turn,
Through each line, a lesson learned.
Paths set right, TensorFlow tamed,
In the annals of code, his work is named. 🎉
Description
In #1496 we set the
LD_LIBRARY_PATH
on activating the mamba environment, This PR remembers and resets the oldLD_LIBRARY_PATH
on deactivate by using a third environment variableSLEAP_OLD_LD_LIBRARY_PATH
.This PR also documents an approach for doing this on existing environments under sleap.ai/installation#gpu-support:
Types of changes
Does this address any currently open issues?
[list open issues here]
Outside contributors checklist
Thank you for contributing to SLEAP!
:heart:
Summary by CodeRabbit
.conda/build.sh
script to ensure both activate and deactivate scripts are copied correctly..conda/sleap_activate.sh
to store the currentLD_LIBRARY_PATH
before updating it, allowing for easy restoration later..conda/sleap_deactivate.sh
to restore the originalLD_LIBRARY_PATH
when deactivating the environment.docs/installation.md
with instructions on how to handle issues related to TensorFlow version and GPU detection for Linux users.