Skip to content

Deploy a new conda environment for xmipp #242

Description

@albertmena

Add a new option to install Xmipp in its own Conda environment, xmipp3, enabled by default. The installer will automatically detect the CUDA version supported by the NVIDIA driver and use the corresponding environment definition (CPU, CUDA 11, 12, or 13).

Users can disable this behaviour with a new parameter to skip the creation and use of the xmipp3 environment.

  1. New parameter to omit the environment creation and omit the use of that environment in the installation xmipp3_environment_ommited

  2. New 4 yaml files with the requirements of the environment (one for no GPU, and CUDA 11, 12, 13)
    xmipp_CPU.yml
    xmipp_CUDA11.yml
    xmipp_CUDA12.yml
    xmipp_CUDA13.yml

  3. Before the installation of xmipp if the parameter collect the nvidia drivers and decide the yaml file based on that
    nvidia-smi | grep -oP 'CUDA Version: \K[0-9.]+' or something more robust

  4. Set some environment variables as this:

# Conda environment activation
PATH_CONDA="/home/agarcia/miniconda/bin/conda"
eval "$($PATH_CONDA shell.bash hook)"
conda activate xmipp3

# Exports to let conda side libraries be used for compilation
export LD_LIBRARY_PATH=$CONDA_PREFIX/lib #:$LD_LIBRARY_PATH
export CPATH=$CONDA_PREFIX/include:$CONDA_PREFIX/targets/x86_64-linux/include #:$CPATH
export XMIPP3_CMAKE_CUDA_COMPILER=$CONDA_PREFIX/bin/nvcc

# Fix link.stub issues
mkdir -p $CONDA_PREFIX/targets/x86_64-linux/bin
if [[ ! -d "$CONDA_PREFIX/targets/x86_64-linux/bin/crt" ]]; then
  ln -s $CONDA_PREFIX/bin/crt $CONDA_PREFIX/targets/x86_64-linux/bin/crt
fi
if [[ ! -d "$CONDA_PREFIX/targets/x86_64-linux/lib" ]]; then
  ln -s $CONDA_PREFIX/lib $CONDA_PREFIX/targets/x86_64-linux/lib
fi

  1. launch the compillation with that flag: CMAKE_PREFIX_PATH_LIB=CONDA_PREFIX @oierlauzi please review that, not sure about ir

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions