当前位置:网站首页>简述CUDA镜像构建
简述CUDA镜像构建
2022-07-26 16:41:00 【Aelous】
镜像需求
cuda-10.2
python-3.8
构建步骤
- base 镜像
可以随便找一个grpc的官法docker镜像- cuda 安装
在虚拟机上安装cuda会需要人为输入操作指令,而在docker上安装则可以直接通过yum,具体可参照Nvidia的[dockerfile](https://gitlab.com/nvidia/container-images/cuda/-/tree/master/dist/10.2/centos7), 注意repo中有三个镜像 `base`, `run`, `devel`, 这三个镜像是顺序依赖关系,如果想在一个dockerfile里搞定,就需要合并一下Dockerfile
FROM mirrors.****.com/grpc-python-compile\_linux3.1:0.1.7 as base
FROM base as base-amd64
ENV NVARCH x86\_64
ENV NVIDIA\_REQUIRE\_CUDA cuda>=10.2 brand=tesla,driver>=396,driver<397 brand=tesla,driver>=410,driver<411 brand=tesla,driver>=418,driver<419 brand=tesla,driver>=440,driver<441
ENV NV\_CUDA\_CUDART\_VERSION 10.2.89-1
RUN echo -e "[cuda]\nname=cuda\nbaseurl=https://developer.download.nvidia.com/compute/cuda/repos/rhel7/x86\_64\nenabled=1\ngpgcheck=1\ngpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-NVIDIA" > /etc/yum.repos.d/cuda.repo
RUN echo -e "[nvidia-ml]\nname=nvidia-ml\nbaseurl=https://developer.download.nvidia.com/compute/machine-learning/repos/rhel7/x86\_64\nenabled=1\ngpgcheck=1\ngpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-NVIDIA" > /etc/yum.repos.d/nvidia-ml.repo
RUN NVIDIA\_GPGKEY\_SUM=d1be581509378368edeec8c1eb2958702feedf3bc3d17011adbf24efacce4ab5 && \
curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/rhel7/${NVARCH}/7fa2af80.pub | sed '/^Version/d' > /etc/pki/rpm-gpg/RPM-GPG-KEY-NVIDIA && \
echo "$NVIDIA\_GPGKEY\_SUM /etc/pki/rpm-gpg/RPM-GPG-KEY-NVIDIA" | sha256sum -c --strict -
ENV CUDA\_VERSION 10.2
RUN yum upgrade -y
RUN yum install -y \
cuda-cudart-10-2-${NV\_CUDA\_CUDART\_VERSION} \
cuda-compat-10-2 \
&& ln -s cuda-10.2 /usr/local/cuda \
&& yum clean all \
&& rm -rf /var/cache/yum/\*
# nvidia-docker 1.0
RUN echo "/usr/local/nvidia/lib" >> /etc/ld.so.conf.d/nvidia.conf && \
echo "/usr/local/nvidia/lib64" >> /etc/ld.so.conf.d/nvidia.conf
ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
ENV LD\_LIBRARY\_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64
# nvidia-container-runtime
ENV NVIDIA\_VISIBLE\_DEVICES all
ENV NVIDIA\_DRIVER\_CAPABILITIES compute,utility
ENV NV\_CUDA\_LIB\_VERSION 10.2.89-1
ENV NV\_NVTX\_VERSION 10.2.89-1
ENV NV\_LIBNPP\_VERSION 10.2.89-1
ENV NV\_LIBCUBLAS\_PACKAGE\_NAME libcublas10
ENV NV\_LIBCUBLAS\_VERSION 10.2.2.89-1
ENV NV\_LIBCUBLAS\_PACKAGE ${NV\_LIBCUBLAS\_PACKAGE\_NAME}-${NV\_LIBCUBLAS\_VERSION}
ENV NV\_LIBNCCL\_PACKAGE\_NAME libnccl
ENV NV\_LIBNCCL\_PACKAGE\_VERSION 2.11.4-1
ENV NCCL\_VERSION 2.11.4
ENV NV\_LIBNCCL\_PACKAGE ${NV\_LIBNCCL\_PACKAGE\_NAME}-${NV\_LIBNCCL\_PACKAGE\_VERSION}+cuda10.2
RUN yum install -y \
cuda-libraries-10-2-${NV\_CUDA\_LIB\_VERSION} \
cuda-nvtx-10-2-${NV\_NVTX\_VERSION} \
cuda-npp-10-2-${NV\_LIBNPP\_VERSION} \
${NV\_LIBCUBLAS\_PACKAGE} \
${NV\_LIBNCCL\_PACKAGE}
ENV NV\_CUDA\_LIB\_VERSION 10.2.89-1
ENV NV\_NVPROF\_VERSION 10.2.89-1
ENV NV\_CUDA\_CUDART\_DEV\_VERSION 10.2.89-1
ENV NV\_NVML\_DEV\_VERSION 10.2.89-1
ENV NV\_LIBNPP\_DEV\_VERSION 10.2.89-1
ENV NV\_LIBCUBLAS\_DEV\_PACKAGE\_NAME libcublas-devel
ENV NV\_LIBCUBLAS\_DEV\_VERSION 10.2.2.89-1
ENV NV\_LIBCUBLAS\_DEV\_PACKAGE ${NV\_LIBCUBLAS\_DEV\_PACKAGE\_NAME}-${NV\_LIBCUBLAS\_DEV\_VERSION}
ENV NV\_LIBNCCL\_DEV\_PACKAGE\_NAME libnccl-devel
ENV NV\_LIBNCCL\_DEV\_PACKAGE\_VERSION 2.11.4-1
ENV NCCL\_VERSION 2.11.4
ENV NV\_LIBNCCL\_DEV\_PACKAGE ${NV\_LIBNCCL\_DEV\_PACKAGE\_NAME}-${NV\_LIBNCCL\_DEV\_PACKAGE\_VERSION}+cuda10.2
RUN yum install -y \
make \
cuda-nvml-dev-10-2-${NV\_NVML\_DEV\_VERSION} \
cuda-command-line-tools-10-2-${NV\_CUDA\_LIB\_VERSION} \
cuda-cudart-dev-10-2-${NV\_CUDA\_CUDART\_DEV\_VERSION} \
cuda-libraries-dev-10-2-${NV\_CUDA\_LIB\_VERSION} \
cuda-minimal-build-10-2-${NV\_CUDA\_LIB\_VERSION} \
cuda-nvprof-10-2-${NV\_NVPROF\_VERSION} \
cuda-npp-dev-10-2-${NV\_LIBNPP\_DEV\_VERSION} \
${NV\_LIBCUBLAS\_DEV\_PACKAGE} \
${NV\_LIBNCCL\_DEV\_PACKAGE} \
&& yum clean all \
&& rm -rf /var/cache/yum/\*
#RUN 执行以下命令
RUN yum install -y wget && yum clean all
#WORKDIR 相当于cd
WORKDIR /usr/local/app边栏推荐
- Stop supporting Huawei! Signing 640billion 5g orders in Germany and 270billion 5g orders in the Middle East is pure nonsense!
- 利用MySQL主从复制延迟拯救误删数据
- Relationship between standardization, normalization and regularization
- Methods of path related comments (I)
- [ctfshow web] deserialization
- The first self-developed embedded 40nm industrial scale memory chip in China was released, breaking the status quo that the localization rate is zero
- 【开发教程7】疯壳·开源蓝牙心率防水运动手环-电容触摸
- [flight control development basic tutorial 3] crazy shell · open source formation UAV - serial port (basic transceiver)
- OA项目之我的会议(会议排座&送审)
- Win11系统如何一键进行重装?
猜你喜欢

Detailed explanation of tcpdump command

【开发教程9】疯壳·ARM功能手机-I2C教程

Win11自动删除文件设置方法

Execution process of select statement in MySQL

Definition and relationship of derivative, differential, partial derivative, total derivative, directional derivative and gradient
![[basic course of flight control development 1] crazy shell · open source formation UAV GPIO (LED flight information light and signal light control)](/img/48/6dcaf4c9695d90e62036396cd81366.png)
[basic course of flight control development 1] crazy shell · open source formation UAV GPIO (LED flight information light and signal light control)

Recurrence of historical loopholes in ThinkPHP

In the first half of the year, sales increased by 10% against the trend. You can always trust Volvo, which is persistent and safe

Can TCP and UDP use the same port?

Win11 auto delete file setting method
随机推荐
PyQt5快速开发与实战 3.2 布局管理入门 and 3.3 Qt Designer实战应用
Reuse idea through registry
Create MySQL function: access denied; you need (at least one of) the SUPER privilege(s) for this operation
TCP 和 UDP 可以使用相同端口吗?
JD Sanmian: I want to query a table with tens of millions of data. How can I operate it?
[untitled]
Method and voltage setting of exciting vibrating wire sensor with hand-held vibrating wire collector
Advantages of time series database and traditional database
Shrimp Shope get commodity details according to ID API return value description
PXE高效批量网络装机
【飞控开发基础教程3】疯壳·开源编队无人机-串口(基础收发)
利用MySQL主从复制延迟拯救误删数据
Implementing DDD based on ABP -- aggregation and aggregation root practice
Mount NFS storage
The user experience center of Analysys Qianfan bank was established to help upgrade the user experience of the banking industry
Pytorch中的tensor操作
Review the past and know the new MySQL isolation level
"Green is better than blue". Why is TPC the last white lotus to earn interest with money
Implement softmax classification from zero sum using mxnet
Thoroughly uncover how epoll realizes IO multiplexing