Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker image #65

Open
mohammad-h-b opened this issue Feb 18, 2021 · 2 comments
Open

Docker image #65

mohammad-h-b opened this issue Feb 18, 2021 · 2 comments

Comments

@mohammad-h-b
Copy link

mohammad-h-b commented Feb 18, 2021

Hi developers,

Can you please provide a docker image with the right version of CUDA and gcc?

I have an RTX 2080 GPU and CUDA 11.2 and gcc 7.5.0.

@mohammad-h-b mohammad-h-b changed the title Dcoker image Docker image Feb 18, 2021
@oOXpycTOo
Copy link

oOXpycTOo commented Mar 18, 2021

I've created Dockerfile and it seems to work properly on K80 instance. Here it's:

FROM tobycheese/cuda:9.0-cudnn7-devel-ubuntu18.04

RUN apt-get update && apt-get install -y software-properties-common

RUN add-apt-repository ppa:deadsnakes/ppa -y

RUN apt-get update && apt-get install -y --no-install-recommends \
	git \
	tmux \
	nano \
        apt-utils \
        python3.6 \
        python3.6-dev \
        python3-pip \
        python3-setuptools \
        g++-6 \
        libsm6 \
        libxrender1 \
        libxtst6 \
        && \
    rm -rf /var/lib/apt/lists/* && \
    apt-get update
    
RUN update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-6 10 && \
    update-alternatives --set g++ /usr/bin/g++-6
RUN update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-6 10 && \
    update-alternatives --set gcc /usr/bin/gcc-6

RUN git clone https://github.com/NVlabs/planercnn.git

RUN cd planercnn && pip3 install -r requirements.txt && pip3 install h5py torch==0.4.0 -f https://download.pytorch.org/whl/cu92/torch_stable.html

RUN gcc -v && cat /usr/local/cuda/version.txt

RUN ls /usr/local | grep cuda

RUN cd planercnn && \
    cd nms/src/cuda/ && \
    nvcc -c -o nms_kernel.cu.o nms_kernel.cu -I /usr/local/cuda/include -x cu -Xcompiler -fPIC -arch=sm_37
RUN export LD_LIBRARY_PATH="/usr/local/cuda/include:$LD_LIBRARY_PATH" && \
    cd planercnn/nms && \
    sed -i 's|extra_objects=extra_objects|extra_objects=extra_objects,\n    include_dirs=["/usr/local/cuda/include"]|' build.py && \
    python3 build.py
RUN cd planercnn/roialign/roi_align/src/cuda && \
    nvcc -c -o crop_and_resize_kernel.cu.o crop_and_resize_kernel.cu -I /usr/local/cuda/include -x cu -Xcompiler -fPIC -arch=sm_37
RUN cd planercnn/roialign/roi_align && \
    export LD_LIBRARY_PATH="/usr/local/cuda-9.2/include:$LD_LIBRARY_PATH" && \
    sed -i 's|extra_compile_args=extra_compile_args|extra_compile_args=extra_compile_args,\n    include_dirs=["/usr/local/cuda/include"]|' build.py && \
    python3 build.py

RUN pip3 install torch==0.4.1 -f https://download.pytorch.org/whl/cu92/torch_stable.html

However, when you're inside docker you'll have to rerun compilation and build of nms and roi_align as GPU is not visible to the while building docker.

So, just run:

cd planercnn
cd nms/src/cuda/
nvcc -c -o nms_kernel.cu.o nms_kernel.cu -x cu -Xcompiler -fPIC -arch=[arch]
cd ../../
python build.py
cd ../


cd roialign/roi_align/src/cuda/
nvcc -c -o crop_and_resize_kernel.cu.o crop_and_resize_kernel.cu -x cu -Xcompiler -fPIC -arch=[arch]
cd ../../
python build.py
cd ../../

@GauravGajbhiye
Copy link

Hi @oOXpycTOo, I am using dockerfile created by you for "planercnn" project. I am having a system with 4 GPU's with Cuda 11.4.
While creating the image, I got following error for instruction RUN apt-get update && apt-get install -y software-properties-common:

W: GPG error: https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A4B469963BF863CC
E: The repository 'https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 InRelease' is not signed.
The command '/bin/sh -c apt-get update && apt-get install -y software-properties-common' returned a non-zero code: 100

I have tried a lot of experimentation but could not resolve it. Kindly help me to get out of it.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants