generated from JacobARose/python-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_conda-cuda-10_2.sh
64 lines (44 loc) · 2.2 KB
/
build_conda-cuda-10_2.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#################
#!/bin/bash
# build_conda.sh
export ENV_NAME="imutils"
export CONDA_BASE=$(conda info --base)
source "$CONDA_BASE/etc/profile.d/conda.sh"
# . ./bash_scripts.sh
# source /media/data/anaconda/etc/profile.d/conda.sh
export ENV_DIR="${CONDA_ENVS_DIRS}/${ENV_NAME}"
if [ -d ${ENV_DIR} ]; then
echo "An environment already exists at location ${ENV_DIR}. Please manually deal with this prior to another attempt."
exit 1
fi
export ENV_NAME="imutils"
LD_LIBRARY_PATH="/media/data/conda/jrose3/envs/$ENV_NAME/lib:/media/data/anaconda/lib:$LD_LIBRARY_PATH"
conda create -y -n $ENV_NAME python=3.8 pip mamba
conda activate $ENV_NAME
mamba install pytorch=1.11.0 torchvision=0.12 cudatoolkit=11.3 captum cupy opencv pkg-config numba compilers libjpeg-turbo nodejs libgcc-ng libgcc llvmdev -c fastchan -c pytorch -c conda-forge
pip3 install -r requirements/requirements-dev.txt
#pip install --extra-index-url https://developer.download.nvidia.com/compute/redist --upgrade nvidia-dali-cuda102
#pip install nvidia-pyindex nvidia-dali-cuda102
if [ ${CONDA_PREFIX} = ${ENV_DIR} ]; then
echo "Created conda env $ENV_NAME from environment.yml file and succesfully activated new environment. Now proceeding to perform pip install on the requirements.txt file"
else
echo "Failed to activate environment $ENV_NAME after attempting to install yml spec and prior to attempting pip requirements.txt. Exiting early. User may have some manual cleanup to do."
exit 1
fi
# if [ $1 = "dev" ]
# then
# echo "Installing dev requirements"
# pip install -r ./requirements/requirements-dev.txt
# . requirements/postBuild
# else
# echo "Installing base requirements"
# pip install -r ./requirements/requirements.txt
# fi
# #source requirements/postBuild # put jupyter labextension install commands here
# conda env export --no-builds > "requirements/$ENV_NAME_environment.yml"
pip3 install -e .
python -c "import cv2; print(f'cv2.__version__: {cv2.__version__}')"
python -c "import torch; print('torch.cuda.is_available(): ', torch.cuda.is_available())"
python -c "import torch; print(torch.__config__.show())"
python -c "import imutils"
echo "SUCCESS: installed conda env named 'imutils' with libraries compatible with cuda version 10.2"