From e527aba9c66061713b445c185388f3375dbfcade Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix-Antoine=20Fortin?= Date: Fri, 10 Jan 2025 16:12:16 -0500 Subject: [PATCH] Add support for GRID drivers in Azure --- data/cloud/azure.yaml | 5 +++++ hiera.yaml | 4 +++- site/profile/manifests/gpu.pp | 13 +++++++++++-- 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 data/cloud/azure.yaml diff --git a/data/cloud/azure.yaml b/data/cloud/azure.yaml new file mode 100644 index 000000000..cd119007f --- /dev/null +++ b/data/cloud/azure.yaml @@ -0,0 +1,5 @@ +profile::gpu::install::vgpu::installer: bin +profile::gpu::install::vgpu::bin::source: https://go.microsoft.com/fwlink/?linkid=874272 +profile::gpu::install::vgpu::bin::gridd_content: | + IgnoreSP=FALSE + EnableUI=FALSE diff --git a/hiera.yaml b/hiera.yaml index 90d017f46..d3b3c15fa 100644 --- a/hiera.yaml +++ b/hiera.yaml @@ -41,8 +41,10 @@ hierarchy: hostname: "%{facts.networking.hostname}" - name: "Software stack" path: "software_stack/%{facts.software_stack}.yaml" - - name: "Cloud provider" + - name: "Cloud provider region" path: "cloud/%{facts.cloud.provider}/%{facts.cloud.region}.yaml" + - name: "Cloud provider" + path: "cloud/%{facts.cloud.provider}.yaml" - name: "OS version" path: "os/%{facts.os.family}/%{facts.os.release.major}.yaml" - name: "Other YAML hierarchy levels" diff --git a/site/profile/manifests/gpu.pp b/site/profile/manifests/gpu.pp index a1862ad75..aaf5c46d5 100644 --- a/site/profile/manifests/gpu.pp +++ b/site/profile/manifests/gpu.pp @@ -274,7 +274,8 @@ class profile::gpu::install::vgpu::bin ( String $source, - String $gridd_source, + String $gridd_content = undef, + String $gridd_source = undef, ) { exec { 'vgpu-driver-install-bin': command => "curl -L ${source} -o /tmp/NVIDIA-driver.run && sh /tmp/NVIDIA-driver.run --ui=none --no-questions --disable-nouveau && rm /tmp/NVIDIA-driver.run", # lint:ignore:140chars @@ -290,11 +291,19 @@ ], } + if $gridd_content { + $gridd_definition = { 'content' => $gridd_content } + } elsif $gridd_source { + $gridd_definition = { 'source' => $gridd_source } + } else { + $gridd_definition = {} + } + file { '/etc/nvidia/gridd.conf': ensure => file, mode => '0644', owner => 'root', group => 'root', - source => $gridd_source, + * => $gridd_definition, } }