To add the optional NVIDIA GPU driver to the compute nodes, an
additional external \pkgmgr{} repository provided by NVIDIA
must be configured. Once the repository is configured, the
GPU driver needs to be installed on the compute image and the
corresponding toolkit installed on the SMS node.

\OHPC{} provides a convenience package to enable the NVIDIA
repository locally along with compatibility packages that integrate
the NVIDIA HPC SDK within the standard \OHPC{} user environment.

% begin_ohpc_run
% ohpc_validation_newline
% ohpc_command if [[ ${enable_nvidia_gpu_driver} -eq 1 ]];then
% ohpc_indent 5
\begin{lstlisting}[language=bash,literate={-}{-}1,keywords={},upquote=true,keepspaces,literate={BOSVER}{\baseos{}}1]
# Add NVIDIA GPU driver repository to the SMS
[sms](*\#*) (*\install*) cuda-repo-ohpc
# Install the toolkit on the SMS
[sms](*\#*) (*\install*) nvidia-driver-cuda cuda-devel-ohpc
# Install NVIDIA repository and GPU driver in the compute image
[sms](*\#*) wwctl image exec --build=false BOSVER -- /bin/bash -ex <<- EOF
  dnf -y install cuda-repo-ohpc
  dnf -y install kmod-nvidia-latest-dkms nvidia-driver-cuda
  KVER=$(rpm -q --queryformat='%{version}-%{release}.%{arch}\n' \
         kernel-core | sort -r | head -1)
  dkms autoinstall --verbose -k \${KVER}
  dkms status
EOF

\end{lstlisting}
% ohpc_indent 0
% ohpc_command fi
% \end_ohpc_run
