Make system info reporting number of CPU sockets
This commit is contained in:
@@ -56,6 +56,23 @@ def getBlenderVersion(ctx):
|
|||||||
return info
|
return info
|
||||||
|
|
||||||
|
|
||||||
|
def getNumPhysicalCPUs_Linux():
|
||||||
|
ids = set()
|
||||||
|
with open("/proc/cpuinfo") as f:
|
||||||
|
for line in f.readlines():
|
||||||
|
if line.startswith("physical id"):
|
||||||
|
id = int(line.split(":", 1)[1])
|
||||||
|
ids.add(id)
|
||||||
|
return len(ids)
|
||||||
|
|
||||||
|
|
||||||
|
def getNumPhysicalCPUs():
|
||||||
|
if sys.platform == 'linux':
|
||||||
|
return getNumPhysicalCPUs_Linux()
|
||||||
|
else:
|
||||||
|
raise Exception("Needs implementation")
|
||||||
|
|
||||||
|
|
||||||
def gatherSystemInfo(ctx):
|
def gatherSystemInfo(ctx):
|
||||||
system_info = {}
|
system_info = {}
|
||||||
system_info['bitness'] = platform.architecture()[0]
|
system_info['bitness'] = platform.architecture()[0]
|
||||||
@@ -71,6 +88,7 @@ def gatherSystemInfo(ctx):
|
|||||||
system_info['cpu_brand'] = cpu_info['brand']
|
system_info['cpu_brand'] = cpu_info['brand']
|
||||||
system_info["num_cpu_cores"] = psutil.cpu_count(logical=False)
|
system_info["num_cpu_cores"] = psutil.cpu_count(logical=False)
|
||||||
system_info["num_cpu_threads"] = psutil.cpu_count(logical=True)
|
system_info["num_cpu_threads"] = psutil.cpu_count(logical=True)
|
||||||
|
system_info["num_cpu_sockets"] = getNumPhysicalCPUs()
|
||||||
system_info['devices'] = _getBlenderDeviceInfo(ctx)
|
system_info['devices'] = _getBlenderDeviceInfo(ctx)
|
||||||
# TODO(sergey): query number of CPUs and threads.
|
# TODO(sergey): query number of CPUs and threads.
|
||||||
return system_info
|
return system_info
|
||||||
|
Reference in New Issue
Block a user