Skip to content

Commit

Permalink
Merge pull request bottlerocket-os#3432 from arnaldo2792/fix-nvidia-c…
Browse files Browse the repository at this point in the history
…har-devices

nvidia-variants: fix deleted NVIDIA char devices
  • Loading branch information
arnaldo2792 authored Sep 8, 2023
2 parents 00cdc42 + 39bb686 commit 95641fd
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Source0: https://%{goimport}/archive/v%{gover}/nvidia-container-toolkit-%{gover}
Source1: nvidia-container-toolkit-config.toml
Source2: nvidia-container-toolkit-tmpfiles.conf
Source3: nvidia-oci-hooks-json
Source4: nvidia-gpu-devices.rules

BuildRequires: %{_cross_os}glibc-devel
Requires: %{_cross_os}libnvidia-container
Expand All @@ -31,24 +32,30 @@ Requires: %{_cross_os}shimpei
%build
%cross_go_configure %{goimport}
go build -buildmode=pie -ldflags="${GOLDFLAGS}" -o nvidia-container-runtime-hook ./cmd/nvidia-container-runtime-hook
go build -buildmode=pie -ldflags="${GOLDFLAGS}" -o nvidia-ctk ./cmd/nvidia-ctk

%install
install -d %{buildroot}%{_cross_bindir}
install -d %{buildroot}%{_cross_tmpfilesdir}
install -d %{buildroot}%{_cross_templatedir}
install -d %{buildroot}%{_cross_udevrulesdir}
install -d %{buildroot}%{_cross_datadir}/nvidia-container-toolkit
install -d %{buildroot}%{_cross_factorydir}/etc/nvidia-container-runtime
install -p -m 0755 nvidia-container-runtime-hook %{buildroot}%{_cross_bindir}/
install -p -m 0755 nvidia-ctk %{buildroot}%{_cross_bindir}/
install -m 0644 %{S:1} %{buildroot}%{_cross_factorydir}/etc/nvidia-container-runtime/config.toml
install -m 0644 %{S:2} %{buildroot}%{_cross_tmpfilesdir}/nvidia-container-toolkit.conf
install -m 0644 %{S:3} %{buildroot}%{_cross_templatedir}/nvidia-oci-hooks-json
install -p -m 0644 %{S:4} %{buildroot}%{_cross_udevrulesdir}/90-nvidia-gpu-devices.rules
ln -s shimpei %{buildroot}%{_cross_bindir}/nvidia-oci

%files
%license LICENSE
%{_cross_attribution_file}
%{_cross_bindir}/nvidia-container-runtime-hook
%{_cross_bindir}/nvidia-ctk
%{_cross_bindir}/nvidia-oci
%{_cross_templatedir}/nvidia-oci-hooks-json
%{_cross_factorydir}/etc/nvidia-container-runtime/config.toml
%{_cross_tmpfilesdir}/nvidia-container-toolkit.conf
%{_cross_udevrulesdir}/90-nvidia-gpu-devices.rules
2 changes: 2 additions & 0 deletions packages/nvidia-container-toolkit/nvidia-gpu-devices.rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This will create /dev/char symlinks to all device nodes
ACTION=="add", DEVPATH=="/bus/pci/drivers/nvidia", RUN+="/usr/bin/nvidia-ctk system create-dev-char-symlinks --create-all"
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ After=kubelet.service
Wants=kubelet.service

[Service]
ExecStart=/usr/bin/nvidia-device-plugin
ExecStart=/usr/bin/nvidia-device-plugin --pass-device-specs=true
Type=simple
TimeoutSec=0
RestartSec=2
Expand Down

0 comments on commit 95641fd

Please sign in to comment.