Last active
August 7, 2024 03:40
-
-
Save dongkwan-kim/36b690b05f11b93bf375db3b3b64b23c to your computer and use it in GitHub Desktop.
nvidia docker setup in remote server accessible by ssh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# In the server, (images what I mostly used) | |
docker pull nvidia/cuda:11.1.1-cudnn8-devel-ubuntu20.04 | |
# cuda 10.0 multiple ports volume binding | |
docker run -ti --runtime=nvidia --name dongkwan -p 8082:22 -p 8083:6006 --ipc=host -v /mnt/nas2:/mnt/nas2 -d nvidia/cuda:11.1.1-cudnn8-devel-ubuntu20.04 /bin/bash | |
# Unknown runtime specified nvidia | |
docker run -ti --gpus '"device=0,1,2,3"' --name dongkwan -p 8070:22 --ipc=host -d nvidia/cuda:10.0-cudnn7-devel-ubuntu16.04 /bin/bash | |
# For volume | |
docker volume create volume_name | |
# and `-v volume_name:/container/some/where` | |
docker attach dongkwan | |
# In the container, | |
apt-get update; apt-get install vim git openssh-server ssh sudo curl screen software-properties-common | |
# 3.9 | |
add-apt-repository ppa:deadsnakes/ppa | |
apt-get update; apt-get install python3.9 python3-pip python3.9-dev | |
# 3.10 | |
add-apt-repository ppa:deadsnakes/ppa | |
apt-get update; apt-get install python3.10 python3-pip python3.10-dev | |
# PubkeyAuthentication yes -> comment | |
sed 's/PubkeyAuthentication/#PubkeyAuthentication/g' /etc/ssh/sshd_config > ~/sshd_config.tmp | |
cat ~/sshd_config.tmp > /etc/ssh/sshd_config | |
rm ~/sshd_config.tmp | |
service ssh restart | |
adduser dongkwan | |
usermod -aG sudo dongkwan | |
su dongkwan | |
# server setting | |
git config --global user.name "Dongkwan Kim" | |
git config --global user.email [email protected] | |
git config --global core.editor vim | |
git config --global push.default matching | |
sudo apt-get install zsh | |
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" | |
sed 's/robbyrussell/gianu/g' ~/.zshrc > ~/.zshrc.tmp | |
cat ~/.zshrc.tmp > ~/.zshrc | |
rm ~/.zshrc.tmp | |
# my zshrc | |
git clone https://gist.github.com/aaadad31b38a9fa7edd4db4fb1bb471b.git | |
cat aaadad31b38a9fa7edd4db4fb1bb471b/.zshrc >> ~/.zshrc | |
source ~/.zshrc | |
rm -rf aaadad31b38a9fa7edd4db4fb1bb471b | |
# vimrc setting | |
git clone https://github.com/dongkwan-kim/vimrc.git ~/.vim_runtime | |
sh ~/.vim_runtime/install_awesome_vimrc.sh | |
ssh-keygen | |
sudo pip3 install virtualenv | |
# In a local, | |
ssh -p 8080 dongkwan@<server.domain> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment