Ubuntu Nvidia

From Hawk Wiki
Revision as of 04:54, 31 January 2018 by Hall (Talk | contribs) (docker clear items)

Jump to: navigation, search

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 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 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
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

docker kill $(docker ps -q)
docker_clean_ps
#clear images
docker rmi $(docker images -a -q)

Docker clean up stopped comtainers

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)