-
Notifications
You must be signed in to change notification settings - Fork 451
Fix trigger of CDI refresh service #1518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Pattern in the patch looks sketchy, since it would gladly accept something like Here are some alternative pattern suggestions: '/(nvidia|nvidia-current)\\.ko(\\.(zst|xz|gz|bz2))?[:]' # Be really specific
'/(nvidia|nvidia-current)\\.ko(\\.[[:alnum:]]+)?[:]' # Allow any alphanumeric extension
'/(nvidia|nvidia-current)\\.ko' # Ignore everything after module nameUPD: Double backslashes in the pattern are needed due |
| Environment=NVIDIA_CTK_CDI_OUTPUT_FILE_PATH=/var/run/cdi/nvidia.yaml | ||
| EnvironmentFile=-/etc/nvidia-container-toolkit/nvidia-cdi-refresh.env | ||
| ExecCondition=/usr/bin/grep -qE '/(nvidia|nvidia-current)\.ko[:]' /lib/modules/%v/modules.dep | ||
| ExecCondition=/usr/bin/grep -qE '/(nvidia|nvidia-current)\\.ko(\\..*)?[:]' /lib/modules/%v/modules.dep |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As @Lioli7k points out, would it be simpler to remove the [:] instead? Although this was added in #1409 it may be too restrictive.
| ExecCondition=/usr/bin/grep -qE '/(nvidia|nvidia-current)\\.ko(\\..*)?[:]' /lib/modules/%v/modules.dep | |
| ExecCondition=/usr/bin/grep -qE '/(nvidia|nvidia-current)\\.ko' /lib/modules/%v/modules.dep |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Current patch proposal will match lines in /lib/modules/%v/modules.dep that look like this:
kernel/drivers/video/nvidia.ko:
updates/dkms/nvidia-current.ko:
extra/nvidia.ko.gz: (Compressed module)
weak-updates/nvidia.ko.xz: (Different compression)
Reversing #1409 will also work, as grep will act on the .ko even if there is more after it .ko.eg, so I am ok with both options
|
/cherry-pick release-1.18 |
Commit 1f5ce73 ("Fix trigger of CDI refresh service") did not allow for compressed modules with suffixes such as .zst or .gz. This change relaxes the matching to not require that the kernel module (including extension) be followed by a colon. This allows compressed kernel modules to also be matched. Also fix systemd warning: /etc/systemd/system/nvidia-cdi-refresh.service:26: Ignoring unknown escape sequences: "/(nvidia|nvidia-current)\.ko[:]" Signed-off-by: Ed Swarthout <Ed.Swarthout@gmail.com> Signed-off-by: Evan Lezar <elezar@nvidia.com>
ArangoGutierrez
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
elezar
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @EdSwarthout. I have rebased off main. This looks good now.
@ArangoGutierrez this doesn't reverse #1409. It only removes the check for a trailing |
Pull Request Test Coverage Report for Build 20022696837Details
💛 - Coveralls |
|
🤖 Backport PR created for |
I have not seen a specific list of compression methods and this is not future proof.
Removing the colon check works, but it is not clear why it was added in #1409. Why does this check need to be so specific? What is wrong with running the refresh service if nvidia is anywhere in the modules.dep? What about the day when the open source driver is in the kernel and can be builtin and not a module? |
Allow any module suffix.
Commit 1f5ce73 ("Fix trigger of CDI refresh service") did not allow for compressed modules with suffixes such as .zst or .gz.
Also fix systemd warning:
/etc/systemd/system/nvidia-cdi-refresh.service:26: Ignoring unknown escape sequences: "/(nvidia|nvidia-current).ko[:]"