@@ -275,7 +275,8 @@ def get_avail_core_count():
275275 core_cnt = int (sum (sched_getaffinity ()))
276276 else :
277277 # BSD-type systems
278- out , _ = run_cmd ('sysctl -n hw.ncpu' , force_in_dry_run = True , trace = False , stream_output = False , with_hooks = False )
278+ out , _ = run_cmd ('sysctl -n hw.ncpu' , force_in_dry_run = True , trace = False , stream_output = False ,
279+ with_hooks = False , with_sysroot = False )
279280 try :
280281 if int (out ) > 0 :
281282 core_cnt = int (out )
@@ -312,7 +313,8 @@ def get_total_memory():
312313 elif os_type == DARWIN :
313314 cmd = "sysctl -n hw.memsize"
314315 _log .debug ("Trying to determine total memory size on Darwin via cmd '%s'" , cmd )
315- out , ec = run_cmd (cmd , force_in_dry_run = True , trace = False , stream_output = False , with_hooks = False )
316+ out , ec = run_cmd (cmd , force_in_dry_run = True , trace = False , stream_output = False , with_hooks = False ,
317+ with_sysroot = False )
316318 if ec == 0 :
317319 memtotal = int (out .strip ()) // (1024 ** 2 )
318320
@@ -394,15 +396,16 @@ def get_cpu_vendor():
394396
395397 elif os_type == DARWIN :
396398 cmd = "sysctl -n machdep.cpu.vendor"
397- out , ec = run_cmd (cmd , force_in_dry_run = True , trace = False , stream_output = False , log_ok = False , with_hooks = False )
399+ out , ec = run_cmd (cmd , force_in_dry_run = True , trace = False , stream_output = False , log_ok = False ,
400+ with_hooks = False , with_sysroot = False )
398401 out = out .strip ()
399402 if ec == 0 and out in VENDOR_IDS :
400403 vendor = VENDOR_IDS [out ]
401404 _log .debug ("Determined CPU vendor on DARWIN as being '%s' via cmd '%s" % (vendor , cmd ))
402405 else :
403406 cmd = "sysctl -n machdep.cpu.brand_string"
404407 out , ec = run_cmd (cmd , force_in_dry_run = True , trace = False , stream_output = False , log_ok = False ,
405- with_hooks = False )
408+ with_hooks = False , with_sysroot = False )
406409 out = out .strip ().split (' ' )[0 ]
407410 if ec == 0 and out in CPU_VENDORS :
408411 vendor = out
@@ -505,7 +508,8 @@ def get_cpu_model():
505508
506509 elif os_type == DARWIN :
507510 cmd = "sysctl -n machdep.cpu.brand_string"
508- out , ec = run_cmd (cmd , force_in_dry_run = True , trace = False , stream_output = False , with_hooks = False )
511+ out , ec = run_cmd (cmd , force_in_dry_run = True , trace = False , stream_output = False , with_hooks = False ,
512+ with_sysroot = False )
509513 if ec == 0 :
510514 model = out .strip ()
511515 _log .debug ("Determined CPU model on Darwin using cmd '%s': %s" % (cmd , model ))
@@ -550,7 +554,8 @@ def get_cpu_speed():
550554 elif os_type == DARWIN :
551555 cmd = "sysctl -n hw.cpufrequency_max"
552556 _log .debug ("Trying to determine CPU frequency on Darwin via cmd '%s'" % cmd )
553- out , ec = run_cmd (cmd , force_in_dry_run = True , trace = False , stream_output = False , with_hooks = False )
557+ out , ec = run_cmd (cmd , force_in_dry_run = True , trace = False , stream_output = False , with_hooks = False ,
558+ with_sysroot = False )
554559 out = out .strip ()
555560 cpu_freq = None
556561 if ec == 0 and out :
@@ -599,7 +604,7 @@ def get_cpu_features():
599604 cmd = "sysctl -n machdep.cpu.%s" % feature_set
600605 _log .debug ("Trying to determine CPU features on Darwin via cmd '%s'" , cmd )
601606 out , ec = run_cmd (cmd , force_in_dry_run = True , trace = False , stream_output = False , log_ok = False ,
602- with_hooks = False )
607+ with_hooks = False , with_sysroot = False )
603608 if ec == 0 :
604609 cpu_feat .extend (out .strip ().lower ().split ())
605610
@@ -626,8 +631,8 @@ def get_gpu_info():
626631 try :
627632 cmd = "nvidia-smi --query-gpu=gpu_name,driver_version --format=csv,noheader"
628633 _log .debug ("Trying to determine NVIDIA GPU info on Linux via cmd '%s'" , cmd )
629- out , ec = run_cmd (cmd , simple = False , log_ok = False , log_all = False ,
630- force_in_dry_run = True , trace = False , stream_output = False , with_hooks = False )
634+ out , ec = run_cmd (cmd , simple = False , log_ok = False , log_all = False , force_in_dry_run = True ,
635+ trace = False , stream_output = False , with_hooks = False , with_sysroot = False )
631636 if ec == 0 :
632637 for line in out .strip ().split ('\n ' ):
633638 nvidia_gpu_info = gpu_info .setdefault ('NVIDIA' , {})
@@ -645,15 +650,15 @@ def get_gpu_info():
645650 try :
646651 cmd = "rocm-smi --showdriverversion --csv"
647652 _log .debug ("Trying to determine AMD GPU driver on Linux via cmd '%s'" , cmd )
648- out , ec = run_cmd (cmd , simple = False , log_ok = False , log_all = False ,
649- force_in_dry_run = True , trace = False , stream_output = False , with_hooks = False )
653+ out , ec = run_cmd (cmd , simple = False , log_ok = False , log_all = False , force_in_dry_run = True ,
654+ trace = False , stream_output = False , with_hooks = False , with_sysroot = False )
650655 if ec == 0 :
651656 amd_driver = out .strip ().split ('\n ' )[1 ].split (',' )[1 ]
652657
653658 cmd = "rocm-smi --showproductname --csv"
654659 _log .debug ("Trying to determine AMD GPU info on Linux via cmd '%s'" , cmd )
655- out , ec = run_cmd (cmd , simple = False , log_ok = False , log_all = False ,
656- force_in_dry_run = True , trace = False , stream_output = False , with_hooks = False )
660+ out , ec = run_cmd (cmd , simple = False , log_ok = False , log_all = False , force_in_dry_run = True ,
661+ trace = False , stream_output = False , with_hooks = False , with_sysroot = False )
657662 if ec == 0 :
658663 for line in out .strip ().split ('\n ' )[1 :]:
659664 amd_card_series = line .split (',' )[1 ]
@@ -900,7 +905,7 @@ def get_tool_version(tool, version_option='--version', ignore_ec=False):
900905 Output is returned as a single-line string (newlines are replaced by '; ').
901906 """
902907 out , ec = run_cmd (' ' .join ([tool , version_option ]), simple = False , log_ok = False , force_in_dry_run = True ,
903- trace = False , stream_output = False , with_hooks = False )
908+ trace = False , stream_output = False , with_hooks = False , with_sysroot = False )
904909 if not ignore_ec and ec :
905910 _log .warning ("Failed to determine version of %s using '%s %s': %s" % (tool , tool , version_option , out ))
906911 return UNKNOWN
0 commit comments