Reputation: 184
I wrote a Dockerfile that builds my QT application and I'm having some problems on the build.
If the build command is on the Dockerfile, it trhows this error:
ninja: error: '/usr/lib/x86_64-linux-gnu/libnvcuvid.so', needed by 'bin/x64/release/*****/librtmpPlugin.so', missing and no known rule to make it
i added a symbolic link that solve this error on a temporary container:
ln -s /usr/local/nvidia/lib64/libnvcuvid.so.1 /usr/lib/x86_64-linux-gnu/libnvcuvid.so
But when i added that line and build-ed again, i still got the same error.
First i thought it was because some cache from dangling images but cleaning everything problem persist.
This is some of my ENV keys:
ENV LD_LIBRARY_PATH /usr/local/nvidia/lib:/usr/local/nvidia/lib64
ENV LIBRARY_PATH /usr/local/cuda/lib64/stubs:${LIBRARY_PATH}
ENV PATH /usr/local/nvidia/bin:/usr/local/cuda/bin:${PATH}
ENV OPENCL_HEADERS /usr/local/cuda/include
ENV LIBOPENCL /usr/local/cuda/lib64
ENV CUDA_TOOLKIT_ROOT_DIR /usr/local/cuda
ENV CUDA_NVCC_EXECUTABLE /usr/bin/nvcc
This are some of the 'hacks' that i did to remove other errors:
RUN mv /usr/lib/x86_64-linux-gnu/libOpenCL.so.1 /usr/lib/x86_64-inux-gnu/libOpenCL.so.1_old
RUN ln -s /usr/local/cuda/lib64/libOpenCL.so.1 /usr/lib/x86_64-linux-gnu/libOpenCL.so.1
RUN ln -s /usr/local/cuda-8.0/targets/x86_64-linux/lib/stubs/libcuda.so /usr/lib/x86_64-linux-gnu/libcuda.so
RUN ln -s /usr/local/cuda-8.0/targets/x86_64-linux/lib/stubs/libnvidia-ml.so /usr/lib/x86_64-linux-gnu/libnvidia-ml.so
I'm using nvidia cuda 8 image + nvidia docker on the last version, Docker version 17.03.1-ce.
I thought that there wasn't any difference between a Dockerfile compile process and the container runtime.
Upvotes: 0
Views: 5622
Reputation: 184
The image nvidia/cuda
doesn't come with the nvidia drivers
the way my software build scheme requires, so i had to install the drive equivalent of what nividia-smi
output showed.
apt-get install -y nvidia-381
I know i might have some problems on the future, but this is the way yo go now.
i also had to rename the libcuda.so
because nvidia-381 package have a lot of dependencies and removed the libcuda.so
from the CUDA packages and i started to get a lot of warnings.
RUN mv /usr/lib/x86_64-linux-gnu/libcuda.so /usr/lib/x86_64-linux-gnu/libcuda.so_old
RUN ln -s /usr/local/cuda-8.0/targets/x86_64-linux/lib/stubs/libcuda.so /usr/lib/x86_64-linux-gnu/libcuda.so
Upvotes: 2