Skip to content

Fix nvidia fallback services failing to start#475

Open
vigh-m wants to merge 3 commits into
bottlerocket-os:developfrom
vigh-m:nvidia/unit-fix
Open

Fix nvidia fallback services failing to start#475
vigh-m wants to merge 3 commits into
bottlerocket-os:developfrom
vigh-m:nvidia/unit-fix

Conversation

@vigh-m

@vigh-m vigh-m commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Issue number:

Closes #464

Description of changes:

  • Add the %build sections to kmod-nvidia specfiles
  • Fix type in DevID for g4dn instances causing the open driver to be loaded instead of the tesla driver. With this change, we are in-line with what the EKS optimized AMI does
  • Change the dependency of the open-gpu-license-fallback.service and the tesla-license-fallback.service to depend on the nvidia-gridd.service which itself depends on preconfigured.target ensuring all are started on all variants.

Testing done:

  • Build and test the a combination of ecs and k8s variants on the 6.1, 6.12, and 6.18 kernels with the 580 driver

  • Testing for g4dn.* instances:
    Before the change:

bash-5.2# nvidia-smi
Wed Jul  8 00:40:56 2026
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 580.159.03             Driver Version: 580.159.03     CUDA Version: 13.0     |
+-----------------------------------------+------------------------+----------------------+
| 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  Tesla T4                       On  |   00000000:00:1E.0 Off |                    0 |
| N/A   36C    P8              9W /   70W |       0MiB /  15360MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI              PID   Type   Process name                        GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|  No running processes found                                                             |
+-----------------------------------------------------------------------------------------+
bash-5.2# modinfo nvidia
filename:       /lib/modules/6.18.30/kernel/drivers/extra/video/nvidia/open-gpu/nvidia.ko
import_ns:      DMA_BUF
alias:          char-major-195-*
description:    NVIDIA core GPU kernel module
version:        580.159.03
supported:      external
license:        Dual MIT/GPL    <------- Open Source Driver

bash-5.2# /usr/bin/ghostdog match-nvidia-driver tesla
Error: tesla is not preferred driver: open-gpu

bash-5.2# /usr/bin/ghostdog match-nvidia-driver grid
Error: grid is not preferred driver: open-gpu

bash-5.2# /usr/bin/ghostdog match-nvidia-driver open-gpu
bash-5.2#

After the change

bash-5.2# nvidia-smi
Wed Jul  8 00:36:59 2026
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 580.159.03             Driver Version: 580.159.03     CUDA Version: 13.0     |
+-----------------------------------------+------------------------+----------------------+
| 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  Tesla T4                       On  |   00000000:00:1E.0 Off |                    0 |
| N/A   35C    P8             10W /   70W |       0MiB /  15360MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI              PID   Type   Process name                        GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|  No running processes found                                                             |
+-----------------------------------------------------------------------------------------+
bash-5.2# modinfo nvidia
filename:       /lib/modules/6.18.35/kernel/drivers/extra/video/nvidia/tesla/nvidia.ko
alias:          char-major-195-*
description:    NVIDIA core GPU kernel module
version:        580.159.03
supported:      external
license:        NVIDIA    <------- Proprietary Driver


bash-5.2# /usr/bin/ghostdog match-nvidia-driver tesla
bash-5.2# /usr/bin/ghostdog match-nvidia-driver grid
Error: grid is not preferred driver: tesla

bash-5.2# /usr/bin/ghostdog match-nvidia-driver open-gpu
Error: open-gpu is not preferred driver: tesla

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

@vigh-m vigh-m force-pushed the nvidia/unit-fix branch from 3bcf796 to 8534e33 Compare June 29, 2026 16:32

@ginglis13 ginglis13 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - nit on missing space after : in commit message kmod-nvidia:fallback.service to install on all variants

Comment thread packages/kmod-6.1-nvidia-r580/kmod-6.1-nvidia-r580.spec
select(.devid != "0x1DB1"
and .devid != "0x1DB5"
and .devid != "0x1DEB8"
and .devid != "0x1EB8"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In your PR description, can you add the testing you did here to validate that g4dn.* are using the correct driver. And add in the commit message that we are following the steps of the EKS Optimized AMI.

@@ -11,4 +11,4 @@ ExecStart=/usr/bin/systemctl stop grid-license-check.timer --no-block
RemainAfterExit=true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commit message is not well formatted and confusing. Could you please expand on how your change fixes the problem with non-k8s variants?

Also, should the service run After=nvidia-gridd.service? WantedBy doesn't guarantee ordering.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the commit message with more details.

The services can start at the same time as nvidia-gridd.service. They no-op if they are on an unsupported instance and will exit without failing the boot.

StandardOutput=append:/tmp/.nvidia-gridd-license

[Install]
WantedBy=nvidia-k8s-device-plugin.service

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the commit message, or even in this file, explain that this unit doesn't need an Install section because the service will be started by a timer.

But also, you must guarantee that the service will start as soon as we reach multi-user.target. If you validated this, call it out in the PR description. And in the commit message, call out why the wanted ordering is preserved (e.g. timers.target run before, in parallel, after multi-user.target whichever is the case we want).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the commit message with more info about this.
We don't need to wait for multiuser.target for this service. It was already setup to run after nvidia-gridd.service which is installed in preconfigured.target. This change shouldn't affect the ordering or install since timers.target was always going to install this service.

vigh-m added 3 commits July 7, 2026 23:33
Signed-off-by: Vighnesh Maheshwari <[email protected]>
This aligns with the EKS optimized AMI and their decision to use
the tesla driver with g4dn instance types. The original PR had a
typo and this change fixes that.

Signed-off-by: Vighnesh Maheshwari <[email protected]>
The different nvidia driver services (tesla, open-gpu, and grid)
were setup to run only for the nvidia-k8s-device-plugin.service.
With this change, the driver services are now installed with the
nvidia-gridd.service which runs on all nvidia instances

The dependency flow is as below:

timers.target (base systemd target)
|
-> Installs grid-license-check.timer
|  |
|  -> Installs grid-license-check.service
|
preconfigured.target (base systemd target)
|
-> Installs nvidia-gridd.service
   |
   -> Triggers grid-license-check.service (Existing behaviour)
   -> Triggers open-gpu-license-fallback.service (New)
   -> Triggers tesla-license-fallback.service (New)

Signed-off-by: Vighnesh Maheshwari <[email protected]>
@vigh-m vigh-m force-pushed the nvidia/unit-fix branch from 8534e33 to 97a504d Compare July 8, 2026 02:56
@vigh-m

vigh-m commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

⬆️ Update following comments

@arnaldo2792 arnaldo2792 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One more nit in the PR description:

I understand what's changing with your code changes, but what's the behavior your change fixed? I understand the nvidia-gridd.service now starts in all variants, but what problem was this causing? Failed boots? Excessive logging? A service running that shouldn't? Or a service not running that should?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] open-gpu-license-fallback.service and tesla-license-fallback.service never run on non-Kubernetes hosts due to k8s-only WantedBy

3 participants