Skip to content

Commit

Permalink
use cupy base image
Browse files Browse the repository at this point in the history
  • Loading branch information
yosuke committed Dec 16, 2020
1 parent 4ea471a commit 415e413
Showing 1 changed file with 1 addition and 61 deletions.
62 changes: 1 addition & 61 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,64 +1,4 @@
FROM ros:melodic

ENV CUDA_VERSION 10.1.105
ENV CUDA_PKG_VERSION 10-1=$CUDA_VERSION-1
ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
ENV LD_LIBRARY_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES compute,utility,graphics
ENV NVIDIA_REQUIRE_CUDA "cuda>=10.1 brand=tesla,driver>=396,driver<397 brand=tesla,driver>=410,driver<411 brand=tesla,driver>=418,driver<419"
ENV NCCL_VERSION 2.4.8
ENV LIBRARY_PATH /usr/local/cuda/lib64/stubs
ENV CUDNN_VERSION 7.6.5.32

RUN apt-get update && apt-get install -y curl

RUN apt-get update && apt-get install -y --no-install-recommends \
gnupg2 curl ca-certificates && \
curl -fsSL https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub | apt-key add - && \
echo "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 /" > /etc/apt/sources.list.d/cuda.list && \
echo "deb https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64 /" > /etc/apt/sources.list.d/nvidia-ml.list

RUN apt-get update && apt-get install -y --no-install-recommends \
cuda-cudart-$CUDA_PKG_VERSION \
cuda-compat-10-1 \
&& ln -s cuda-10.1 /usr/local/cuda

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

RUN apt-get update && apt-get install -y --no-install-recommends \
cuda-libraries-$CUDA_PKG_VERSION \
cuda-npp-$CUDA_PKG_VERSION \
cuda-nvtx-$CUDA_PKG_VERSION \
libcublas10=10.2.1.243-1 \
libnccl2=$NCCL_VERSION-1+cuda10.1 \
&& apt-mark hold libnccl2

RUN apt-mark hold libcublas10

RUN apt-get update && apt-get install -y --no-install-recommends \
cuda-nvml-dev-$CUDA_PKG_VERSION \
cuda-command-line-tools-$CUDA_PKG_VERSION \
cuda-nvprof-$CUDA_PKG_VERSION \
cuda-npp-dev-$CUDA_PKG_VERSION \
cuda-libraries-dev-$CUDA_PKG_VERSION \
cuda-minimal-build-$CUDA_PKG_VERSION \
libcublas-dev=10.2.1.243-1 \
libnccl-dev=2.4.8-1+cuda10.1 \
&& apt-mark hold libnccl-dev

RUN apt-mark hold libcublas-dev

LABEL com.nvidia.cudnn.version="${CUDNN_VERSION}"

RUN apt-get update && apt-get install -y --no-install-recommends libcudnn7=$CUDNN_VERSION-1+cuda10.1 libcudnn7-dev=$CUDNN_VERSION-1+cuda10.1 && apt-mark hold libcudnn7

RUN curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py && python2 get-pip.py && rm get-pip.py && pip install -U pip

SHELL ["/bin/bash", "-c"]

RUN source ~/.bashrc && pip install -U cupy-cuda101==6.0.0 chainer==6.0.0 chainercv
FROM cupy/cupy:v6.0.0

COPY test.py /test.py

Expand Down

8 comments on commit 415e413

@devrt
Copy link

@devrt devrt bot commented on 415e413 Dec 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ€– Your commit has been accepted to devrt build system...

simulations:
  - name: wrschallenge
    type: challenge
    to: wrs2020-robocup

Accept your challenge to: WRS2020 RoboCup challenge πŸ†

@devrt
Copy link

@devrt devrt bot commented on 415e413 Dec 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ€– Clone success:

.
β”œβ”€β”€ [  80]  .devrt.yml
β”œβ”€β”€ [  65]  Dockerfile
└── [  36]  test.py

0 directories, 3 files

@devrt
Copy link

@devrt devrt bot commented on 415e413 Dec 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ€– Build success:

Sending build context to Docker daemon  63.49kB

Step 1/3 : FROM cupy/cupy:v6.0.0
 ---> f62c607db29e
Step 2/3 : COPY test.py /test.py
 ---> 1d0d2c259fc0
Step 3/3 : CMD python /test.py
 ---> Running in d721e085c3ad
Removing intermediate container d721e085c3ad
 ---> 54b058a64785
Successfully built 54b058a64785
Successfully tagged yosuke-test-cupy-415e413d31d4f1c2cc2b45e8bb73bf3fff299a11:latest

@devrt
Copy link

@devrt devrt bot commented on 415e413 Dec 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ€– Simulation finished:
score: 0
time: 7.362 [sec]
screen
Click here for high quality video

Traceback (most recent call last):
  File "/test.py", line 1, in <module>
    import cupy
  File "/usr/local/lib/python2.7/dist-packages/cupy/__init__.py", line 32, in <module>
    six.reraise(ImportError, ImportError(msg), exc_info[2])
  File "/usr/local/lib/python2.7/dist-packages/cupy/__init__.py", line 11, in <module>
    from cupy import core  # NOQA
  File "/usr/local/lib/python2.7/dist-packages/cupy/core/__init__.py", line 1, in <module>
    from cupy.core import core  # NOQA
ImportError: CuPy is not correctly installed.

If you are using wheel distribution (cupy-cudaXX), make sure that the version of CuPy you installed matches with the version of CUDA on your host.
Also, confirm that only one CuPy package is installed:
  $ pip freeze

If you are building CuPy from source, please check your environment, uninstall CuPy and reinstall it with:
  $ pip install cupy --no-cache-dir -vvvv

Check the Installation Guide for details:
  https://docs-cupy.chainer.org/en/latest/install.html

original error: libcuda.so.1: cannot open shared object file: No such file or directory

Full log

@devrt
Copy link

@devrt devrt bot commented on 415e413 Dec 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ€– Your commit has been accepted to devrt build system...

simulations:
  - name: wrschallenge
    type: challenge
    to: wrs2020-robocup

Accept your challenge to: WRS2020 RoboCup challenge πŸ†

@devrt
Copy link

@devrt devrt bot commented on 415e413 Dec 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ€– Clone success:

.
β”œβ”€β”€ [  80]  .devrt.yml
β”œβ”€β”€ [  65]  Dockerfile
└── [  36]  test.py

0 directories, 3 files

@devrt
Copy link

@devrt devrt bot commented on 415e413 Dec 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ€– Build success:

Sending build context to Docker daemon  63.49kB

Step 1/3 : FROM cupy/cupy:v6.0.0
 ---> f62c607db29e
Step 2/3 : COPY test.py /test.py
 ---> f909897ae288
Step 3/3 : CMD python /test.py
 ---> Running in fc7f2388e7f1
Removing intermediate container fc7f2388e7f1
 ---> cd6521607524
Successfully built cd6521607524
Successfully tagged yosuke-test-cupy-415e413d31d4f1c2cc2b45e8bb73bf3fff299a11:latest

@devrt
Copy link

@devrt devrt bot commented on 415e413 Dec 16, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ€– Simulation finished:
score: 0
time: 0 [sec]
screen
Click here for high quality video

6.0.0

Full log

Please sign in to comment.