Skip to content

Commit 39ad9b2

Browse files
authored
Merge pull request #1412 from NVIDIA/backport-1400-to-release-1.18
[release-1.18] Redirect log message to stderr in nvidia runtime wrapper script
2 parents 7d15b8c + 4a5f6a9 commit 39ad9b2

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

cmd/nvidia-ctk-installer/toolkit/installer/executables.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ func (w *render) render() (io.Reader, error) {
162162
{{- if (.CheckModules) }}
163163
cat /proc/modules | grep -e "^nvidia " >/dev/null 2>&1
164164
if [ "${?}" != "0" ]; then
165-
echo "nvidia driver modules are not yet loaded, invoking {{ .DefaultRuntimeExecutablePath }} directly"
165+
echo "nvidia driver modules are not yet loaded, invoking {{ .DefaultRuntimeExecutablePath }} directly" >&2
166166
exec {{ .DefaultRuntimeExecutablePath }} "$@"
167167
fi
168168
{{- end }}

cmd/nvidia-ctk-installer/toolkit/installer/executables_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ func TestWrapperRender(t *testing.T) {
5151
expected: `#! /bin/sh
5252
cat /proc/modules | grep -e "^nvidia " >/dev/null 2>&1
5353
if [ "${?}" != "0" ]; then
54-
echo "nvidia driver modules are not yet loaded, invoking runc directly"
54+
echo "nvidia driver modules are not yet loaded, invoking runc directly" >&2
5555
exec runc "$@"
5656
fi
5757
/dest-dir/some-runtime \

cmd/nvidia-ctk-installer/toolkit/installer/installer_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ func TestToolkitInstaller(t *testing.T) {
170170
wrapper: `#! /bin/sh
171171
cat /proc/modules | grep -e "^nvidia " >/dev/null 2>&1
172172
if [ "${?}" != "0" ]; then
173-
echo "nvidia driver modules are not yet loaded, invoking runc directly"
173+
echo "nvidia driver modules are not yet loaded, invoking runc directly" >&2
174174
exec runc "$@"
175175
fi
176176
NVIDIA_CTK_CONFIG_FILE_PATH=/foo/bar/baz/.config/nvidia-container-runtime/config.toml \
@@ -185,7 +185,7 @@ PATH=/foo/bar/baz:$PATH \
185185
wrapper: `#! /bin/sh
186186
cat /proc/modules | grep -e "^nvidia " >/dev/null 2>&1
187187
if [ "${?}" != "0" ]; then
188-
echo "nvidia driver modules are not yet loaded, invoking runc directly"
188+
echo "nvidia driver modules are not yet loaded, invoking runc directly" >&2
189189
exec runc "$@"
190190
fi
191191
NVIDIA_CTK_CONFIG_FILE_PATH=/foo/bar/baz/.config/nvidia-container-runtime/config.toml \
@@ -200,7 +200,7 @@ PATH=/foo/bar/baz:$PATH \
200200
wrapper: `#! /bin/sh
201201
cat /proc/modules | grep -e "^nvidia " >/dev/null 2>&1
202202
if [ "${?}" != "0" ]; then
203-
echo "nvidia driver modules are not yet loaded, invoking runc directly"
203+
echo "nvidia driver modules are not yet loaded, invoking runc directly" >&2
204204
exec runc "$@"
205205
fi
206206
NVIDIA_CTK_CONFIG_FILE_PATH=/foo/bar/baz/.config/nvidia-container-runtime/config.toml \

0 commit comments

Comments
 (0)