Per this question and answer -- Python multiprocessing.cpu_count() returns '1' on 4-core Nvidia Jetson TK1 -- the output of Python\'s multiprocessing.cpu_count()<
multiprocessing.cpu_count()<
Use psutil:
from the doc https://psutil.readthedocs.io/en/latest/:
>>> import psutil >>> psutil.cpu_count() 4 >>> psutil.cpu_count(logical=False) # Ignoring virtual cores 2
This is portable