@@ -233,7 +233,7 @@ func isRootless(ctx context.Context, dockerClient *client.Client) bool {
233233}
234234
235235// Check whether the host Ascend driver path exists. If so, create the corresponding mount configuration.
236- func tryGetBindAscendMounts () []mount.Mount {
236+ func tryGetBindAscendMounts (printer StatusPrinter ) []mount.Mount {
237237 hostPaths := []string {
238238 "/usr/local/dcmi" ,
239239 "/usr/local/bin/npu-smi" ,
@@ -245,7 +245,7 @@ func tryGetBindAscendMounts() []mount.Mount {
245245 for _ , hostPath := range hostPaths {
246246 matches , err := filepath .Glob (hostPath )
247247 if err != nil {
248- fmt . Errorf ("Error checking glob pattern for %s: %v" , hostPath , err )
248+ printer . PrintErrf ("Error checking glob pattern for %s: %v\n " , hostPath , err )
249249 continue
250250 }
251251
@@ -258,7 +258,9 @@ func tryGetBindAscendMounts() []mount.Mount {
258258 }
259259 newMounts = append (newMounts , newMount )
260260 } else {
261- fmt .Printf (" [NOT FOUND] Ascend driver path does not exist, skipping: %s\n " , hostPath )
261+ if os .Getenv ("DEBUG" ) == "1" {
262+ printer .Printf ("[NOT FOUND] Ascend driver path does not exist, skipping: %s\n " , hostPath )
263+ }
262264 }
263265 }
264266
@@ -309,7 +311,7 @@ func CreateControllerContainer(ctx context.Context, dockerClient *client.Client,
309311 Name : "always" ,
310312 },
311313 }
312- ascendMounts := tryGetBindAscendMounts ()
314+ ascendMounts := tryGetBindAscendMounts (printer )
313315 if len (ascendMounts ) > 0 {
314316 hostConfig .Mounts = append (hostConfig .Mounts , ascendMounts ... )
315317 }
0 commit comments