similar issue in docker; I followed the key commands posted on the forum but still having the same issue
I have the following build followed by some additional RUN and COPY commands but the build fails
FROM nvidia/cuda:11.0-cudnn8-runtime-ubuntu18.04
RUN apt-get update && \
apt-get upgrade -y && \
apt-get install -y git lsb-core
RUN apt-key del 7fa2af80
RUN wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-keyring_1.0-1_all.deb
RUN dpkg -i cuda-keyring_1.0-1_all.deb
However the build still fails with a similar error as tho I have not rotated the key:
Sending build context to Docker daemon 43.94MB
#12 3.762 E: Failed to fetch https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/Packages.gz File has unexpected size (631054 != 481481). Mirror sync in progress? [IP: 152.199.20.126 443] #12 3.762 Hashes of expected file: #12 3.762 - Filesize:481481 [weak] #12 3.762 - SHA256:8556d67c6d380c957f05057f448d994584a135d7ed75e5ae6bb25c3fc1070b0b #12 3.762 - SHA1:c5ea9556407a3b5daec4aac530cd038e9b490441 [weak] #12 3.762 - MD5Sum:a5513131dbd2d4e50f185422ebb43ac9 [weak] #12 3.762 Release file created at: Mon, 25 Apr 2022 23:27:19 +0000 #12 3.762 E: Some index files failed to download. They have been ignored, or old ones used instead.
Here is the content of the sources.list cuda file, if this can somehow help :
#12 [ 9/15] RUN cat /etc/apt/sources.list.d/cuda-ubuntu2004-x86_64.list #12 sha256:2ffcda5a63c628ecf592fffe73cf2a6b382e4a7e1def1d0435adc54f47d84490 #12 0.443 deb [signed-by=/usr/share/keyrings/cuda-archive-keyring.gpg] Index of /compute/cuda/repos/ubuntu2004/x86_64 / #12 DONE 0.5s
UPDATE : The mirror sync seems finished, I do not have the error anymore
UPDATE 2 : I don’t know what I’m doing, maybe this doesn’t work after all
UPDATE 3 : I think that if the nvidia-ml.list isn’t removed it works anyway.
If you blow away the .lists, then I don’t think you need to install the key ring deb because you’re not even going to be using NVIDIA’s repositories anymore.
So you could just do…
RUN rm /etc/apt/sources.list.d/cuda.list
RUN rm /etc/apt/sources.list.d/nvidia-ml.list
When running RUN dpkg -i cuda-keyring_1.0-1_all.deb it adds a new list, having it and cuda.list created some conflicts. By removing it then adding the new one everything seems to be working.
I must say I’m not an expert, but it looks like it makes sense, no?
The recommended approach doesn’t work (it creates duplicated apt source). The alternate approach does. However, for a new cuda image, we also need to do the same for machine-learning repository. So this would work for a 18.04 cuda 10.2 image
I’m not an expert on this either. Is it asking too much for NVIDIA to push updated images that work with their current repository keys?
It looks like a slightly modified version of francis.toupins dockerfile steps is working for me. The 18.04 image doesn’t have wget and apt isn’t aware of it without running apt-get update which doesn’t work unless you delete the lists.
Yeah that looks legit. By removing the key and the lists before calling the update it seems to work. I’m still not sure if nvidia-ml.list needs to be removed though
FROM nvidia/cuda:10.2-cudnn8-runtime-ubuntu18.04
# RUN apt-key del 7fa2af80
RUN apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/3bf863cc.pub