在 RHEL 上安装

本节描述如何在 RHEL 上安装 Driverless AI Docker 映像。如果您的系统有 GPU 或只有 CPU,则安装步骤会有不同。

环境

操作系统

GPU?

最小内存

带有 GPU 的 RHEL

64 GB

带有 CPU 的 RHEL

64 GB

在带有 GPU 的 RHEL 上安装

请注意:更多关于使用带 GPU 的 RHEL 的信息,请查阅以下网页,其中描述了如何禁用自动更新和特定的软件包更新。这对于防止 NVIDIA 驱动程序与内核不匹配很有必要,这种不匹配会导致 GPU 故障。

点击 此处 观看安装视频 。请注意,此视频中的某些图像可能因版本而异,但安装步骤仍相同。

注解

截至本文件编写之时,在 RHEL 7.4、8.3 和 8.4 版上测试了 Driverless AI。

打开终端和并使用 SSH 登录将运行 Driverless AI 的主机。登录之后,执行以下步骤:

  1. https://www.h2o.ai/download/ 检索 Driverless AI Docker 映像。

  2. 在 RHEL 上安装和启动 Docker Ee(如果还未安装)。按照 https://docs.docker.com/engine/installation/linux/docker-ee/rhel/ 上的说明操作。

或者您也可以在 Docker CE 上运行。

sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum makecache fast
sudo yum -y install docker-ce
sudo systemctl start docker
  1. 安装 nvidia-docker2(如果还未安装)。更多信息,请访问 https://github.com/NVIDIA/nvidia-docker/blob/master/README.md

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

请注意:如果您希望 nvidia-docker 服务在服务器重启时自动启动,则运行以下命令。如果您没有运行此命令,则必须要手动启动 nvidia-docker 服务,否则 GPU 将不可用。

sudo systemctl enable nvidia-docker

或者如果您已经安装以上 Docker Ce,则可以通过以下步骤安装 nvidia-docker:

curl -s -L https://nvidia.github.io/nvidia-docker/centos7/x86_64/nvidia-docker.repo | \
sudo tee /etc/yum.repos.d/nvidia-docker.repo
sudo yum install nvidia-docker2
  1. 确认 NVIDIA 驱动程序已经启动并正在运行。如果驱动程序没有启动和运行,登录到 http://www.nvidia.com/Download/index.aspx?lang=en-us 以获取最新版本的 NVIDIA Tesla V/P/K 系列驱动程序。

nvidia-docker run --rm nvidia/cuda nvidia-smi
  1. 在主机上设置相应 Driverless AI 版本的目录:

# Set up directory with the version name
mkdir dai-1.10.1.2
  1. 将目录更改为新文件夹,然后将 Driverless AI Docker 映像加载到新目录中:

# cd into the new directory
cd dai-1.10.1.2

# Load the Driverless AI docker image
docker load < dai-docker-centos7-x86_64-1.10.1.2.tar.gz
  1. 启用 GPU 的持久模式。注意每次重启时都需要运行此功能。更多信息,请查阅以下网页:http://docs.nvidia.com/deploy/driver-persistence/index.html

sudo nvidia-smi -pm 1
  1. 在主机上(新目录内)设置数据、日志和许可证目录:

# Set up the data, log, license, and tmp directories on the host machine
mkdir data
mkdir log
mkdir license
mkdir tmp
  1. 此时,您可以将数据复制到主机上的 data 目录中。数据将在 Docker 容器内可见。

  2. 运行 docker images ,找到映像标签。

  3. 启动 Driverless AI Docker 映像,并将下方标签替换为映像标签。根据您所安装的版本,使用 docker run --runtime=nvidia (>= Docker 19.03) 或 nvidia-docker (< Docker 19.03) 命令。注意,从 1.10 版本开始,DAI Docker 映像使用内部 tini 运行,相当于使用 docker 中的 --init 。如果启动命令中同时启用了这两项,tini 将输出一条(无害的)警告消息。对于 GPU 用户,由于 GPU 需要 --pid=host 来用于 nvml,从而将 tini 设为不使用 pid=1,因此它会显示警告消息(仍然无害)。

我们推荐 docker 启动命令中使用 --shm-size=256m 。但如果用户打算广泛构建 image auto model ,则推荐在 Driverless AI docker 命令中使用 --shm-size=2g

请注意:可使用 docker version 来检查您使用的 Docker 版本。

# Start the Driverless AI Docker image
docker run --runtime=nvidia \
   --pid=host \
   --rm \
   --shm-size=256m \
   -u `id -u`:`id -g` \
   -p 12345:12345 \
   -v `pwd`/data:/data \
   -v `pwd`/log:/log \
   -v `pwd`/license:/license \
   -v `pwd`/tmp:/tmp \
   h2oai/dai-centos7-x86_64:1.10.1-cuda11.2.2.xx

Driverless AI 将开始运行:

--------------------------------
Welcome to H2O.ai's Driverless AI
---------------------------------

- Put data in the volume mounted at /data
- Logs are written to the volume mounted at /log/20180606-044258
- Connect to Driverless AI on port 12345 inside the container
- Connect to Jupyter notebook on port 8888 inside the container
  1. 通过浏览器访问 http://Your-Driverless-AI-Host-Machine:12345,连接至 Driverless AI。

在带有 CPU 的 RHEL 上安装

本节介绍如何在 RHEL 上安装和启动 Driverless AI Docker 映像。注意,此操作使用 docker 而非 nvidia-docker.

点击 此处 观看安装视频 。请注意,此视频中的某些图像可能因版本而异,但安装步骤仍相同。

注解

截至本文件编写之时,在 RHEL 7.4、8.3 和 8.4 版上测试了 Driverless AI。

打开终端和并使用 SSH 登录将运行 Driverless AI 的主机。登录之后,执行以下步骤:

  1. 在 RHEL 上安装和启动 Docker Ee(如果还未安装)。按照 https://docs.docker.com/engine/installation/linux/docker-ee/rhel/ 上的说明操作。

或者您也可以在 Docker CE 上运行。

sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
sudo yum makecache fast
sudo yum -y install docker-ce
sudo systemctl start docker
  1. 在运行 Docker EE 的主机上,从 https://www.h2o.ai/download/ 检索 Driverless AI Docker 映像。

  2. 在主机上设置相应 Driverless AI 版本的目录:

# Set up directory with the version name
mkdir dai-1.10.1.2
  1. 在新目录内加载 Driverless AI Docker 映像:

# Load the Driverless AI Docker image
docker load < dai-docker-centos7-x86_64-1.10.1.2.tar.gz
  1. (在新目录内)设置数据、日志、许可证和临时目录:

# cd into the directory associated with your version of Driverless AI
cd dai-1.10.1.2

# Set up the data, log, license, and tmp directories on the host machine
mkdir data
mkdir log
mkdir license
mkdir tmp
  1. 将数据复制到主机上的 data 目录中。数据将在 Docker 容器内的 /<user-home>/data 目录下可见。

  2. 运行 docker images ,找到映像标签。

  3. 启动 Driverless AI Docker 映像。注意,从 1.10 版本开始,DAI Docker 映像使用内部 tini 运行,相当于使用 docker 中的 --init 。如果启动命令中同时启用了这两项,tini 将输出一条(无害的)警告消息。

我们推荐 docker 启动命令中使用 --shm-size=256m 。但如果用户打算广泛构建 image auto model ,则推荐在 Driverless AI docker 命令中使用 --shm-size=2g

$ docker run \
  --pid=host \
  --rm \
  --shm-size=256m \
  -u `id -u`:`id -g` \
  -p 12345:12345 \
  -v `pwd`/data:/data \
  -v `pwd`/log:/log \
  -v `pwd`/license:/license \
  -v `pwd`/tmp:/tmp \
  -v /etc/passwd:/etc/passwd:ro \
  -v /etc/group:/etc/group:ro \
  h2oai/dai-centos7-x86_64:1.10.1-cuda11.2.2.xx

Driverless AI 将开始运行:

--------------------------------
Welcome to H2O.ai's Driverless AI
---------------------------------

- Put data in the volume mounted at /data
- Logs are written to the volume mounted at /log/20180606-044258
- Connect to Driverless AI on port 12345 inside the container
- Connect to Jupyter notebook on port 8888 inside the container
  1. 通过浏览器访问 http://Your-Driverless-AI-Host-Machine:12345,连接至 Driverless AI。

停止 Docker 映像

若要停止 Driverless AI Docker 映像,在运行 Driverless AI Docker 映像的终端 (Mac OS X) 或 PowerShell (Windows 10) 窗口中按下 Ctrl + C

升级 Docker 映像

本节提供了用于升级 Docker 容器内已安装的各版本 Driverless AI 的说明。这些步骤将确保现有实验被保存。

警告:实验、MLI 和 MOJO 驻留在 Driverless AI 临时目录中,在升级 Driverless AI 时不会自动升级。

  • 升级前构建 MLI 模型

  • 升级前构建 MOJO 管道。

  • 升级前停止 Driverless AI 并备份 Driverless AI tmp 目录。

如果在升级 Driverless AI 前未在务必模型上构建 MLI,则升级后将不能在该模型上查看 MLI。升级前,请务必在您想要在未来版本中继续进行解释的模型上运行 MLI 作业。如果当前版本的解释模型列表中含有此 MLI 作业,则在升级后将保留。

如果在升级 Driverless AI 前未在模型上构建 MOJO 管道,则升级后将不能在该模型上构建 MOJO 管道。升级前,请务必在所需的全部模型上构建 MOJO 管道,然后备份 Driverless AI tmp 目录。

请注意:如果 Driverless AI 仍在运行,需将其停止。

要求

我们建议在您的主机环境中安装 NVIDIA 驱动程序 >= 471.68 (仅 GPU),以便在所有架构上获得无缝体验,包括 Ampere 架构。Driverless AI 自带 GPU 的 CUDA 11.2.2,但是主机环境中必须有驱动程序。

前往 NVIDIA download driver,获取最新的 NVIDIA Tesla A/T/V/P/K 系列驱动程序。关于 CUDA 工具包和驱动程序最低版本要求及 CUDA 工具包和相应的驱动程序版本的参考,请参见 here .

升级步骤

  1. 使用 SSH 连接到运行 Driverless AI 的主机 IP 地址。

  2. 在主机上设置相应 Driverless AI 版本的目录:

# Set up directory with the version name
mkdir dai-1.10.1.2

# cd into the new directory
cd dai-1.10.1.2
  1. https://www.h2o.ai/download/ 检索 Driverless AI 软件包,并将该软件包添加到新目录中。

  2. 在新目录内加载 Driverless AI Docker 映像:

# Load the Driverless AI docker image
docker load < dai-docker-centos7-x86_64-1.10.1.2.tar.gz
  1. 将之前 Driverless AI 目录的数据、日志、许可证和临时目录复制到新的 Driverless AI 目录中:

# Copy the data, log, license, and tmp directories on the host machine
cp -a dai_rel_1.4.2/data dai-1.10.1.2/data
cp -a dai_rel_1.4.2/log dai-1.10.1.2/log
cp -a dai_rel_1.4.2/license dai-1.10.1.2/license
cp -a dai_rel_1.4.2/tmp dai-1.10.1.2/tmp

此时,您之前版本的实验将在 Docker 容器内可见。

  1. 使用 docker images ,找到新的映像标签。

  2. 启动 Driverless AI Docker 映像。

  3. 通过浏览器访问 http://Your-Driverless-AI-Host-Machine:12345,连接至 Driverless AI。