Skip to content

Commit

Permalink
Move gpu driver dependencies higher up
Browse files Browse the repository at this point in the history
  • Loading branch information
cmd-ntrf committed Feb 10, 2021
1 parent fba256d commit 819c4e2
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions site/profile/manifests/gpu.pp
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,22 @@
}
}

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
} else {
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\'',
Expand Down Expand Up @@ -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']
Expand Down Expand Up @@ -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' {
Expand Down

0 comments on commit 819c4e2

Please sign in to comment.