TT Lab
Get started
Learn Learning paths Courses

Air-Gapped GPU Driver Installation

Untangling the Dependency Graph

Continue in TT Lab

Goal

From a package bundle assumed to have been imported, you resolve the dependency graph, find the dependencies that are not resolved inside the bundle, and produce the installation order.

Why it matters

The most expensive mistake in an air-gapped network is "we imported it but the dependencies were insufficient, so it has to go out again." If import review is once a day, one round trip is a day. So before importing, you must check whether the bundle closes within itself (closure). And if you do not know the Provides relationship, you end up wandering around searching for a nonexistent package, saying "libcuda1 is not in the repository."

/opt/fixtures/gpu-airgap/src/ holds the source tree of the first import batch. It is not actual NVIDIA software, but the shape of the dependency graph is the same as the real one.

Steps

  1. Create the /root/gpu directory, and write the 이름 버전 (the fields are the name and the version) of every package under /opt/fixtures/gpu-airgap/src/, one per line, in /root/gpu/inventory.txt. It must be 14 lines.
  2. Build every source directory into a .deb and collect them in /root/gpu/pool/. There must be 14 .deb files.
  3. Create a Packages index and Packages.gz in /root/gpu/pool. The index must have 14 Package: entries.
  4. Write the dependency relationships of each package, one per line, in /root/gpu/edges.txt in the form <패키지> <의존대상> (the placeholders are the package and the dependency target). Omit version conditions and write only names. It must be at least 15 lines.
  5. In /root/gpu/missing.txt, write only the names of dependencies that are not resolved inside the bundle. (Those for which there is no package of that name in the bundle, and no package in the bundle Provides it)
  6. Sort all the packages needed to install nvidia-driver-550 so that dependencies come first, and write them one per line in /root/gpu/install-order.txt. It must be 11 lines.
  7. Write, in a single line in /root/gpu/provides.txt, the name of the package that provides the virtual package libcuda1.
  8. Make /root/gpu/report.txt with the following 5 lines. BUNDLE=14 / EDGES=<4번 파일의 줄 수> / MISSING=<5번 파일의 줄 수> / ORDER=11 / LIBCUDA1_BY=<7번 값> (the placeholders are the line count of the file from step 4, the line count of the file from step 5, and the value from step 7)

Notes

List the import bundle

Create the /root/gpu directory, and write the 이름 버전 (the fields are the name and the version) of every package under /opt/fixtures/gpu-airgap/src/, one per line, in /root/gpu/inventory.txt. It must be 14 lines.

Extract Package and Version from DEBIAN/control in each source directory.

Build all the packages

Build every source directory into a .deb and collect them in /root/gpu/pool/. There must be 14 .deb files.

Repeat dpkg-deb --build for each directory. Handle it all at once with a shell loop.

Create the repository index

Create a Packages index and Packages.gz in /root/gpu/pool. The index must have 14 Package: entries.

It is the same method as used in the earlier course. The number of Package entries must equal the number of packages built.

Dependency edge list

Write the dependency relationships of each package, one per line, in /root/gpu/edges.txt in the form <패키지> <의존대상> (the placeholders are the package and the dependency target). Omit version conditions and write only names. It must be at least 15 lines.

If you split the Depends field on commas and strip the parentheses of the version conditions, only the dependency target names remain.

Find the dependencies that do not close

In /root/gpu/missing.txt, write only the names of dependencies that are not resolved inside the bundle. (Those for which there is no package of that name in the bundle, and no package in the bundle Provides it)

Among the targets of the edges, find the names that are not in the bundle and are not satisfied by Provides either. Exclude what is already installed on the system.

Produce the installation order

Sort all the packages needed to install nvidia-driver-550 so that dependencies come first, and write them one per line in /root/gpu/install-order.txt. It must be 11 lines.

Dependencies must come first. Do the topological sort by hand or with a script.

Trace the virtual package

Write, in a single line in /root/gpu/provides.txt, the name of the package that provides the virtual package libcuda1.

If you look at the Provides field of the control files, it shows which package provides that name.

Dependency analysis report

Make /root/gpu/report.txt with the following 5 lines. BUNDLE=14 / EDGES=<4번 파일의 줄 수> / MISSING=<5번 파일의 줄 수> / ORDER=11 / LIBCUDA1_BY=<7번 값> (the placeholders are the line count of the file from step 4, the line count of the file from step 5, and the value from step 7)

Just gather the counts and names from the results of the earlier steps.