Skip to content

Commit

Permalink
install systemd
Browse files Browse the repository at this point in the history
  • Loading branch information
guptaNswati committed Oct 28, 2024
1 parent 3f36077 commit 3a062c1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
2 changes: 2 additions & 0 deletions ubuntu22.04/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ RUN if [ "$(printf '%s\n' "$IMEX_DRIVER_VERSION" "$DRIVER_VERSION" | sort -V | h
curl -fsSL -o /tmp/nvidia-imex-${IMEX_DRIVER_VERSION}_${DRIVER_VERSION}-1_${TARGETARCH}.deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/sbsa/nvidia-imex-${IMEX_DRIVER_VERSION}_${DRIVER_VERSION}-1_${TARGETARCH}.deb && \
dpkg -i /tmp/nvidia-imex-${IMEX_DRIVER_VERSION}_${DRIVER_VERSION}-1_${TARGETARCH}.deb && \
nvidia-imex --version && \
apt-get update && \
apt-get install -y --no-install-recommends systemd && \
rm -rf /tmp/nvidia-imex_${IMEX_DRIVER_VERSION}_${DRIVER_VERSION}-1_${TARGETARCH}.deb; fi

WORKDIR /drivers
Expand Down
8 changes: 6 additions & 2 deletions ubuntu22.04/nvidia-driver
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ _create_driver_package() (

# Check if imex node config is present
_assert_imex_node_config() {
[ -f /etc/nvidia-imex/node_config.cfg ]] || return 1
[ -f /etc/nvidia-imex/nodes_config.cfg ] || return 1
}

_assert_nvswitch_system() {
Expand Down Expand Up @@ -333,7 +333,9 @@ _load_driver() {

if _assert_imex_node_config; then
echo "Starting NVIDIA imex daemon..."
systemctl enable nvidia-imex.service
systemctl start nvidia-imex.service
systemctl status nvidia-imex.service
fi

return 0
Expand Down Expand Up @@ -394,9 +396,11 @@ _unload_driver() {
fi

# stop nvidia-imex daemon
if [ systemctl is-active --quiet nvidia-imex.service ]; then
if systemctl is-active --quiet nvidia-imex.service; then
echo "Stopping NVIDIA imex daemon..."
systemctl stop nvidia-imex.service
systemctl status nvidia-imex.service
systemctl disable nvidia-imex.service
fi

echo "Unloading NVIDIA driver kernel modules..."
Expand Down
2 changes: 2 additions & 0 deletions ubuntu22.04/precompiled/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ RUN if [ "$(printf '%s\n' "$IMEX_DRIVER_VERSION" "$DRIVER_VERSION" | sort -V | h
curl -fsSL -o /tmp/nvidia-imex-${IMEX_DRIVER_VERSION}_${DRIVER_VERSION}-1_${TARGETARCH}.deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/sbsa/nvidia-imex-${IMEX_DRIVER_VERSION}_${DRIVER_VERSION}-1_${TARGETARCH}.deb && \
dpkg -i /tmp/nvidia-imex-${IMEX_DRIVER_VERSION}_${DRIVER_VERSION}-1_${TARGETARCH}.deb && \
nvidia-imex --version && \
apt-get update && \
apt-get install -y --no-install-recommends systemd && \
rm -rf /tmp/nvidia-imex_${IMEX_DRIVER_VERSION}_${DRIVER_VERSION}-1_${TARGETARCH}.deb; fi

# update pkg cache and download pkgs for driver module installation during runtime.
Expand Down
8 changes: 6 additions & 2 deletions ubuntu22.04/precompiled/nvidia-driver
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ _update_package_cache() {
}

_assert_imex_node_config() {
[ -f /etc/nvidia-imex/node_config.cfg ]] || return 1
[ -f /etc/nvidia-imex/nodes_config.cfg ] || return 1
}

_assert_nvswitch_system() {
Expand Down Expand Up @@ -135,7 +135,9 @@ _load_driver() {

if _assert_imex_node_config; then
echo "Starting NVIDIA imex daemon..."
systemctl enable nvidia-imex.service
systemctl start nvidia-imex.service
systemctl status nvidia-imex.service
fi

return 0
Expand Down Expand Up @@ -180,9 +182,11 @@ _unload_driver() {
fi
fi

if [ systemctl is-active --quiet nvidia-imex.service ]; then
if systemctl is-active --quiet nvidia-imex.service; then
echo "Stopping NVIDIA imex daemon..."
systemctl stop nvidia-imex.service
systemctl status nvidia-imex.service
systemctl disable nvidia-imex.service
fi

echo "Unloading NVIDIA driver kernel modules..."
Expand Down

0 comments on commit 3a062c1

Please sign in to comment.