Coder Social home page Coder Social logo

cuda-repo-management's Introduction

cuda repo management

License Contributing

Overview

Scripts for managing Debian and RPM package repositories containing many files.

See concept, metadata, and presentations sections below.

Table of Contents

Deliverables

This repo contains scripts to generate repository metadata for Debian and RPM packages:

  • apt-based distros (Debian or Ubuntu)
- Packages
- Packages.gz
- Release
- Release.gpg
  • dnf-based distros (RHEL >= 8 or Fedora >= 29)

note: modules.yaml requires genmodules.py

- repodata/repomd.xml
- repodata/repomd.xml.asc
- repodata/repomd.xml.key
- repodata/${sha256}-modules.yaml.gz
- repodata/${sha256}-primary.xml.gz
- repodata/${sha256}-primary.sqlite.bz2
- repodata/${sha256}-filelists.xml.gz
- repodata/${sha256}-filelists.sqlite.bz2
- repodata/${sha256}-other.xml.gz
- repodata/${sha256}-other.sqlite.bz2
  • yum-based distros (RHEL == 7) and zypper-based distros (openSUSE or SLES)
- repodata/repomd.xml
- repodata/repomd.xml.asc
- repodata/repomd.xml.key
- repodata/${sha256}-primary.xml.gz
- repodata/${sha256}-primary.sqlite.bz2
- repodata/${sha256}-filelists.xml.gz
- repodata/${sha256}-filelists.sqlite.bz2
- repodata/${sha256}-other.xml.gz
- repodata/${sha256}-other.sqlite.bz2

Demo

Demo

asciinema

Prerequisites

Clone this git repository

git clone https://github.com/NVIDIA/cuda-repo-management
cd cuda-repo-management

(Optional) fetch genmodules

note: genmodules.py is needed for generating modularity streams for NVIDIA driver packages

wget https://raw.githubusercontent.com/NVIDIA/yum-packaging-precompiled-kmod/main/genmodules.py

Install build dependencies

# RPM repos
yum install createrepo_c python3
# Debian repos
yum install dpkg-dev
# OverlayFS
yum install e2fsprogs rsync
# Misc that should already be installed
yum install bash coreutils util-linux gawk sed findutils file gzip

Usage

repo-overlay

Update multiples repos at once using OverlayFS to layer directories

./repo-overlay.sh --mirror=path/to/snapshot (--output=path/to/save) (--tempdir=path/to/workdir) path/to/repos
> ex: time ./repo-overlay.sh --mirror=/data/snapshot

repo-debian

Generate Debian package repository metadata using bash and dpkg

./repo-debian.sh --mirror=path/to/snapshot --input=path/to/repos --repo=$distro/$arch
> ex: time ./repo-debian.sh --mirror=/data/snapshot --input=$HOME/repos --repo=ubuntu1804/x86_64

repo-rpm

Generate RPM package repository metadata using createrepo_c

./repo-rpm.sh --mirror=path/to/snapshot --input=path/to/repos --repo=$distro/$arch
> ex: time ./repo-rpm.sh --mirror=/data/snapshot --input=$HOME/repos --repos=rhel8/sbsa

repo-mirror

Download Debian or RPM packages from an existing repository

./repo-mirror.sh --distro=$distro --arch=$arch (--version=$version) (--url=$repository) (--dryrun)
> ex: ./repo-mirror.sh --output=/data/snapshot --distro=sles15 --arch=x86_64

repo-validate

Verify that metadata matches RPM and Debian packages (filesize and SHA256 checksum)

./repo-validate.sh --mirror=path/to/snapshot (--distro=$distro) (--arch=$arch) (--dryrun)
> ex: ./repo-validate.sh --mirror=/data/snapshot --distro=rhel8 --arch=x86_64

Concept

Package managers do not scan repository directories (often served via HTTP/HTTPS), so from apt/dnf/yum/zypper's perspective whether a package exists or not, is defined by pre-generated metadata manifests. These metadata files provide Debian or RPM package availability information, which is used to resolve dependencies and for the selected files, determine the URLs to download.

Adding new packages to a repository requires re-generating this metadata. Using tools such as apt-ftparchive or createrepo_c, the full set of packages must be present in a single directory. This presents logistical challenges that involve copying thousands of large files around. Moreover, it lacks an elegant "undo" mechanism for iterative software development processes such as CI/CD pipelines.

OverlayFS

Union file-systems such as OverlayFS, allow temporary overlapping of directory hierarchies using mount points. These mounts can cross file-system boundaries and utilize copy-on-write (COW). In other words, non-destructive repository merges that can be rolled back with umount without the need for redundant file copying.

The mount syntax is layered right-to-left, with read-only (RO) lower layers, and one read-write (RW) upper layer.

sudo mount -t overlay -o \
     lowerdir=${layer3}:${layer2}:${layer1},\
     upperdir=${layer4}/upper,\
     workdir=${layer4}/workdir \
     none \
     /mnt/overlayfs

Caching strategy

Generating repository metadata for thousands of packages is CPU intensive and thus can take a very long time. Rather than building from scratch each time, old metadata can be re-used to reduce the workload.

Append-only

The repo-debian.sh script scans each Debian package in the directory, recording the key-value pair of filename and size (in bytes), to a variable. Then it parses Packages.gz for filename and size (in bytes) key-value pair and saves it to another variable. The two variables are compared using the comm command, which eliminates the duplicate entries. The remaining packages are processed using a combination of dpkg -I, du, and md5sum/sha1sum/sha256sum/sha512sum.

repodata

The createrepo_c command has an --update parameter to utilize existing RPM repository metadata in the repodata/ directory. This prints "CACHE HIT" when cache is successfully applies and "metadata are obsolete" when it detects a package mismatch requiring regenerating this data.

A wrinkle when this is used with OverlayFS is the repodata/ directory will only be available in the lower layer, as indicated by the error message "invalid cross-device link". The solution is to create a "write" operation, by moving the directory and then passing --update-md-path to specify the new location to scan for repodata/.

Metadata

A brief explanation of the format and contents of these repository metadata files.

Debian

The apt/apt-get package manager looks for ${repo}/InRelease and ${repo}/Release files as its entry-point. This contains a timestamp, repository flag options, and a list of package manifest files. For the latter filename, size in bytes, MD5sum, SHA1sum, and SHA256sum hashes are provided.

Release

The package manager compares the information found in Release with Packages to determine if there is corruption or tampering. Additionally the Release file is signed with a public-private GPG key pair and signature is detached as Release.gpg. This effectively signs the entire Debian package repository and requires clients to import the public GPG key to validate authenticity.

Origin: <Organization>
Label: <Repository Name>
Architecture: <x86_64|ppc64el|sbsa|cross-linux-sbsa>
Date: $(date -R --utc)
MD5Sum:
 $md5                $bytes Packages
 $md5                $bytes Packages.gz
SHA1:
 $sha1               $bytes Packages
 $sha1               $bytes Packages.gz
SHA256:
 $sha256             $bytes Packages
 $sha256             $bytes Packages.gz
Acquire-By-Hash: <no|yes>

The Release file references Packages and a gzipped copy Packages.gz

Packages.gz

Gzipped text file, containing blocks representing each package in the Debian repository. Blocks contain key-value pairs, such as Package:, Version:, and Depends:. For multi-line values (common for Depends and Description) start line with a space. Blocks are separated with an empty line.

Package: $name
Version: ${version}-${revision}
Architecture: <amd64|ppc64el|sbsa|all>
Priority: optional
Section: <$repotype>/<$category>
Maintainer: $user <$email>
Installed-Size: $extract_bytes
Depends: $packageA (>= $versionA), $packageB (>= $versionB), $packageC (>= $versionC)
Filename: ./${name}_${version}-${revision}_${arch}.deb
Size: $download_bytes
MD5sum: $md5
SHA1: $sha1
SHA256: $sha256
SHA512: $sha512
Description: What this package is used for.
 Prefix each additional line with a space. Longer description for search with `apt-cache`.
 Separate each package block with an empty line.

Package: ${packageA}
Version: ${versionA}-1
...
Beware, "here be dragons"

Some gotchas apply, for example the order of the package blocks affects dependency resolution. Chronological order (oldest โ†’ newest) release is recommended. Therefore if repo-debian.sh locates an existing Packages.gz manifest, it appends new blocks to the end.

Additionally, there is a convention to the order of the key-values, as generated by dpkg. Some unofficial package tools such as CMake do not follow this convention, which in some cases has lead to undocumented behavior. Again repo-debian.sh tries to follow this convention as closely as possible.


RPM

The yum/dnf and zypper package managers look for a ${repo}/repodata/repomd.xml file as its entry-point. This contains a list of package manifest files (SHA256-prefixed). Each <data> XML tag contains the unique filename, size in bytes, timestamp, and SHA256sum hash (both compressed and extracted).

The package manager uses this XML file to determine the locations of primary.{xml.gz,sqlite.bz2}, filelists.{xml.gz,sqlite.bz2}, other.{xml.gz,sqlite.bz2}, and optionally modules.yaml.gz. To be more CDN friendly, these RPM metadata files are prefixed with their SHA256 hash, such that the filename is unique, each time its contents have been modified.

repomd.xml

The repomd.xml file is signed with a public-private GPG key pair and signature is detached as repomd.xml.asc. Individual RPM packages must be signed but this is an additional layer to sign the RPM package repository metadata and requires clients to import the public GPG key (repomd.xml.key) to validate authenticity.

<?xml version="1.0" encoding="UTF-8"?>
<repomd xmlns=".../metadata/repo" xmlns:rpm=".../metadata/rpm">
  <revision>$epoch</revision>
  <data type="primary">
    <checksum type="sha256">$SHA256</checksum>
    <open-checksum type="sha256">$extract_SHA256</open-checksum>
    <location href="repodata/${SHA256}-primary.xml.gz"/>
    <timestamp>$epoch</timestamp>
    <size>$bytes</size>
    <open-size>$extract_bytes</open-size>
  </data>
  <data type="filelists">...</data>
  <data type="other">...</data>
  <data type="primary_db">...</data>
  <data type="filelists_db">...</data>
  <data type="other_db">
    <checksum type="sha256">$SHA256</checksum>
    <open-checksum type="sha256">$extract_SHA256</open-checksum>
    <location href="repodata/${SHA256}-other.sqlite.bz2"/>
    <timestamp>$epoch</timestamp>
    <size>$bytes</size>
    <open-size>$extract_bytes</open-size>
    <database_version>10</database_version>
  </data>
  <data type="modules">
    <checksum type="sha256">$SHA256</checksum>
    <open-checksum type="sha256">$extract_SHA256</open-checksum>
    <location href="repodata/${SHA256}-modules.yaml.gz"/>
    <timestamp>$epoch</timestamp>
    <size>$bytes</size>
    <open-size>$extract_bytes</open-size>
  </data>
</repomd>

primary.xml.gz

Gzipped XML file, containing <package> tags representing each package in the RPM repository. Contains package name, version, description, dependencies, SHA256 checksum, timestamp, size in bytes, etc. It is recommended to use createrepo_c to generate these files.

<?xml version="1.0" encoding="UTF-8"?>
<metadata xmlns=".../metadata/common" xmlns:rpm=".../metadata/rpm" packages="$pkgCount">
<package type="rpm">
  <name>$name</name>
  <arch>$arch</arch>
  <version epoch="1" ver="$version" rel="$release"/>
  <checksum type="sha256" pkgid="YES">$SHA256</checksum>
  <summary>Short description</summary>
  <description>Longer multi-line description</description>
  <time file="$epoch" build="$epoch"/>
  <size package="$bytes" installed="$bytes" archive="$bytes"/>
  <location href="${name}-${version}-${release}.${arch}.rpm"/>
  <format>
    <rpm:provides>
      <rpm:entry name="$SONAME()(64bit)"/>
    </rpm:provides>
    <rpm:requires>
      <rpm:entry name="$packageA"/>
    </rpm:requires>
  </format>
</package>
<package type="rpm">
  <name>$packageA</name>
...
</package>
</metadata>

modules.yaml

Multi-document YAML text file, with one document per modularity stream. Each stream contains timestamp, unique context identifier, list of package names available for that stream, and one or more modularity profiles. Streams are designated by branch (choose one) and profiles represent bundle use cases (install one or more sets). The genmodules.py script generates this metadata file if any packages containing the string nvidia-driver are present in the repository. It is then injected into repomd.xml using modifyrepo_c command.

document: modulemd
version: 2
data:
    name: $module
    stream: $stream
    version: $(date +%Y%m%d%H%M%S)
    context: $(echo $name $stream $version $distro | md5sum | cut -c -10)
    arch: $arch
    summary: Short description
    description: >-
        Long multi-line description.
    artifacts:
        rpms:
            - $packageA-$epoch:$version-$release.$arch
            - $packageB-$epoch:$version-$release.$arch
            - $packageC-$epoch:$version-$release.$arch
    profiles:
        $profile:
            description: Profile description
            rpms:
                - $packageA
                - $packageB
                - $packageC
...
---
document: modulemd
version: 2
data:
    name: $module
    stream: $streamB

Presentations

PackagingCon

Hi, PackagingCon attendees! Thank you very much, grateful for the opportunity to participate, please keep in touch ๐Ÿ˜„

Related

Precompiled kmod

Tarball and Zip Deliverables

See also

RHEL driver

Ubuntu driver

SUSE driver

Contributing

See CONTRIBUTING.md

cuda-repo-management's People

Contributors

amilonenv avatar kmittman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

cuda-repo-management's Issues

Question!

Hi there, I am currently running a sequencing program called Master of Pores, and I am using the NVIDIA Docker/Cuda Container process to be able to run my pipeline using the GPU. However, I keep running to the error below and I was wondering if anyone could help me decipher what it is trying to say and/or if it is related to a failure in setting the development environment for CUDA... (i am a student in bioinformatics! so my R knowledge is still pretty novel) Thanks in advance!
Original command line:

Command executed:
nextflow run mop_preprocess.nf -with-docker > test.txt

export LD_LIBRARY_PATH="/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/.singularity.d/libs"

guppy_basecaller -x "cuda:0" --fast5_out --flowcell FLO-MIN106 --kit SQK-RNA002 -i ./ --save_path ./wt---1_out --gpu_runners_per_device 1 --cpu_threads_per_caller 1 --num_callers 1
cat wt---1_out/.fastq >> wt---1.fastq
rm wt---1_out/
.fastq
gzip wt---1.fastq

Metadata issue with the CUDA repositories [CDN]

Reporting metadata issues with the CUDA repositories

Getting "File has unexpected size" issues when running apt update. This seems to be a known issue to NVIDIA CDNs, as NVIDIA mentions it here.

docker run -it nvidia/cuda:11.4.0-cudnn8-runtime-ubuntu18.04 bash
root@c1c86c02a768:/# apt update
Get:1 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64  InRelease [1581 B]
Get:2 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:3 http://archive.ubuntu.com/ubuntu bionic InRelease [242 kB]
Get:4 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64  Packages [814 kB]
Err:4 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64  Packages
  File has unexpected size (815853 != 814314). Mirror sync in progress? [IP: 152.195.19.142 443]
  Hashes of expected file:
   - Filesize:814314 [weak]
   - SHA256:257071ac3a46f8e8ba340c2bd6b88466ff26e4cb0c4b60afacfb267b251dc2d9
   - SHA1:4b2ecd5529c611f17784b07ed4cb2b13d5d4bd25 [weak]
   - MD5Sum:0355ef69bc6b6afaf8493d82295c3633 [weak]
  Release file created at: Mon, 11 Jul 2022 19:02:21 +0000

... (omitting successful fetches from other package index endpoints)

Fetched 25.6 MB in 3s (7382 kB/s)
Reading package lists... Done
E: Failed to fetch https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/Packages.gz  File has unexpected size (815853 != 814314). Mirror sync in progress? [IP: 152.195.19.142 443]
   Hashes of expected file:
    - Filesize:814314 [weak]
    - SHA256:257071ac3a46f8e8ba340c2bd6b88466ff26e4cb0c4b60afacfb267b251dc2d9
    - SHA1:4b2ecd5529c611f17784b07ed4cb2b13d5d4bd25 [weak]
    - MD5Sum:0355ef69bc6b6afaf8493d82295c3633 [weak]
   Release file created at: Mon, 11 Jul 2022 19:02:21 +0000
E: Some index files failed to download. They have been ignored, or old ones used instead.

Please provide the following information in your comment:

  1. When was the Release (Debian) or repomd.xml (RPM) file last modified ?

    root@c1c86c02a768:/# curl -I https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/Release
    HTTP/2 200
    accept-ranges: bytes
    age: 15211
    cache-control: max-age=604800
    content-type: application/octet-stream
    date: Tue, 12 Jul 2022 03:58:42 GMT
    etag: "64257053"
    expires: Tue, 19 Jul 2022 03:58:42 GMT
    last-modified: Mon, 11 Jul 2022 23:01:57 GMT
    server: ECAcc (sed/E12B)
    x-cache: HIT
    x-vdms-version: 3.0
    content-length: 696
  2. The Linux distro and architecture. If cross-compiling or containerized, please mention that.
    This is occurring within the latest Docker image nvidia/cuda:11.4.0-cudnn8-runtime-ubuntu18.04.

      root@c1c86c02a768:/# cat /etc/os-release
      NAME="Ubuntu"
      VERSION="18.04.6 LTS (Bionic Beaver)"
      ID=ubuntu
      ID_LIKE=debian
      PRETTY_NAME="Ubuntu 18.04.6 LTS"
      VERSION_ID="18.04"
      HOME_URL="https://www.ubuntu.com/"
      SUPPORT_URL="https://help.ubuntu.com/"
      BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
      PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
      VERSION_CODENAME=bionic
      UBUNTU_CODENAME=bionic
      root@c1c86c02a768:/# uname -a
      Linux c1c86c02a768 4.15.0-187-generic #198-Ubuntu SMP Tue Jun 14 03:23:51 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
  3. Which NVIDIA repositories do you have enabled ?
    Do your .list / .repo files contain URLs using HTTP (port 80) or HTTPS (port 443) ?

    root@c1c86c02a768:/etc/apt# cat sources.list.d/cuda.list
    deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64 /
    
  4. Which geographic region is the machine located in ?
    Seattle area

  5. Which CDN edge node are you hitting ?
    Not sure :/

  6. Any other relevant environmental conditions (i.e. a specific Docker container image) ?
    nvidia/cuda:11.4.0-cudnn8-runtime-ubuntu18.04

File has unexpected size 24 Apr 2024

          Hi, this seems issue seems to have happened again.
$ sudo apt clean && sudo apt update
...                                                                                                                                
Get:5 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64  InRelease [1,581 B]                                                                                                      
Get:6 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64  Packages [1,514 kB]                                                                                                      
Err:6 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64  Packages                                                                                                                 
  File has unexpected size (1503986 != 1514203). Mirror sync in progress? [IP: 152.199.39.144 443]
  Hashes of expected file:
   - Filesize:1514203 [weak]
   - SHA256:9e54bfbe25969feb55ca5f7cdb046d27999030c387acda3158365b49fa371e7b
   - SHA1:0d1c35de22a2d6a23a53b6182e70ace9969c9f82 [weak]
   - MD5Sum:42dc1149fac03f4507db422a01092a9e [weak]
  Release file created at: Wed, 24 Apr 2024 19:07:40 +0000

Originally posted by @kssalanio in #12 (comment)

Metadata issue with the CUDA repositories [CDN]

Reporting metadata issues with the CUDA repositories

I"m getting this error:

E: Failed to fetch http://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/./libcudnn8_8.4.0.27-1+cuda11.6_amd64.deb  Hash Sum mismatch
   Hashes of expected file:
    - SHA512:7b87539363c24637592ba6b1cdeedd8be7398581fcd50e41c7dadff23d78d76b9fe2ebf79e3d61caf1072233af4c68e6e447d377bdcbd79e4062a697e2896c84
    - SHA256:bce86fd8ad77bf95bd990323f45a7a6451a090158b5e666696cd97db90e36d07
    - SHA1:0be30ccd02d7cb3a15781e5520fb5bedd1e4bcae [weak]
    - MD5Sum:96b20781834657db00810b5aec5ea91d [weak]
    - Filesize:420893708 [weak]
   Hashes of received file:
    - SHA512:c658f12efb88c4b2d070f8d77ea06f4b0d77ecf9aecad79c1fd2ae07b2c1f90dfcff84128e175485bc65598f1c70c3297456f0f592aca9ab9ccfde4adf53dc74
    - SHA256:cdb3bacfa937b3e9dd70ca7dae3546130949d7083e217f193e6ef536bc7f7336
    - SHA1:d1b07490416aa94ffb4f92aaf464ab58125c7920 [weak]
    - MD5Sum:6e9076f4dc5f6940a7ec7a03f0adc7f8 [weak]
    - Filesize:420893708 [weak]
   Last modification reported: Fri, 01 Apr 2022 02:22:20 +0000
E: Failed to fetch http://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/./libcudnn8-dev_8.4.0.27-1+cuda11.6_amd64.deb  Hash Sum mismatch
   Hashes of expected file:
    - SHA512:84dfe741e51e7d8a94f032181f72f83b5d542c9e803b24e1ec09d08a99043ccacb88995edd04136863eabd14f9b6cb434e8d0c2804ecf2a5fc74585ab9d6bb88
    - SHA256:520951ed731b47b6dc1c52dcb026fbef6e46ec978cb72d7b73e7c10acf71b676
    - SHA1:ba67b389357e63aad328abfc3ed3ea2e46b27f58 [weak]
    - MD5Sum:4217ea5fce84562042a37800756f7337 [weak]
    - Filesize:449169686 [weak]
   Hashes of received file:
    - SHA512:5a7e09b5ec0bd072ce6c3fa20d85efd32c463e5fa3754c96f6550aeb03517db4ca7dc50c0342b04c98b0e35c58874d97a05fe6898fcdc025e2b52d7a089bd266
    - SHA256:69f36a5d9f4c1e4ab9c7d5ade283393f18f48391c3d04d302431358a399277ef
    - SHA1:6381018e33faa4808ac76794ae87ede5bfa41544 [weak]
    - MD5Sum:3dc3d0885a34bdc07982338d04a6bc50 [weak]
    - Filesize:449169686 [weak]
   Last modification reported: Fri, 01 Apr 2022 02:22:14 +0000
E: Failed to fetch http://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/./libnvinfer8_8.2.4-1+cuda11.4_amd64.deb  File has unexpected size (165713192 != 165713158). Mirror sync in progress? [IP: 152.195.19.142 80]
   Hashes of expected file:
    - SHA512:473f45e75265ff81985701073ca866195cfbba3b2deebe403110de023f5bebbae0c3885af558c6f1fe650b43a18fabc06bbe664e94025bfc35897659c4b6d255
    - SHA256:325223c798a0fc2133f406b5235198be6fa830b2d69af540e2549dc95f9bf96a
    - SHA1:c6f216c28a0a95e14a98091e443e5fbb48c7a48c [weak]
    - MD5Sum:470dba7aaba556ee20a2f53e1d91497e [weak]
    - Filesize:165713158 [weak]
E: Failed to fetch http://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/./libnvinfer-dev_8.2.4-1+cuda11.4_amd64.deb  File has unexpected size (193455032 != 193454998). Mirror sync in progress? [IP: 152.195.19.142 80]
   Hashes of expected file:
    - SHA512:6b702dd43a419794a3a7e2920cb418cc7ae4edd84beda1e05c18c54ce607ed17a9e1bbf7ab387667a9684e79e839872fe4ca00c496ef68eb270fb901b21247b3
    - SHA256:07808a272db98427d45be2f3ccb628fd4480a210b462f9c15099d264b25f719e
    - SHA1:f0de0575f17372c9eea9634d9a9df8654ef7b765 [weak]
    - MD5Sum:1b97387a8a25804b54bdae2b289e657c [weak]
    - Filesize:193454998 [weak]
E: Failed to fetch http://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/./libnvinfer-plugin8_8.2.4-1+cuda11.4_amd64.deb  File has unexpected size (12353384 != 12353348). Mirror sync in progress? [IP: 152.195.19.142 80]
   Hashes of expected file:
    - SHA512:5cdb7f1e15bc6606604b24ee6a35f9642b73b1dc352833d5f362fc5667d56e09057be792994b4ff4e6d58316915b3a0b7a98cf079f458fbdffff2df0e69fb5f7
    - SHA256:c2c256c8caa603787680d120d71190b75fcdbfb300e296bf5d3600adb9295581
    - SHA1:c3644a5ccd1d41705a81faa63d88b87691024528 [weak]
    - MD5Sum:017d32e74095790e16ab5237a4e79cee [weak]
    - Filesize:12353348 [weak]
E: Failed to fetch http://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/./libnvinfer-plugin-dev_8.2.4-1+cuda11.4_amd64.deb  File has unexpected size (12096452 != 12096416). Mirror sync in progress? [IP: 152.195.19.142 80]
   Hashes of expected file:
    - SHA512:c1c77200d9029f3ada6f3d1c3616ee42bb816d7f86432383792b5b75f21b9c1ba69cd469f869e841d5e20bdf7f181dbd64556c60303198c7ae502ea3d3a1e953
    - SHA256:4eb65fcd1ae0d1751447858baed6d4efaa96451a5a2c1c54d4088bd60571d971
    - SHA1:3293ff269f979f56ab12a8ca55dde00f409be74b [weak]
    - MD5Sum:1d8744a22770116c08dde206aca3d6cd [weak]
    - Filesize:12096416 [weak]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

Please provide the following information in your comment:

  1. The error message and the last command(s) run.
sudo apt install libnvinfer8 libnvinfer-dev libnvinfer-plugin-dev -oAcquire::AllowInsecureRepositories=true
  1. When was the Release (Debian) or repomd.xml (RPM) file last modified ?
curl -I https://developer.download.nvidia.com/compute/cuda/repos/$distro/$arch/Release
HTTP/2 404 
cache-control: max-age=604800
content-type: text/html
date: Sun, 09 Oct 2022 03:23:41 GMT
expires: Sun, 16 Oct 2022 03:23:41 GMT
server: EOS (vny/0453)
content-length: 445
curl -I https://developer.download.nvidia.com/compute/cuda/repos/$distro/$arch/repodata/repomd.xml
HTTP/2 404 
cache-control: max-age=604800
content-type: text/html
date: Sun, 09 Oct 2022 03:24:17 GMT
expires: Sun, 16 Oct 2022 03:24:17 GMT
server: EOS (vny/0454)
content-length: 445

  1. The Linux distro and architecture. If cross-compiling or containerized, please mention that.
NAME="Ubuntu"
VERSION="20.04.5 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.5 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

Linux abs 5.15.0-48-generic #54~20.04.1-Ubuntu SMP Thu Sep 1 16:17:26 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
  1. Which NVIDIA repositories do you have enabled ?
deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 /
deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 /
deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://nvidia.github.io/libnvidia-container/stable/ubuntu18.04/$(ARCH) /
Port 80 / HTTP
  1. Which geographic region is the machine located in ?
US (West Coast)
  1. Which CDN edge node are you hitting ?
ping developer.download.nvidia.com
PING cs500.wpc.phicdn.net (152.195.19.142) 56(84) bytes of data.
  1. Any other relevant environmental conditions (i.e. a specific Docker container image) ?
None

Receiving error about Packages.gz being the incorrect size

Ubuntu 20.04
When running apt-get update I receive the following error.
`Get:12 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 Packages [481 kB]
Err:12 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 Packages
File has unexpected size (631054 != 481481). Mirror sync in progress? [IP: 152.195.19.142 443]
Hashes of expected file:

  • Filesize:481481 [weak]
  • SHA256:8556d67c6d380c957f05057f448d994584a135d7ed75e5ae6bb25c3fc1070b0b
  • SHA1:c5ea9556407a3b5daec4aac530cd038e9b490441 [weak]
  • MD5Sum:a5513131dbd2d4e50f185422ebb43ac9 [weak]
    Release file created at: Mon, 25 Apr 2022 23:27:19 +0000
    Fetched 1575 B in 1s (1818 B/s)
    Reading package lists... Done
    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.195.19.142 443]
    Hashes of expected file:
    - Filesize:481481 [weak]
    - SHA256:8556d67c6d380c957f05057f448d994584a135d7ed75e5ae6bb25c3fc1070b0b
    - SHA1:c5ea9556407a3b5daec4aac530cd038e9b490441 [weak]
    - MD5Sum:a5513131dbd2d4e50f185422ebb43ac9 [weak]
    Release file created at: Mon, 25 Apr 2022 23:27:19 +0000
    E: Some index files failed to download. They have been ignored, or old ones used instead.`

I've already run apt-get clean however the error persists.
When I manually download the Packages.gz file it shows the correct size
`wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/Packages.gz
--2022-04-28 11:45:29-- https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/Packages.gz
Resolving developer.download.nvidia.com (developer.download.nvidia.com)... 152.195.19.142
Connecting to developer.download.nvidia.com (developer.download.nvidia.com)|152.195.19.142|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 631054 (616K) [application/x-gzip]
Saving to: 'Packages.gz'

Packages.gz 100%[===============================================================================>] 616.26K --.-KB/s in 0.008s

2022-04-28 11:45:29 (72.5 MB/s) - 'Packages.gz' saved [631054/631054]`

I've waited several hours to see if it was truly a mirror issue however the error still persist. I've also tried this on multiple servers with the same result.

E: Failed to fetch https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/Packages.gz

Reporting metadata issues with the CUDA repositories

After running a apt-get update I get the error message:

E: Failed to fetch https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/Packages.gz  File has unexpected size (1127072 != 1126689). Mirror sync in progress? [IP: 152.199.20.126 443]
   Hashes of expected file:
    - Filesize:1126689 [weak]
    - SHA256:7cee2584ca6d97b2f07018ba4f9c3c473fb4e299ed170968a1f8c99c090cc59f
    - SHA1:4ee24fac5518a3fcc3702590a0dab32c95484c54 [weak]
    - MD5Sum:593faff511765d11055c9919bf2e3bf8 [weak]
   Release file created at: Thu, 17 Aug 2023 19:03:05 +0000
E: Some index files failed to download. They have been ignored, or old ones used instead.

Running the command from point 2 resulted in:

HTTP/2 404 
cache-control: max-age=604800
content-type: text/html
date: Fri, 18 Aug 2023 08:11:04 GMT
expires: Fri, 25 Aug 2023 08:11:04 GMT
server: EOS (vny/0453)
content-length: 433

I'm running Ubuntu 20.04 and am in central europe:

NAME="Ubuntu"
VERSION="20.04.6 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.6 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal

Linux l3dss1602 5.15.0-79-generic #86~20.04.2-Ubuntu SMP Mon Jul 17 23:27:17 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

and the failing repository inside the .list looks the following:

deb [signed-by=/usr/share/keyrings/cuda-archive-keyring.gpg] https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /

Please let me know if you require further information!

apt update does not work on nvidia/cuda:12.3.2-devel-ubuntu22.04

  1. The error message and the last command(s) run.
    I have troubles with apt update within a container. I run the container using this command : docker run -it --runtime=nvidia --gpus all nvidia/cuda:12.3.2-devel-ubuntu22.04 bash then did a apt update. Here is the following error :
$ apt update
Ign:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Ign:2 http://security.ubuntu.com/ubuntu jammy-security InRelease
Ign:3 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64  InRelease
Ign:4 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Ign:2 http://security.ubuntu.com/ubuntu jammy-security InRelease
Ign:3 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64  InRelease
Ign:5 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Ign:2 http://security.ubuntu.com/ubuntu jammy-security InRelease
Ign:3 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64  InRelease
Ign:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Err:2 http://security.ubuntu.com/ubuntu jammy-security InRelease
  Temporary failure resolving 'security.ubuntu.com'
Err:3 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64  InRelease
  Temporary failure resolving 'developer.download.nvidia.com'
Ign:4 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Ign:5 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Ign:1 http://archive.ubuntu.com/ubuntu jammy InRelease
Ign:4 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Ign:5 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Err:1 http://archive.ubuntu.com/ubuntu jammy InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Err:4 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Err:5 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
  Temporary failure resolving 'archive.ubuntu.com'
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/jammy-backports/InRelease  Temporary failure resolving 'archive.ubuntu.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/jammy-security/InRelease  Temporary failure resolving 'security.ubuntu.com'
W: Failed to fetch https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/InRelease  Temporary failure resolving 'developer.download.nvidia.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
  1. When was the Release (Debian) or repomd.xml (RPM) file last modified ?
$ curl -I https://developer.download.nvidia.com/compute/cuda/repos/$distro/$arch/Release
HTTP/2 404
cache-control: max-age=604800
content-type: text/html
date: Fri, 19 Apr 2024 10:02:11 GMT
expires: Fri, 26 Apr 2024 10:02:11 GMT
server: EOS (vny/0451)
content-length: 433
$ curl -I https://developer.download.nvidia.com/compute/cuda/repos/$distro/$arch/repodata/repomd.xml
HTTP/2 404
cache-control: max-age=604800
content-type: text/html
date: Fri, 19 Apr 2024 10:03:02 GMT
expires: Fri, 26 Apr 2024 10:03:02 GMT
server: EOS (vny/044E)
content-length: 433
  1. My Linux distro and architecture.
$ cat /etc/os-release
NAME="Manjaro Linux"
PRETTY_NAME="Manjaro Linux"
ID=manjaro
ID_LIKE=arch
BUILD_ID=rolling
ANSI_COLOR="32;1;24;144;200"
HOME_URL="https://manjaro.org/"
DOCUMENTATION_URL="https://wiki.manjaro.org/"
SUPPORT_URL="https://forum.manjaro.org/"
BUG_REPORT_URL="https://docs.manjaro.org/reporting-bugs/"
PRIVACY_POLICY_URL="https://manjaro.org/privacy-policy/"
LOGO=manjarolinux
$ uname -a
Linux desktop-linux 6.6.26-1-MANJARO #1 SMP PREEMPT_DYNAMIC Wed Apr 10 20:11:08 UTC 2024 x86_64 GNU/Linux

At the time I post this, nvidia-container-toolkit and libnvidia-container are not yet available in Manjaro stable packages (and removed from the AUR) but are available for Arch Linux stable packages so I installed them using Archlinux archives this way :

sudo pacman -U https://archive.archlinux.org/packages/l/libnvidia-container/libnvidia-container-1.14.6-4-x86_64.pkg.tar.zst https://archive.archlinux.org/packages/n/nvidia-container-toolkit/nvidia-container-toolkit-1.14.6-4-x86_64.pkg.tar.zst

By the way, I also give you the CUDA version and my GPU Drivers :

$ nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2023 NVIDIA Corporation
Built on Wed_Nov_22_10:17:15_PST_2023
Cuda compilation tools, release 12.3, V12.3.107
Build cuda_12.3.r12.3/compiler.33567101_0

$ nvidia-smi
Fri Apr 19 12:17:32 2024
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 550.67                 Driver Version: 550.67         CUDA Version: 12.4     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 2070        Off |   00000000:01:00.0 Off |                  N/A |
|  0%   29C    P8             22W /  175W |     323MiB /   8192MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A       563      G   /usr/lib/Xorg                                 213MiB |
|    0   N/A  N/A       679      G   /usr/bin/ksmserver                              2MiB |
|    0   N/A  N/A       681      G   /usr/bin/kded5                                  2MiB |
|    0   N/A  N/A       682      G   /usr/bin/kwin_x11                               5MiB |
|    0   N/A  N/A       708      G   /usr/bin/plasmashell                           31MiB |
|    0   N/A  N/A       733      G   ...b/polkit-kde-authentication-agent-1          2MiB |
|    0   N/A  N/A       735      G   /usr/lib/xdg-desktop-portal-kde                 2MiB |
|    0   N/A  N/A       850      G   /usr/lib/kdeconnectd                            2MiB |
|    0   N/A  N/A       879      G   /usr/bin/msm_kde_notifier                       2MiB |
|    0   N/A  N/A       901      G   /usr/bin/kaccess                                2MiB |
|    0   N/A  N/A       904      G   /usr/bin/pamac-tray-plasma                      2MiB |
|    0   N/A  N/A      1385      G   /usr/lib/kscreenlocker_greet                   46MiB |
+-----------------------------------------------------------------------------------------+
  1. Which NVIDIA repositories do you have enabled ?
    I don't understand the question but I could not find anything about this in the documentation.

  2. Which geographic region is the machine located in ?
    Paris, France

  3. Any other relevant environmental conditions (i.e. a specific Docker container image) ?
    nvidia/cuda:12.3.2-devel-ubuntu22.04

I am not sure if I have to post that here or open an issue on https://gitlab.com/nvidia/container-images/cuda/-/issues
Thanks in advance for your help.

RHEL 8 x86_64 repository wrong package file size

Starting recently (exact point in time is unknown) syncing the rhel8/x86_64 repository (http://developer.download.nvidia.com/compute/cuda/repos/rhel8/x86_64) fails:

Error message:

[MIRROR] cuda-compat-10-1-418.226.00-1.x86_64.rpm: Interrupted by header callback: Server reports Content-Length: 5713804 but expected size is: 5713800
[FAILED] cuda-compat-10-1-418.226.00-1.x86_64.rpm: No more mirrors to try - All mirrors were already tried without success

Downloading the file its size is indeed 5713804.
Checking the files signature and MD5:

rpm -Kv cuda-compat-10-1-418.226.00-1.x86_64.rpm 
cuda-compat-10-1-418.226.00-1.x86_64.rpm:
    Header V4 RSA/SHA512 Signature, key ID 7fa2af80: OK
    Header SHA256 digest: OK
    Header SHA1 digest: OK
    Payload SHA256 digest: OK
    V4 RSA/SHA512 Signature, key ID 7fa2af80: OK
    MD5 digest: OK

The same happens trying to download or install this package using dnf:

dnf download cuda-compat-10-1-418.226.00-1.x86_64
Last metadata expiration check: 0:00:08 ago on 2021-11-11T14:08:02 CET.
[MIRROR] cuda-compat-10-1-418.226.00-1.x86_64.rpm: Interrupted by header callback: Server reports Content-Length: 5713804 but expected size is: 5713800
[MIRROR] cuda-compat-10-1-418.226.00-1.x86_64.rpm: Interrupted by header callback: Server reports Content-Length: 5713804 but expected size is: 5713800
[MIRROR] cuda-compat-10-1-418.226.00-1.x86_64.rpm: Interrupted by header callback: Server reports Content-Length: 5713804 but expected size is: 5713800
[MIRROR] cuda-compat-10-1-418.226.00-1.x86_64.rpm: Interrupted by header callback: Server reports Content-Length: 5713804 but expected size is: 5713800
[FAILED] cuda-compat-10-1-418.226.00-1.x86_64.rpm: No more mirrors to try - All mirrors were already tried without success

I assume there is some error with the repodata?

[Closed] GPG key rotation

Mega thread for reporting metdata issues with the CUDA repositories

Is the CDN stale? Have you seen something like:

E: Failed to fetch *.deb  Hash Sum mismatch
   Hashes of expected file:
    - SHA512:$sha512, SHA256:$sha256, SHA1:$sha1 [weak], MD5Sum:$md5 [weak], Filesize:$bytes [weak]
   Hashes of received file:
    - SHA512:$sha512, SHA256:$sha256, SHA1:$sha1 [weak], MD5Sum:$md5 [weak], Filesize:$bytes [weak]
   Last modification reported: $(date -R --utc)

or

*.rpm: Downloading successful, but checksum doesn't match. 
Calculated: $sha256(sha256)  
Expected: $sha256(sha256)

Please provide the following information in your comment:

  1. The error message and the last command(s) run.

  2. When was the Release (Debian) or repomd.xml (RPM) file last modified ?

    $ curl -I https://developer.download.nvidia.com/compute/cuda/repos/$distro/$arch/Release
    $ curl -I https://developer.download.nvidia.com/compute/cuda/repos/$distro/$arch/repodata/repomd.xml
  3. The Linux distro and architecture. If cross-compiling or containerized, please mention that.

    $ cat /etc/os-release
    $ uname -a
  4. Which NVIDIA repositories do you have enabled ?
    Do your .list / .repo files contain URLs using HTTP (port 80) or HTTPS (port 443) ?

  5. Which geographic region is the machine located in ?

  6. Which CDN edge node are you hitting ?

  7. Any other relevant environmental conditions (i.e. a specific Docker container image) ?

GPG signing key rotation for CUDA repositories

Blog post

Forum post

To best ensure the security and reliability of our RPM and Debian package repositories, NVIDIA is updating and rotating the GPG signing keys used by apt, dnf/yum, and zypper package managers. Failure to update your repository signing keys will result in package management errors when attempting to access or install packages from the CUDA repositories.

The new GPG public keys for the CUDA repository

To ensure continued access to the latest NVIDIA software, please complete the following steps:

For Debian-based distributions, including Ubuntu, replace $distro/$arch in the following commands with appropriate value

amd64 POWER arm64 server arm64 cross target
debian10/x86_64
debian11/x86_64
ubuntu1604/x86_64
ubuntu1804/x86_64 ubuntu1804/ppc64el ubuntu1804/sbsa ubuntu1804/cross-linux-sbsa
ubuntu2004/x86_64 ubuntu2004/sbsa ubuntu2004/cross-linux-sbsa
ubuntu2204/x86_64 ubuntu2204/sbsa
wsl-ubuntu/x86_64

For RPM-based distributions, including SUSE, replace $distro/$arch in the following commands with appropriate value

amd64 POWER arm64 server arm64 cross target
fedora32/x86_64
fedora33/x86_64
fedora34/x86_64
fedora35/x86_64
opensuse15/x86_64
rhel7/x86_64 rhel7/ppc64le
rhel8/x86_64 rhel8/ppc64le rhel8/sbsa rhel8/cross-linux-sbsa
sles15/x86_64 sles15/sbsa sles15/cross-linux-sbsa

Remove Outdated Signing Key

  • Debian, Ubuntu, WSL

    $ sudo apt-key del 7fa2af80
  • Fedora, RHEL, openSUSE, SLES

     $ sudo rpm --erase gpg-pubkey-7fa2af80*

Install New Key (Debian-based distros)

Method 1: cuda-keyring package

To avoid the need for manual key installation steps, NVIDIA is providing a new helper package that will automate the installation of new signing keys for the NVIDIA repositories.

$ wget https://developer.download.nvidia.com/compute/cuda/repos/$distro/$arch/cuda-keyring_1.0-1_all.deb
$ sudo dpkg -i cuda-keyring_1.0-1_all.deb

Method 2: apt-key (deprecated)

$ sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/$distro/$arch/3bf863cc.pub

Method 3: wget and mv

$ wget https://developer.download.nvidia.com/compute/cuda/repos/$distro/$arch/cuda-$distro-keyring.gpg
$ sudo mv cuda-$distro-keyring.gpg /usr/share/keyrings/cuda-archive-keyring.gpg
$ echo "deb [signed-by=/usr/share/keyrings/cuda-archive-keyring.gpg] https://developer.download.nvidia.com/compute/cuda/repos/$distro/$arch/ /" | sudo tee /etc/apt/sources.list.d/cuda-$distro-$arch.list

Install New Key (RPM-based distros)

On fresh installation Fedora, RHEL, openSUSE, or SLES the dnf/yum/zypper package manager will prompt the user to accept new keys when installing packages the first time. Indicate you accept the change when prompted: y

For upgrades existing installations, you must additionally complete the following (package manager specific) step to pick up the new key:

Fedora and RHEL 8

$ sudo dnf config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/$distro/$arch/cuda-$distro.repo

RHEL 7

$ sudo yum-config-manager --add-repo https://developer.download.nvidia.com/compute/cuda/repos/rhel7/$arch/cuda-rhel7.repo

openSUSE and SLES

$ sudo zypper removerepo cuda-$distro-$arch
$ sudo zypper addrepo https://developer.download.nvidia.com/compute/cuda/repos/$distro/$arch/cuda-$distro.repo

Example error messages

apt-get

Reading package lists... Done
W: GPG error: http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64  InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY A4B469963BF863CC
W: The repository 'http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64  InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.

dnf and yum

warning: /var/cache/dnf/cuda-fedora32-x86_64-d60aafcddb176bf5/packages/libnvjpeg-11-1-11.3.0.105-1.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID d42d0685: NOKEY
cuda-fedora32-x86_64                                                                                  23 kB/s | 1.6 kB     00:00    
Importing GPG key 0x7FA2AF80:
 Userid     : "cudatools <[email protected]>"
 Fingerprint: AE09 FE4B BD22 3A84 B2CC FCE3 F60F 4B3D 7FA2 AF80
 From       : https://developer.download.nvidia.com/compute/cuda/repos/fedora32/x86_64/7fa2af80.pub
Is this ok [y/N]: y
Key imported successfully
Import of key(s) didn't help, wrong key(s)?
Public key for libnvjpeg-11-1-11.3.0.105-1.x86_64.rpm is not installed. Failing package is: libnvjpeg-11-1-11.3.0.105-1.x86_64
 GPG Keys are configured as: https://developer.download.nvidia.com/compute/cuda/repos/fedora32/x86_64/7fa2af80.pub
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
Error: GPG check FAILED

zypper

New repository or package signing key received:

  Repository:       cuda-opensuse15-x86_64
  Key Fingerprint:  610C 7B14 E068 A878 070D A4E9 9CD0 A493 D42D 0685
  Key Name:         cudatools <[email protected]>
  Key Algorithm:    RSA 4096
  Key Created:      Thu Apr 14 22:04:01 2022
  Key Expires:      (does not expire)
  Rpm Name:         gpg-pubkey-d42d0685-62589a51



    Note: Signing data enables the recipient to verify that no modifications occurred after the data
    were signed. Accepting data with no, wrong or unknown signature can lead to a corrupted system
    and in extreme cases even to a system compromise.

    Note: A GPG pubkey is clearly identified by it's fingerprint. Do not rely the keys name. If you
    are not sure whether the presented key is authentic, ask the repository provider or check his
    web site. Many provider maintain a web page showing the fingerprints of the GPG keys they are
    using.

Do you want to reject the key, trust temporarily, or trust always? [r/t/a/?] (r): a

Install from debian remote repository with packages that reference relative urls (e.g. /./) fails, nvidia, cuda, dcgm

We are using Artifactory to host an internal caching remote for the cuda debian repository.
But we run into an issue while actually trying to get a package.

We created an initial issue here:
https://jfrog.atlassian.net/browse/RTFACT-24926

Another developer has also ran into the same issue, and his finding suggest the actual main cause is the incorrect use of relative urls inside the Packages file

Failed to fetch https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/sbsa/Packages.gz

Reporting metadata issues with the CUDA repositories

On ubuntu20.04 ARM arch host, after running a apt-get update I get the error message:

root@44b9360bf34b:/# apt update
Get:1 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/sbsa InRelease [1579 B]
Hit:2 http://archive.ubuntu.com/ubuntu jammy InRelease
Get:3 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/sbsa Packages [845 kB]
Err:3 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/sbsa Packages
File has unexpected size (844033 != 845178). Mirror sync in progress? [IP: 152.195.19.142 443]
Hashes of expected file:

Filesize:845178 [weak]
SHA256:fe759d93d14c12c9dec632ce6e96d2185542c3067280039887ebdb80b55e0cfd
SHA1:62371733f3a41fe641a7e4718e38fa2c17acc88f [weak]
MD5Sum:0827c21254d207977202bba3eabe6a75 [weak]
Release file created at: Fri, 09 Feb 2024 00:02:51 +0000
Hit:4 http://archive.ubuntu.com/ubuntu jammy-updates InRelease
Hit:5 http://security.ubuntu.com/ubuntu jammy-security InRelease
Hit:6 http://archive.ubuntu.com/ubuntu jammy-backports InRelease
Fetched 1579 B in 0s (3329 B/s)
Reading package lists... Done
W: https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/sbsa/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details.
E: Failed to fetch https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/sbsa/Packages.gz File has unexpected size (844033 != 845178). Mirror sync in progress? [IP: 152.195.19.142 443]
Hashes of expected file:
Filesize:845178 [weak]
SHA256:fe759d93d14c12c9dec632ce6e96d2185542c3067280039887ebdb80b55e0cfd
SHA1:62371733f3a41fe641a7e4718e38fa2c17acc88f [weak]
MD5Sum:0827c21254d207977202bba3eabe6a75 [weak]
Release file created at: Fri, 09 Feb 2024 00:02:51 +0000
E: Some index files failed to download. They have been ignored, or old ones used instead.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.