From 819c4e2eefc6bd4c10d5bbbaad45812bb9cc1bf7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix-Antoine=20Fortin?= Date: Wed, 10 Feb 2021 12:00:28 -0500 Subject: [PATCH] Move gpu driver dependencies higher up --- site/profile/manifests/gpu.pp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/site/profile/manifests/gpu.pp b/site/profile/manifests/gpu.pp index 02165172a..2751d5548 100644 --- a/site/profile/manifests/gpu.pp +++ b/site/profile/manifests/gpu.pp @@ -15,8 +15,15 @@ } } -class profile::gpu::install { +class profile::gpu::install::deps { ensure_resource('file', '/etc/nvidia', {'ensure' => 'directory' }) + ensure_packages(['kernel-devel'], {ensure => 'installed'}) + ensure_packages(['dkms'], { + 'require' => Yumrepo['epel'] + }) +} + +class profile::gpu::install { if ! $facts['nvidia_grid_vgpu'] { require profile::gpu::install::passthrough @@ -24,11 +31,6 @@ require profile::gpu::install::vgpu } - ensure_packages(['kernel-devel'], {ensure => 'installed'}) - ensure_packages(['dkms'], { - 'require' => Yumrepo['epel'] - }) - exec { 'dkms autoinstall': path => ['/usr/bin', '/usr/sbin'], onlyif => 'dkms status | grep -v -q \'nvidia.*installed\'', @@ -81,6 +83,8 @@ } class profile::gpu::install::passthrough(Array[String] $packages) { + require profile::gpu::install::deps + $cuda_ver = $::facts['nvidia_cuda_version'] $os = "rhel${::facts['os']['release']['major']}" $arch = $::facts['os']['architecture'] @@ -118,6 +122,8 @@ Enum['rpm', 'bin', 'none'] $installer = 'none', ) { + require profile::gpu::install::deps + if $installer == 'rpm' { include profile::gpu::install::vgpu::rpm } elsif $installer == 'bin' {