Skip to content

Commit

Permalink
Replace modprobe -r by rmmod
Browse files Browse the repository at this point in the history
  • Loading branch information
cmd-ntrf committed Jan 23, 2025
1 parent 186fe8d commit 261e495
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions site/profile/manifests/gpu.pp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
ensure_packages(['kernel-devel'], { 'name' => "kernel-devel-${facts['kernelrelease']}" })
ensure_packages(['kernel-headers'], { 'name' => "kernel-headers-${facts['kernelrelease']}" })
ensure_packages(['dkms'], { 'require' => [Package['kernel-devel'], Yumrepo['epel']] })
$nvidia_kmod = ['nvidia', 'nvidia_drm', 'nvidia_modeset', 'nvidia_uvm']
$nvidia_kmod = ['nvidia', 'nvidia_modeset', 'nvidia_drm', 'nvidia_uvm']

selinux::module { 'nvidia-gpu':
ensure => 'present',
Expand Down Expand Up @@ -72,7 +72,7 @@
],
}
exec { 'unload nvidia drivers':
command => $nvidia_kmod.reverse.map |$kmod| { "modprobe -r ${kmod}" }.join('&&'),
command => sprintf('rmmod %s', $nvidia_kmod.reverse.join(' ')),
onlyif => 'grep -qE "^nvidia " /proc/modules',
refreshonly => true,
notify => Kmod::Load[$nvidia_kmod],
Expand Down

0 comments on commit 261e495

Please sign in to comment.