I need to install Cuda, CuDNN, and NCCL in a singularity container to build the MXNET Library for GPU Support. Currently, I have this minimal Definition File:
Bootstrap: library
From: ubuntu:20.04
%environment
export CC=/usr/bin/gcc
export CXX=/usr/bin/g++
... some other stuff
%post
... some other installation stuff
apt-get install linux-headers-$(uname -r)
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/11.2.0/local_installers/cuda-repo-ubuntu2004-11-2-local_11.2.0-460.27.04-1_amd64.deb
dpkg -i cuda-repo-ubuntu2004-11-2-local_11.2.0-460.27.04-1_amd64.deb
apt-key add /var/cuda-repo-ubuntu2004-11-2-local/7fa2af80.pub
apt-get update
apt-get -y install cuda
export PATH=/usr/local/cuda-11.2/bin${PATH:+:${PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda-11.2/lib64
${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
/usr/bin/nvidia-persistenced --verbose
... clone and build mxnet
Installing Cuda is not a problem. However, in order to install CudNN, one first needs to log into an NVIDIA Account. Similarly, to install NCCL, one needs to complete a survey.
I obviously cannot do that per command line. But I can download these files beforehand. How can I access these files in %post
?
2
Answers
@tsnowlan gave a correct answer.
For the others wondering, how to get Cuda, CuDNN, and NCCL easily into an singularity container:
There are Docker images from NVidia, that already come with these tools: https://hub.docker.com/r/nvidia/cuda/tags
One can easily use these images as a base image for the docker container: https://docs.sylabs.io/guides/3.0/user-guide/build_a_container.html
You can use the
%files
section of the definition file. All files added there are available in%post
and, if not moved, are included in the final image.