Forge Home

nvdarepo

Installs NVIDIA repository sources for CUDA etc. via Puppet.

2,516 downloads

168 latest version

3.1 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Version information

  • 0.1.8 (latest)
  • 0.1.7
  • 0.1.6
  • 0.1.5
  • 0.1.4
  • 0.1.3
  • 0.1.2
  • 0.1.1
  • 0.1.0
released Sep 8th 2023
This version is compatible with:
  • Puppet Enterprise 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 2019.8.x
  • Puppet >= 6.21.0 < 8.0.0
  • , , , ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'visus-nvdarepo', '0.1.8'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add visus-nvdarepo
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install visus-nvdarepo --version 0.1.8

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

visus/nvdarepo — version 0.1.8 Sep 8th 2023

nvdarepo

The nvdarepo module installs NVIDIA repository sources that in turn enable the installation of CUDA tools and drivers via the package manager.

Table of Contents

  1. Description
  2. Setup – The basics of getting started with nvdarepo
  3. Usage – Configuration options and additional functionality
  4. Limitations – OS compatibility, etc.
  5. Development – Guide for contributing to the module

Description

This module installs the NVIDIA CUDA repository to RedHad-based systems, which provides packages for CUDA tooling, CUDA libraries and NVIDIA's proprietary drivers.

Setup

Setup Requirements

This module requires puppet-yum being installed.

Beginning with nvdarepo

Just add include ndvarepo to add all configured repositories at their default location.

Usage

Using include nvdarepo should be sufficient to achive everything this module supports. Currently, only the CUDA repository is installed, which can be installed separately via include nvdarepo::cuda to make sure that no other repositories get installed if additional ones are added in future version.

If the automatic computation of the repository properties does not work, it is best customising the behaviour of the module via Hiera. Most notably, the automatically computed repository URLs of the CUDA repository depend on the following parameters:

Name Description Default
nvdarepo::cuda::base_url The base URL where all OS-dependent subdirectories are located. https://developer.download.nvidia.com/compute/cuda/repos
nvdarepo::cuda::key_file_name The name of the GPG key file. This file will be searched in the individual repository directory. 7fa2af80.pub
nvdarepo::cuda::key_id The ID of NVIDIA's GPG key. 0xF60F4B3D7FA2AF80
nvdarepo::cuda::version_field The OS version fact used to compose the repository URL. major
nvdarepo::cuda::distro_override Forces the specified distribution name instead of the OS name fact to be used in the repository URL. rhel or fedora, respectively
nvdarepo::cuda::repo_src_override Overrides the whole repository URL. Nothing will be computed automatically. false
nvdarepo::cuda::key_src_override Overrides the whole URL of the GPG key. Nothing will be computed automatically. false

Furthermore, the following parameters can be used to configure the local behaviour of the module, i.e. where the repository file is stored:

Name Description Default
nvdarepo::cuda::repo_dir The directory where the repository files are stored. /etc/yum.repos.d
nvdarepo::cuda::repo_ext The file name extension of the repostiry files. .repo
nvdarepo::cuda::repo_owner User name or ID of the owner of the repository file. root
nvdarepo::cuda::repo_group Group name or ID of the owning group of the repository file. root
nvdarepo::cuda::key_dir The directory where the GPG keys are stored. /etc/pki/rpm-gpg
nvdarepo::cuda::key_prefix A prefix that is prepended to the GPG key file. RPM-GPG-KEY-

Installing CUDA

NVIDIA's instructions for installing CUDA suggest a specific order in which packages are to be installed. As of now, if this order is not followed, the DKMS driver packages cannot be installed, because the CUDA package installed different ones. This module provides the defined resource type nvdarepo::ordered_install to help with this problem. nvdarepo::ordered_install allows you to specify a specific order of packages by means of lexical order, which will be translated into Puppet dependencies by the defined resource type. It is a reasonable approach to use numbers to establish this lexical order. For instance, you could do something like this

class profile::cuda(Hash $packages) {
    # Ensure that NVIDIA repositories are present.
    require nvdarepo

    # Make sure that dependencies for building the kernel module are present.
    ensure_packages([ 'gcc', 'epel-release', 'kernel-devel' ] )

    # Install packages configured via Hiera.
    nvdarepo::ordered_install { 'cuda':
        packages => $packages
    }

    # Make sure that NVIDIA module is installed.
    ~> exec { '/usr/sbin/dkms autoinstall -m nvidia': }
}

and specify the packages and their order in Hiera as

profile::cuda::packages:
  00-nvidia-driver-latest-dkms:
    name: nvidia-driver-latest-dkms
    ensure: installed
  01-cuda:
    name: cuda
    ensure: installed
  02-cuda-drivers:
    name: cuda-drivers
    ensure: installed
  03-libcudnn8-devel:
    name: libcudnn8-devel
    ensure: installed

If you have environment modules installed on your machine and want to be able to switch between CUDA versions, you can use nvdarepo::cuda-module-files to automatically create module files for all packages of format cuda[-version]:

class profile::cuda(Hash $packages) {
    # Other stuff here ...

    ~> nvdarepo::cuda_module_files { 'cuda-module-files':
        packages => $packages
    }
}

Note that nvdarepo::cuda-module-files will automatically make sure that the environment-modules package is installed on your system.

Limitations

Only distributions listed in metadata.json are supported.

Development

Open a pull request on GitHub.