ubuntu 18lts 3090 安装 cuda10.0配置 stylegan2

ubuntu 18lts 3090 安装 cuda10.0配置 stylegan2,第1张

ubuntu 18lts 3090 安装 cuda10.0 配置 stylegan2
  1. 安装ubuntu18 安装docker,这些就不讲,安装3090的gpu驱动
➜  stylegan2 git:(master) ✗ nvidia-smi
Wed Apr 20 17:17:01 2022
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 495.46       Driver Version: 495.46       CUDA Version: 11.5     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|                               |                      |               MIG M. |
|===============================+======================+======================|
|   0  NVIDIA GeForce ...  Off  | 00000000:01:00.0 Off |                  N/A |
|  0%   35C    P8    10W / 370W |    217MiB / 24267MiB |      0%      Default |
|                               |                      |                  N/A |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                                  |
|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |
|        ID   ID                                                   Usage      |
|=============================================================================|
|    0   N/A  N/A       983      G   /usr/lib/xorg/Xorg                 18MiB |
|    0   N/A  N/A      1033      G   /usr/bin/gnome-shell               74MiB |
|    0   N/A  N/A      1314      G   /usr/lib/xorg/Xorg                 94MiB |
|    0   N/A  N/A      1444      G   /usr/bin/gnome-shell               26MiB |
+-----------------------------------------------------------------------------+
  1. 配置nvidia-container-runtime,按照这个https://github.com/NVIDIA/nvidia-container-runtime的官方说明搞了一下就可以了,具体记不清楚了,应该是两步
  • https://nvidia.github.io/nvidia-container-runtime/
    Debian-based distributions
curl -s -L https://nvidia.github.io/nvidia-container-runtime/gpgkey | \
  sudo apt-key add -
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-container-runtime/$distribution/nvidia-container-runtime.list | \
  sudo tee /etc/apt/sources.list.d/nvidia-container-runtime.list
sudo apt-get update
  • sudo apt-get install nvidia-container-runtime
  1. git clone stylegan2 的仓库 cd进去
下面开始我要history看我干了啥了 有可能有疏漏
  1. 修改Dockerfile pip加速 不然很慢的
FROM tensorflow/tensorflow:1.14.0-gpu-py3

RUN pip config set global.index-url http://mirrors.aliyun.com/pypi/simple
RUN pip config set install.trusted-host mirrors.aliyun.com

RUN pip install scipy==1.3.3
RUN pip install requests==2.22.0
RUN pip install Pillow==6.2.1
  1. 从Dockerfile构建一个干净的镜像 docker build --tag stylegan2:latest .
  2. 运行镜像
docker run --gpus all -it -v `pwd`:/scratch --user $(id -u):$(id -g) stylegan2:latest bash
  1. 连进去了 测试一下哈哈
root@ee0a53ccec56:/# nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2018 NVIDIA Corporation
Built on Sat_Aug_25_21:08:01_CDT_2018
Cuda compilation tools, release 10.0, V10.0.130
root@ee0a53ccec56:/# cd /scratch/
root@ee0a53ccec56:/scratch# nvcc test_nvcc.cu -o test_nvcc -run
CPU says hello.
GPU says hello.

教程搬运自youtubu的视频https://www.youtube.com/watch?v=VVj8EvgVjLo

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/718679.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-04-25
下一篇 2022-04-25

发表评论

登录后才能评论

评论列表(0条)

保存