We found that various libraries depend on psutil to return the CPU core count. Calling psutil.cpu_count(logical=False) requires the presence of the files:
/sys/devices/system/cpu/cpu[0-9]/topology/core_cpus_list
/sys/devices/system/cpu/cpu[0-9]/topology/thread_siblings_list
See:
https://github.com/giampaolo/psutil/blob/fb68f9fae3b398899d87161746884ebb2a2613c0/psutil/_pslinux.py#L676We have a patch that populate these files, and allows psutil to work. Otherwise, psutil returns None which breaks libraries like AutoGluon. Currently, this problem is exclusive to ARM systems since psutil can also use the 'physical id' & 'cpu cores' fields in /proc/cpuinfo. However, these fields are not populated on ARM systems.
The question, I have regarding a patch is should core_cpus_list & thread_siblings_list match the hyper-threading configuration of the host system? For example if I have a 2 core system with hyper-threading should /sys/devices/system/cpu/cpu0/topology/core_cpus_list have the contents "0,2" or just "0"?
If we want to match the hyper-threading of the host system then what should be done if gVisor is limited to only see 1 core instead of 2? Should the file have the contents "0,1"?
Another alternative would be to only support this feature in ARM systems and skip Intel systems, thereby bypassing the hyper-threading discussion altogether and relying on /proc/cpuinfo being correct.
Thanks,
Gaurav