Air-Gapped GPU Driver Installation
Installing From an Offline Repository
Goal
You stand up a repository from the imported .deb bundle and install the driver, confirm that the toolkit cannot be installed with the first import alone, and then complete it by adding the second import batch. It is exactly the real air-gapped procedure.
Why it matters
If you install imported files one by one with dpkg -i, a person has to get the order right and has to remember that order again next time. If you make it a repository, apt resolves the graph and that repository keeps being reused. And the installation simulation (-s) is the final answer to whether the import succeeded — if unmet dependencies appear here, that list is the second import list.
You continue using the /root/gpu/pool you made in the previous lab (gpu-deps).
Steps
- Add a
Releasefile to/root/gpu/pool. It must have the six keysOrigin,Label,Suite,Codename,Architectures, andComponents, one line each, andArchitecturesmust includeamd64. - Register this repository with
/etc/apt/sources.list.d/gpu-airgap.listand refresh the index. Then save the output ofapt-cache policy nvidia-driver-550to/root/gpu/policy.txt. - Simulate the installation of
nvidia-driver-550and save the output to/root/gpu/sim-driver.txt. There must be 11 lines starting withInst. - Simulate the installation of
nvidia-container-toolkit, confirm that it fails, and save the output (including standard error) to/root/gpu/sim-toolkit-fail.txt. The file must mentionlibnvidia-container1. - Build the packages in
/opt/fixtures/gpu-airgap/src2/, add them to/root/gpu/pool/, rebuild the index, and refresh the index. There must be 15Package:entries. - Actually install
nvidia-driver-550andnvidia-container-toolkit. - Check the state of the packages starting with
nvidiaorlibnvidiawithdpkg -land save it to/root/gpu/installed.txt. Every line must be in theiistate. - Make
/root/gpu/install-report.txtwith the following 4 lines.DRIVER_VERSION=<nvidia-driver-550 의 설치된 버전>/TOOLKIT_VERSION=<nvidia-container-toolkit 의 설치된 버전>/INSTALLED=<이름이 nvidia 또는 libnvidia 로 시작하는 설치된 패키지 수>/SECOND_INTAKE=libnvidia-container1(the placeholders are the installed version of nvidia-driver-550, the installed version of nvidia-container-toolkit, and the number of installed packages whose names start with nvidia or libnvidia)
Notes
- The simulation is
apt-get install -s <패키지>(the placeholder is the package). The failure output goes to standard error, so capture it too with2>&1. - Extract the installed version with
dpkg-query -W -f='${Version}' <패키지>(the placeholder is the package). It may include the epoch. - After regenerating the index, you must run
apt-get updateagain. Releaserecords the size and hash ofPackages. So if you rebuiltPackagesin step 5, you must rebuildReleasetoo. Otherwise the hash mismatches, apt quietly ignores the new index, and you getCandidate: (none)— no error appears, so the cause is hard to find.- Common mistake 1: in step 5, rebuilding only the index and forgetting
apt-get update, so it keeps failing. - Common mistake 2: in step 8, dropping the epoch (
1:) arbitrarily when writing the version. Write it exactly as the query result.
Configure the repository from the imported batch
Add a Release file to /root/gpu/pool. It must have the six keys Origin, Label, Suite, Codename, Architectures, and Components, one line each, and Architectures must include amd64.
Use the pool you made in the previous lab as it is. Make the Release file too.
Register and refresh the repository
Register this repository with /etc/apt/sources.list.d/gpu-airgap.list and refresh the index. Then save the output of apt-cache policy nvidia-driver-550 to /root/gpu/policy.txt.
It is the flat repository format. You must refresh the index after registering for the packages to show up.
Simulate the driver installation
Simulate the installation of nvidia-driver-550 and save the output to /root/gpu/sim-driver.txt. There must be 11 lines starting with Inst.
The -s option changes nothing and only prints the plan. Count the lines starting with Inst.
Confirm that the toolkit installation is blocked
Simulate the installation of nvidia-container-toolkit, confirm that it fails, and save the output (including standard error) to /root/gpu/sim-toolkit-fail.txt. The file must mention libnvidia-container1.
If you run the same simulation with the toolkit, it fails. Save the error output as it is.
Add the second import batch
Build the packages in /opt/fixtures/gpu-airgap/src2/, add them to /root/gpu/pool/, rebuild the index, and refresh the index. There must be 15 Package: entries.
The shortfall is in the src2 directory. Build it, put it in the pool, and rebuild the index.
Actual installation
Actually install nvidia-driver-550 and nvidia-container-toolkit.
You can install the driver and the toolkit in one go. Check the state after installing.
Verify the installation state
Check the state of the packages starting with nvidia or libnvidia with dpkg -l and save it to /root/gpu/installed.txt. Every line must be in the ii state.
The state markers of dpkg -l must all be ii. If anything is not, the installation is not finished.
Installation report
Make /root/gpu/install-report.txt with the following 4 lines.
DRIVER_VERSION=<nvidia-driver-550 의 설치된 버전> / TOOLKIT_VERSION=<nvidia-container-toolkit 의 설치된 버전> / INSTALLED=<이름이 nvidia 또는 libnvidia 로 시작하는 설치된 패키지 수> / SECOND_INTAKE=libnvidia-container1 (the placeholders are the installed version of nvidia-driver-550, the installed version of nvidia-container-toolkit, and the number of installed packages whose names start with nvidia or libnvidia)
Gather the number of installed packages and the versions. The values must be the actual query results.