I want to install ubuntu-drivers-common on an p3.2xlarge Instance to use the NVIDIA graphics card in a custom AMI build with the EC2 Image Builder.
To do that, I tried the command to install ubuntu-drivers-common on a testsetup instance:
ubuntu@ip-10-180-0-236:~$ sudo apt install ubuntu-drivers-common -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
python3-xkit
Suggested packages:
python3-aptdaemon.pkcompat
The following NEW packages will be installed:
python3-xkit ubuntu-drivers-common
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 76.8 kB of archives.
After this operation, 412 kB of additional disk space will be used.
Get:1 http://eu-central-1.ec2.archive.ubuntu.com/ubuntu jammy/main amd64 python3-xkit all 0.5.0ubuntu5 [18.5 kB]
Get:2 http://eu-central-1.ec2.archive.ubuntu.com/ubuntu jammy-updates/main amd64 ubuntu-drivers-common amd64 1:0.9.6.2~0.22.04.4 [58.3 kB]
Fetched 76.8 kB in 0s (3305 kB/s)
Preconfiguring packages ...
Selecting previously unselected package python3-xkit.
(Reading database ... 94114 files and directories currently installed.)
Preparing to unpack .../python3-xkit_0.5.0ubuntu5_all.deb ...
Unpacking python3-xkit (0.5.0ubuntu5) ...
Selecting previously unselected package ubuntu-drivers-common.
Preparing to unpack .../ubuntu-drivers-common_1%3a0.9.6.2~0.22.04.4_amd64.deb ...
Unpacking ubuntu-drivers-common (1:0.9.6.2~0.22.04.4) ...
Setting up python3-xkit (0.5.0ubuntu5) ...
Setting up ubuntu-drivers-common (1:0.9.6.2~0.22.04.4) ...
Created symlink /etc/systemd/system/display-manager.service.wants/gpu-manager.service → /lib/systemd/system/gpu-manager.service.
Unit /lib/systemd/system/gpu-manager.service is added as a dependency to a non-existent unit display-manager.service.
Created symlink /etc/systemd/system/oem-config.service.wants/gpu-manager.service → /lib/systemd/system/gpu-manager.service.
Unit /lib/systemd/system/gpu-manager.service is added as a dependency to a non-existent unit oem-config.service.
Scanning processes...
Scanning linux images...
Running kernel seems to be up-to-date.
No services need to be restarted.
No containers need to be restarted.
No user sessions are running outdated binaries.
No VM guests are running outdated hypervisor (qemu) binaries on this host.
This is working fine.
In my Pipeline I first used :
- apt update
- yes | sudo DEBIAN_FRONTEND=noninteractive apt upgrade -yqq
- sudo reboot
which did not prompt me to use the terminal to update the kernel -> instead of
sudo DEBIAN_FRONTEND=noninteractive apt upgrade -yqq
which did.
In the pipeline I tried these exact steps.
Followed by the next component, executing:
sudo apt install ubuntu-drivers-common -y
in build. Leading to this error:
Phase build
Step UbuntuDriversCommonInstall
ExecuteBash: STARTED EXECUTION
Stdout: The following additional packages will be installed:
Stdout: python3-xkit
Stdout: Suggested packages:
Stdout: python3-aptdaemon.pkcompat
Stdout: The following NEW packages will be installed:
Stdout: python3-xkit ubuntu-drivers-common
Stdout: 0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Stdout: Preconfiguring packages ...
Stdout: Need to get 76.8 kB of archives.
Stdout: After this operation, 412 kB of additional disk space will be used.
Stdout: Selecting previously unselected package python3-xkit.
Stdout: (Reading database ... (Reading database ... 5% (Reading database ... 10% (Reading database ... 15% (Reading database ... 20% (Reading database ... 25% (Reading database ... 30% (Reading database ... 35% (Reading database ... 40% (Reading database ... 45% (Reading database ... 50% (Reading database ... 55% (Reading database ... 60% (Reading database ... 65% (Reading database ... 70% (Reading database ... 75% (Reading database ... 80% (Reading database ... 85% (Reading database ... 90% (Reading database ... 95% (Reading database ... 100% (Reading database ... 64726 files and directories currently installed.)
Stdout: Preparing to unpack .../python3-xkit_0.5.0ubuntu5_all.deb ...
Stdout: Unpacking python3-xkit (0.5.0ubuntu5) ...
Stdout: Selecting previously unselected package ubuntu-drivers-common.
Stdout: Preparing to unpack .../ubuntu-drivers-common_1%3a0.9.6.2~0.22.04.4_amd64.deb ...
Stdout: Unpacking ubuntu-drivers-common (1:0.9.6.2~0.22.04.4) ...
Stdout: Setting up python3-xkit (0.5.0ubuntu5) ...
Stdout: Setting up ubuntu-drivers-common (1:0.9.6.2~0.22.04.4) ...
Stdout: Created symlink /etc/systemd/system/display-manager.service.wants/gpu-manager.service → /lib/systemd/system/gpu-manager.service.
Stdout: Unit /lib/systemd/system/gpu-manager.service is added as a dependency to a non-existent unit display-manager.service.
Stdout: Created symlink /etc/systemd/system/oem-config.service.wants/gpu-manager.service → /lib/systemd/system/gpu-manager.service.
Stdout: Unit /lib/systemd/system/gpu-manager.service is added as a dependency to a non-existent unit oem-config.service.
Waiting for command to complete (command id: e0e425f8-85b1-4ae8-952b-7a8b23bea0d1). Attempt number: 2.
Waiting for command to complete (command id: e0e425f8-85b1-4ae8-952b-7a8b23bea0d1). Attempt number: 3.
Waiting for command to complete (command id: e0e425f8-85b1-4ae8-952b-7a8b23bea0d1). Attempt number: 4.
Command failed (command id: e0e425f8-85b1-4ae8-952b-7a8b23bea0d1, state: Failed)
Action failed for step ApplyBuildComponents. Failing step
Step ApplyBuildComponents failed
How come this fails, if it works if I do it manually? And how can I debug this behavior?
That works. But if you put
into the component before the "Install driver" component, it did not work for me.