Difference between revisions of "Ubuntu Nvidia"
From Hawk Wiki
(→Pull docker images) |
(→NVIDIA DRIVER method 2) |
||
(8 intermediate revisions by the same user not shown) | |||
Line 19: | Line 19: | ||
<pre> | <pre> | ||
sudo apt-get remove docker docker-engine docker.io | sudo apt-get remove docker docker-engine docker.io | ||
− | sudo apt-get install \ | + | sudo apt-get -y install \ |
apt-transport-https \ | apt-transport-https \ | ||
ca-certificates \ | ca-certificates \ | ||
Line 32: | Line 32: | ||
stable" | stable" | ||
sudo apt-get update | sudo apt-get update | ||
− | sudo apt-get install docker-ce | + | sudo apt-get install -y docker-ce |
#test docker | #test docker | ||
sudo docker run hello-world | sudo docker run hello-world | ||
Line 41: | Line 41: | ||
<pre> | <pre> | ||
# If you have nvidia-docker 1.0 installed: we need to remove it and all existing GPU containers | # If you have nvidia-docker 1.0 installed: we need to remove it and all existing GPU containers | ||
− | docker volume ls -q -f driver=nvidia-docker | xargs -r -I{} -n1 docker ps -q -a -f volume={} | xargs -r docker rm -f | + | sudo docker volume ls -q -f driver=nvidia-docker | xargs -r -I{} -n1 docker ps -q -a -f volume={} | xargs -r docker rm -f |
sudo apt-get purge -y nvidia-docker | sudo apt-get purge -y nvidia-docker | ||
Line 78: | Line 78: | ||
===docker clear items=== | ===docker clear items=== | ||
<pre> | <pre> | ||
+ | #kill all containers | ||
docker kill $(docker ps -q) | docker kill $(docker ps -q) | ||
− | + | ||
#clear images | #clear images | ||
docker rmi $(docker images -a -q) | docker rmi $(docker images -a -q) | ||
+ | </pre> | ||
+ | |||
+ | ===Docker clean up stopped containers=== | ||
+ | https://www.digitalocean.com/community/tutorials/how-to-remove-docker-images-containers-and-volumes | ||
+ | Clear all exited containers | ||
+ | <pre> | ||
+ | docker rm $(docker ps -a -f status=exited -q) | ||
+ | </pre> | ||
+ | |||
+ | ===Ubuntu 16 convert to eth0 schema=== | ||
+ | |||
+ | <pre> | ||
+ | sudo vim /etc/default/grub | ||
+ | #edit lines below | ||
+ | GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0" | ||
+ | |||
+ | #then run | ||
+ | sudo grub-mkconfig -o /boot/grub/grub.cfg | ||
+ | </pre> | ||
+ | ===Fix no display after installed ubuntu server=== | ||
+ | See https://ubuntuforums.org/showthread.php?t=2331323 | ||
+ | <pre> | ||
+ | sudo vim /etc/default/grub | ||
+ | GRUB_CMDLINE_LINUX_DEFAULT="nomodeset video=uvesafb:mode_options=1024x768-16@60,mtrr=0,scroll=ywrap,noedid" | ||
+ | sudo update-grub | ||
+ | </pre> | ||
+ | then restart computer | ||
+ | |||
+ | |||
+ | ==NVIDIA DRIVER method 2== | ||
+ | <pre> | ||
+ | |||
+ | apt-get install -y ocl-icd-libopencl1 ocl-icd-opencl-dev opencl-headers | ||
+ | sudo add-apt-repository ppa:graphics-drivers/ppa | ||
+ | sudo apt install nvidia-driver-525 | ||
+ | |||
+ | sudo reboot | ||
+ | |||
+ | nvidia smi | ||
+ | |||
</pre> | </pre> |
Latest revision as of 04:37, 9 March 2023
how to install ubuntu server with nvidia driver
I have version Ubuntu server version 16
sudo apt-get update sudo apt-get install build-essential
download nvidia driver
sudo bash NVIDIA-Linux-x86_64-390.25.run
Safe to ignore warnings
WARNING: nvidia-installer was forced to guess the X library path '/usr/lib' and X module path '/usr/lib/xorg/modules'; these paths were not queryable from the system. If X fails to find the NVIDIA X driver module, please install the `pkg-config` utility and the X.Org SDK/development package for your distribution and reinstall the driver.
Install docker
https://docs.docker.com/install/linux/docker-ce/ubuntu/#docker-ee-customers
sudo apt-get remove docker docker-engine docker.io sudo apt-get -y install \ apt-transport-https \ ca-certificates \ curl \ software-properties-common curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - sudo apt-key fingerprint 0EBFCD88 sudo add-apt-repository \ "deb [arch=amd64] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) \ stable" sudo apt-get update sudo apt-get install -y docker-ce #test docker sudo docker run hello-world
install docker nvidia
https://gist.github.com/wangruohui/df039f0dc434d6486f5d4d098aa52d07
# If you have nvidia-docker 1.0 installed: we need to remove it and all existing GPU containers sudo docker volume ls -q -f driver=nvidia-docker | xargs -r -I{} -n1 docker ps -q -a -f volume={} | xargs -r docker rm -f sudo apt-get purge -y nvidia-docker # Add the package repositories curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | \ sudo apt-key add - curl -s -L https://nvidia.github.io/nvidia-docker/ubuntu16.04/amd64/nvidia-docker.list | \ sudo tee /etc/apt/sources.list.d/nvidia-docker.list sudo apt-get update # Install nvidia-docker2 and reload the Docker daemon configuration sudo apt-get install -y nvidia-docker2 sudo pkill -SIGHUP dockerd # Test nvidia-smi with the latest official CUDA image sudo docker run --runtime=nvidia --rm nvidia/cuda nvidia-smi
Run docker without sudo
sudo groupadd docker sudo usermod -aG docker $USER
Pull docker images
Deep learning
docker pull floydhub/dl-docker:gpu
ZEC mining
nvidia-docker run -itd -e username=<insert_t_address> servethehome/zec_flypool_ewbf:cuda -e devfee=0
docker clear items
#kill all containers docker kill $(docker ps -q) #clear images docker rmi $(docker images -a -q)
Docker clean up stopped containers
https://www.digitalocean.com/community/tutorials/how-to-remove-docker-images-containers-and-volumes Clear all exited containers
docker rm $(docker ps -a -f status=exited -q)
Ubuntu 16 convert to eth0 schema
sudo vim /etc/default/grub #edit lines below GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0" #then run sudo grub-mkconfig -o /boot/grub/grub.cfg
Fix no display after installed ubuntu server
See https://ubuntuforums.org/showthread.php?t=2331323
sudo vim /etc/default/grub GRUB_CMDLINE_LINUX_DEFAULT="nomodeset video=uvesafb:mode_options=1024x768-16@60,mtrr=0,scroll=ywrap,noedid" sudo update-grub
then restart computer
NVIDIA DRIVER method 2
apt-get install -y ocl-icd-libopencl1 ocl-icd-opencl-dev opencl-headers sudo add-apt-repository ppa:graphics-drivers/ppa sudo apt install nvidia-driver-525 sudo reboot nvidia smi