From 05b9dc9537d44fb2c287e69d65a27463915299ad Mon Sep 17 00:00:00 2001 From: christinab12 Date: Thu, 2 May 2024 18:49:42 +0200 Subject: [PATCH] update setup with latest steps --- scripts/openstack/02_setup_vm.sh | 65 ++++++++------------------------ 1 file changed, 15 insertions(+), 50 deletions(-) diff --git a/scripts/openstack/02_setup_vm.sh b/scripts/openstack/02_setup_vm.sh index da4217a..21923e9 100644 --- a/scripts/openstack/02_setup_vm.sh +++ b/scripts/openstack/02_setup_vm.sh @@ -1,59 +1,24 @@ # Connect to the machine via ssh -# ssh -v -i ~/.ssh/id_rsa_project1 ubuntu@134.94.88.118 -# ssh -v -i ~/.ssh/id_rsa_project2 ubuntu@134.94.88.74 +# ssh -v -i ~/.ssh/id_rsa rocky@134.94.198.230 # IP should reflect the created floatingIP -# Updates -echo "Updating distro" -sudo apt update && sudo apt upgrade +# Bring VM to latest state and install some dependencies +sudo dnf update -y # cosmetic for getting the latest kernel in +sudo shutdown 1 -r +sudo dnf config-manager --set-enabled crb +sudo dnf -y install epel-release +sudo dnf install -y gcc gcc-c++ make kernel-headers-$(uname -r) kernel-devel-$(uname -r) tar bzip2 automake elfutils-libelf-devel libglvnd libglvnd-devel libglvnd-opengl libglvnd-glx acpid pciutils dkms -# Install NVIDIA drivers -echo "Installing NVIDIA driver" -sudo apt install -y gcc make g++ -sudo apt-get install linux-headers-$(uname -r) -curl -o /tmp/NVIDIA-Driver.latest.run https://hpsrepo.fz-juelich.de/jusuf/nvidia/NVIDIA-Driver.latest -chmod 755 /tmp/NVIDIA-Driver.latest.run -sudo mkdir /etc/nvidia -curl -o /tmp/gridd.conf https://hpsrepo.fz-juelich.de/jusuf/nvidia/gridd.conf -sudo mv /tmp/gridd.conf /etc/nvidia/gridd.conf -sudo /tmp/NVIDIA-Driver.latest.run --ui=none --no-questions --disable-nouveau -# sudo reboot # run if needed +# Install Nvidia driver +sudo dnf config-manager --add-repo http://developer.download.nvidia.com/compute/cuda/repos/rhel9/$(uname -i)/cuda-rhel9.repo +sudo dnf module -y install nvidia-driver:latest-dkms +sudo shutdown 1 -r -# Add the following to ~/.bashrc -#export PATH=/usr/local/cuda-11.8/bin${PATH:+:${PATH}} -#export LD_LIBRARY_PATH=/usr/local/cuda-11.8/lib\ -# ${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}} -# alias labelapp="cd /home/ubuntu/active-learning-platform && python al_framework.py" +# After rebooting the device, check the driver is instlled correctly +nvidia-smi # Install miniconda -echo "Installing Miniconda" -wget -O /tmp/Miniconda3-latest-Linux-x86_64.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -bash /tmp/Miniconda3-latest-Linux-x86_64.sh - -# Install napari -# conda env remove -n .venv -echo "Installing napari" -conda activate base && pip install napari[all] -sudo apt-get install -y libdbus-1-3 libxkbcommon-x11-0 libxcb-icccm4 \ - libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 \ - libxcb-xinerama0 libxcb-xinput0 libxcb-xfixes0 - -# Install xpra -echo "Installing xpra" -DISTRO=focal -sudo apt-get install apt-transport-https software-properties-common -sudo apt install ca-certificates -sudo wget -O "/usr/share/keyrings/xpra-2022.gpg" https://xpra.org/xpra-2022.gpg -sudo wget -O "/usr/share/keyrings/xpra-2018.gpg" https://xpra.org/xpra-2018.gpg -sudo wget -O "/etc/apt/sources.list.d/xpra.list" https://xpra.org/repos/$DISTRO/xpra.list -sudo apt-get update -sudo apt-get -y install xpra xterm - -# Install pytorch and cellpose -conda install pytorch torchvision torchaudio pytorch-cuda=11.6 -c pytorch -c nvidia -pip install pyqtgraph PyQt5 numpy numba scipy natsort cellpose - -# Install github CLI for cloning private repo -conda install -y gh --channel conda-forge +curl -O https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh +bash Miniconda3-latest-Linux-x86_64.sh # Login to github using tokens # gh auth login