ubuntu16.04 server安装备忘

参考:Ubuntu 16.04 + Nvidia 显卡驱动 + Cuda 8.0 (问题总结 + 解决方案)
(sudo ./NVIDIA-Linux-x86_64-375.20.run –no-opengl-files)中的–no-opengl-files很重要

禁用不了nouveau的话可尝试以下步骤:

  1. 添加conf 文件:
 cat /etc/modprobe.d/blacklist-nouveau.conf

#添加两行内容
blacklist nouveau
options nouveau modeset=0
2. 重新生成 kernel initramfs:

sudo update-initramfs -u

3.重启:

sudo reboot

服务器重启后可能发生can’t resolve host的情况,可尝试添加DNS

docker安装
先关防火墙并且root

systemctl stop firewalld
systemctl disable firewalld
#不行试试
sudo ufw disable
# step 1: 安装必要的一些系统工具
sudo apt-get update
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
# step 2: 安装GPG证书
curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
# Step 3: 写入软件源信息
sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
# Step 4: 更新并安装 Docker-CE
sudo apt-get -y update
sudo apt-get -y install docker-ce

Nvidia-docker安装

# 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 -
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/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

# 测试是否成功
nvidia-docker

docker-compose安装

curl -L https://github.com/docker/compose/releases/download/1.20.0-rc1/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose

猜你喜欢

转载自blog.csdn.net/yb564645735/article/details/79732346