File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -273,7 +273,7 @@ def cores_per_socket(self):
273
273
274
274
def get_number_of_sockets (self ) -> int :
275
275
"""Get number of sockets in platform."""
276
- cmd = "lscpu | grep 'Socket(s) ' | cut -d ':' -f 2 "
276
+ cmd = "cat /proc/cpuinfo | grep 'physical id ' | sort -u | wc -l "
277
277
if psutil .WINDOWS :
278
278
cmd = r'wmic cpu get DeviceID | C:\Windows\System32\find.exe /C "CPU"'
279
279
@@ -915,7 +915,7 @@ def dump_table_to_csv(
915
915
916
916
def get_number_of_sockets () -> int :
917
917
"""Get number of sockets in platform."""
918
- cmd = "lscpu | grep 'Socket(s) ' | cut -d ':' -f 2 "
918
+ cmd = "cat /proc/cpuinfo | grep 'physical id ' | sort -u | wc -l "
919
919
if sys .platform == "win32" :
920
920
cmd = 'wmic cpu get DeviceID | find /c "CPU"'
921
921
You can’t perform that action at this time.
0 commit comments