GoogleCloudPlatform / GoogleCloudPlatform/compute-gpu-installation

Debian installer not using semver sorting when selecting kernel headers package

Open
#53 0 comments 1 reaction 1 assignee Claimed by @m-strzelczyk View on GitHub
Dominant language
Python
Stars
89
Forks
40
PR merge metrics
No merged PRs in 30d

Description

**Describe the bug**
The Debian installer is incorrectly selecting `linux-headers-6.12.96+deb13-cloud-amd64` even though the latest version is `linux-headers-6.12.105+deb13-cloud-amd64`. This is because the regex that parses the version number is treating the versions as strings, not integers.

**Environment**
- Affects all Debian environments

**To Reproduce**
I don't have access to the contents of `/opt/google/gpu-installer/` because this runs in an ephemeral `packer` process, which is lost after the failure. However, I can provide the output and the command run by `packer`.

Output from our packer process:

```
==> googlecompute.default: python3 /home/bootstrap/cuda_installer.pyz install_driver --installation-mode=repo --installation-branch=nfb --ignore-no-gpu
...
==> googlecompute.default: Executing: apt-get install -y make gcc linux-image-6\.12\.96+deb13-cloud-amd64 linux-headers-6\.12\.96+deb13-cloud-amd64 pciutils gcc make dkms cmake git
==> googlecompute.default: Reading package lists...
==> googlecompute.default: Building dependency tree...
==> googlecompute.default:
==> googlecompute.default: Reading state information...
==> googlecompute.default: E: Unable to locate package linux-headers-6.12.96+deb13-cloud-amd64
==> googlecompute.default: E: Couldn't find any package by glob 'linux-headers-6.12.96+deb13-cloud-amd64'
==> googlecompute.default: E: Couldn't find any package by regex 'linux-headers-6.12.96+deb13-cloud-amd64'
==> googlecompute.default: Command exited with non-zero code.
==> googlecompute.default: Stdout:
==> googlecompute.default: Traceback (most recent call last):
==> googlecompute.default: Reading package lists...
==> googlecompute.default: Building dependency tree...
==> googlecompute.default:
==> googlecompute.default: Reading state information...
==> googlecompute.default: Stderr:
==> googlecompute.default: E: Unable to locate package linux-headers-6.12.96+deb13-cloud-amd64
==> googlecompute.default: File "", line 198, in _run_module_as_main
==> googlecompute.default: E: Couldn't find any package by glob 'linux-headers-6.12.96+deb13-cloud-amd64'
==> googlecompute.default: File "", line 88, in _run_code
==> googlecompute.default: E: Couldn't find any package by regex 'linux-headers-6.12.96+deb13-cloud-amd64'
==> googlecompute.default: --------------------------------
==> googlecompute.default: File "/home/bootstrap/cuda_installer.pyz/__main__.py", line 366, in
==> googlecompute.default: installer.install_driver(
==> googlecompute.default: ~~~~~~~~~~~~~~~~~~~~~~~~^
==> googlecompute.default: secure_boot_public_key=secure_boot_public_key,
==> googlecompute.default: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
==> googlecompute.default: ...<6 lines>...
==> googlecompute.default: force_version=args.force_version,
==> googlecompute.default: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
==> googlecompute.default: )
==> googlecompute.default: ^
==> googlecompute.default: File "/home/bootstrap/cuda_installer.pyz/os_installers/__init__.py", line 196, in install_driver
==> googlecompute.default: self._install_prerequisites()
==> googlecompute.default: ~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
==> googlecompute.default: File "/home/bootstrap/cuda_installer.pyz/decorators.py", line 31, in wrapper
==> googlecompute.default: func(*args, **kwargs)
==> googlecompute.default: ~~~~^^^^^^^^^^^^^^^^^
==> googlecompute.default: File "/home/bootstrap/cuda_installer.pyz/os_installers/debian.py", line 85, in _install_prerequisites
==> googlecompute.default: self.run(
==> googlecompute.default: ~~~~~~~~^
==> googlecompute.default: f"apt-get install -y make gcc {wanted_kernel_package} {wanted_kernel_headers} "
==> googlecompute.default: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
==> googlecompute.default: f"pciutils gcc make dkms cmake git"
==> googlecompute.default: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
==> googlecompute.default: )
==> googlecompute.default: ^
==> googlecompute.default: File "/home/bootstrap/cuda_installer.pyz/os_installers/__init__.py", line 614, in run
==> googlecompute.default: raise subprocess.CalledProcessError(proc.returncode, command, "\n".join(stdout), "\n".join(stderr))
==> googlecompute.default: subprocess.CalledProcessError: Command 'apt-get install -y make gcc linux-image-6\.12\.96+deb13-cloud-amd64 linux-headers-6\.12\.96+deb13-cloud-amd64 pciutils gcc make dkms cmake git' returned non-zero exit status 100.
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.