Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux full installation tweak #1489

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 27 additions & 13 deletions docs/linux_install_full.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,19 @@ if ! command -v conda &> /dev/null; then
echo "Conda not found, installing Miniconda."
wget https://repo.anaconda.com/miniconda/Miniconda3-py310_23.1.0-1-Linux-x86_64.sh
bash ./Miniconda3-py310_23.1.0-1-Linux-x86_64.sh -b -u
source ~/miniconda3/bin/activate
conda init bash
conda deactivate
else
echo "Conda is already installed."
source ~/miniconda3/bin/activate
conda init bash
conda deactivate
fi

if [ "$CONDA_DEFAULT_ENV" = "h2ogpt" ]; then
echo "Deactivating the h2ogpt Conda environment."
conda deactivate
else
echo "The h2ogpt Conda environment is not currently activated."
fi
# if there no session created or instanced, it will be
source ~/miniconda3/bin/activate
conda init bash
# it does not matter where it is, it will be utterly deactivate.
while [ $CONDA_SHLVL -gt 0 ]; do conda deactivate; done
# Now we can stay on base conda session

echo "Installing fresh h2oGPT env."
if conda env list | grep -q 'h2ogpt'; then
if conda env list | grep -w 'h2ogpt'; then
conda remove -n h2ogpt --all -y
else
echo "h2ogpt environment does not exist."
Expand All @@ -51,11 +45,31 @@ conda create -n h2ogpt -y
conda activate h2ogpt
conda install python=3.10 -c conda-forge -y

if ! command -v nvcc &> /dev/null; then
echo -e "\n\n\tThere is no NVIDIA CUDA Compiler Driver NVCC installed\n\n"
exit 1
fi
nvccVersion=$(nvcc --version | grep -i release | sed -e 's/^.*release *\(\([[:digit:]]\|\.\)\+\).*$/\1/i')
if [ ! "$nvccVersion" == "12.1" ] && [ ! "$nvccVersion" == "11.8" ]; then
echo -e "\n\n\tWARNING - There can be problems if you do not have installed NVIDIA CUDA Compiler Driver NVCC like 12.1 or 11.8"
echo -e "\tYour current version is: ${nvccVersion}"
echo -en "\t"; read -r -p "Are you sure to continue [y|Y]: " response < /dev/tty
if [ ! "${response^^}" == "Y" ]; then
echo -e "\n\n\tExit without installing\n\n"
exit 1
fi
fi

export CUDA_HOME=/usr/local/cuda-12.1
export PIP_EXTRA_INDEX_URL="https://download.pytorch.org/whl/cu121"
export LLAMA_CUBLAS=1
export CMAKE_ARGS="-DLLAMA_CUBLAS=on -DCMAKE_CUDA_ARCHITECTURES=all"
export FORCE_CMAKE=1
# Overwriting in case of CUDA 11.8
if [ "${nvccVersion}" == "11.8" ]; then
export CUDA_HOME=/usr/local/cuda-11.8
export PIP_EXTRA_INDEX_URL="https://download.pytorch.org/whl/cu118 https://huggingface.github.io/autogptq-index/whl/cu118"
fi

echo "Installing fresh h2oGPT"
set +x
Expand Down