Unconditionally call nvidia-modprobe to load UVM

Checking the existence of /dev/nvidia-uvm had two limitations:
- If kernel module nvidia_uvm is unloaded, /dev/nvidia-uvm is not
  removed, so nvidia-modprobe was not called when it should have.
- Even if kernel module nvidia_uvm is loaded and /dev/nvidia-uvm
  exists, /dev/nvidia-uvm-tools might not exist. Using nvidia-modprobe
  fixes this issue.

nvidia-modprobe parses /proc/modules to check which modules are
already loaded, so there should be no impact on performance.
This commit is contained in:
Felix Abecassis 2017-02-27 15:50:48 -08:00
parent 7dbc2cafec
commit 16a7d7da64

View file

@ -36,10 +36,6 @@ func Shutdown() error {
}
func LoadUVM() error {
_, err := os.Stat(DeviceUVM)
if !os.IsNotExist(err) {
return err
}
if exec.Command("nvidia-modprobe", "-u", "-c=0").Run() != nil {
return errors.New("Could not load UVM kernel module. Is nvidia-modprobe installed?")
}