Bug 419388 - Wrong number of cores when run nproc or run multicore proccess
Summary: Wrong number of cores when run nproc or run multicore proccess
Status: RESOLVED NOT A BUG
Alias: None
Product: konsole
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Arch Linux Linux
: NOR major
Target Milestone: ---
Assignee: Konsole Developer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-29 18:11 UTC by Gustavo Alvarez
Modified: 2020-04-15 17:01 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
screensot yakuake, konsole and qterminal (128.46 KB, image/png)
2020-03-29 18:11 UTC, Gustavo Alvarez
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Gustavo Alvarez 2020-03-29 18:11:59 UTC
Created attachment 127092 [details]
screensot yakuake, konsole and qterminal

when run konsole (standalone or throuth dolphin) nproc or do a run multicore process, the number of cores is set wrongly

see attach

up: yakuake
left: Konsole
right: qterminal

EXPECTED RESULT


show the real number of cores/threads (40 in my case)

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.18.3
KDE Frameworks Version: 5.68.0
Qt Version: 5.14/5.15

ADDITIONAL INFORMATION

i have set isolcpus=10,11,22,23,34,35,46,47 nohz_full=10,11,22,23,34,35,46,47 rcu_nocbs=10,11,22,23,34,35,46,47 in boot. I need these cores for Virtualization (libvirt+cpupinned)

lscpu:
└───╼  lscpu
Arquitectura:                        x86_64
modo(s) de operación de las CPUs:    32-bit, 64-bit
Orden de los bytes:                  Little Endian
Tamaños de las direcciones:          46 bits physical, 48 bits virtual
CPU(s):                              48
Lista de la(s) CPU(s) en línea:      0-47
Hilo(s) de procesamiento por núcleo: 2
Núcleo(s) por «socket»:              12
«Socket(s)»                          2
Modo(s) NUMA:                        2
ID de fabricante:                    GenuineIntel
Familia de CPU:                      6
Modelo:                              79
Nombre del modelo:                   Genuine Intel(R) CPU 0000 @ 2.20GHz (Engineering Sample)
Revisión:                            0
CPU MHz:                             2195.060
CPU MHz máx.:                        2200,0000
CPU MHz mín.:                        1200,0000
BogoMIPS:                            4391.16
Virtualización:                      VT-x
Caché L1d:                           768 KiB
Caché L1i:                           768 KiB
Caché L2:                            6 MiB
Caché L3:                            60 MiB
CPU(s) del nodo NUMA 0:              0-11,24-35
CPU(s) del nodo NUMA 1:              12-23,36-47
Vulnerability:  secret ;)
Indicadores:                         fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 ds_cpl vmx smx est tm2
                                      ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cdp_l3 invpcid_single pti intel_ppin tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms 
                                     invpcid rtm cqm rdt_a rdseed adx smap intel_pt xsaveopt cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm arat pln pts


working as spected since ages. seems is a regression. i'm not sure when start failed
Comment 1 Gustavo Alvarez 2020-03-29 18:16:53 UTC
Htop (in yakuake) when run multicore proccess on konsole https://i.ibb.co/YdYLj0z/Screenshot-20200329-192231.png

same process run in yakuake https://i.ibb.co/SXJ75C3/Screenshot-20200329-193114.png
Comment 2 Kurt Hindenburg 2020-03-31 17:37:50 UTC
All of these are on the same system?  I can't see how Konsole is related; nproc is from the distro.
Comment 3 Gustavo Alvarez 2020-03-31 17:55:31 UTC
yes. same system, same session, same DE, same time...
Comment 4 Christoph Feck 2020-04-15 10:38:26 UTC
It seems because Konsole gets a different set of environment variables. In particular, check OMP_NUM_THREADS and OMP_THREAD_LIMIT.

nproc --help says: "Print the number of processing units available to the current process, which may be less than the number of online processors".
Comment 5 Gustavo Alvarez 2020-04-15 10:44:56 UTC
if nproc show the nimber of cores by OMP_NUM_THREADS and OMP_THREAD_LIMIT (never set in my system

┌─┤[$]|[sl1pkn07]|[sL1pKn07]|[~]|
└───╼  echo $OMP_NUM_THREADS

┌─┤[$]|[sl1pkn07]|[sL1pKn07]|[~]|
└───╼  echo $OMP_THREAD_LIMIT

┌─┤[$]|[sl1pkn07]|[sL1pKn07]|[~]|
└───╼  
Hi

then why if i do a multicore processor (like showed it in https://bugs.kde.org/show_bug.cgi?id=419388#c1), the process set wrongly in konsole but not in yakuake if nproc is not involve in the process?
Comment 6 Christoph Feck 2020-04-15 16:38:56 UTC
I don't know which other variables are responsible, but Konsole certainly does not change the output of nproc.

Please check also check "nproc --all".
Comment 7 Gustavo Alvarez 2020-04-15 17:01:20 UTC
`nproc --all` show all cores (include the cores setted as nohz_full/isolcpus in grub)

48