21640: Stop accidentally reducing NOFILE limit.
[arvados.git] / lib / crunchrun / cuda.go
index c693dbcb960250f1e502e42ae971e5227bb58189..f91a5c62cdc1761da37b08d1889025902867f58d 100644 (file)
@@ -5,13 +5,15 @@
 package crunchrun
 
 import (
+       "fmt"
+       "io"
        "os/exec"
 )
 
 // nvidiaModprobe makes sure all the nvidia kernel modules and devices
 // are set up.  If we don't have all the modules/devices set up we get
 // "CUDA_ERROR_UNKNOWN".
-func nvidiaModprobe(writer *ThrottledLogger) {
+func nvidiaModprobe(writer io.Writer) {
        // The underlying problem is that when normally running
        // directly on the host, the CUDA SDK will automatically
        // detect and set up the devices on demand.  However, when
@@ -42,7 +44,7 @@ func nvidiaModprobe(writer *ThrottledLogger) {
        nvidiaSmi.Stderr = writer
        err := nvidiaSmi.Run()
        if err != nil {
-               writer.Printf("Warning %v: %v", nvidiaSmi.Args, err)
+               fmt.Fprintf(writer, "Warning %v: %v\n", nvidiaSmi.Args, err)
        }
 
        // Load the kernel modules & devices associated with
@@ -63,7 +65,7 @@ func nvidiaModprobe(writer *ThrottledLogger) {
                nvmodprobe.Stderr = writer
                err = nvmodprobe.Run()
                if err != nil {
-                       writer.Printf("Warning %v: %v", nvmodprobe.Args, err)
+                       fmt.Fprintf(writer, "Warning %v: %v\n", nvmodprobe.Args, err)
                }
        }
 }