Recent

Author Topic: NumCPULib4Pascal  (Read 1894 times)

Xor-el

  • Sr. Member
  • ****
  • Posts: 384
Re: NumCPULib4Pascal
« Reply #15 on: August 07, 2019, 05:48:04 pm »
Works perfectly fine on the Raspberry Pi (all versions)
Used this code, because I could not stand the superfluous format() use  ;D ;D
Code: Pascal  [Select]
  1. program cpulibtest;
  2. uses
  3.   numcpulib;
  4. begin
  5.     WriteLn('Logical CPU Count is ', TNumCPULib.GetLogicalCPUCount);
  6.     WriteLn('Physical CPU Count is ', TNumCPULib.GetPhysicalCPUCount);
  7. end.

Outputs:
Code: Bash  [Select]
  1. Logical CPU Count is 4
  2. Physical CPU Count is 4

Lol, thanks for testing.

totya

  • Hero Member
  • *****
  • Posts: 577
Re: NumCPULib4Pascal
« Reply #16 on: August 07, 2019, 05:49:17 pm »
Was this by any chance run in a VM?

My english is very weak, so my answer what I understood, so I don't use any virtual machine now, this sample run on my "clean" windows 7 x 64 OS.

Xor-el

  • Sr. Member
  • ****
  • Posts: 384
Re: NumCPULib4Pascal
« Reply #17 on: August 07, 2019, 05:54:39 pm »
Was this by any chance run in a VM?

My english is very weak, so my answer what I understood, so I don't use any virtual machine now, this sample run on my "clean" windows 7 x 64 OS.

And you are sure your PC has just one physical CPU?
« Last Edit: August 07, 2019, 05:58:15 pm by Xor-el »

totya

  • Hero Member
  • *****
  • Posts: 577
Re: NumCPULib4Pascal
« Reply #18 on: August 07, 2019, 06:06:30 pm »
And you are sure your PC has just one physical CPU?

I repair the computers in my workplace becuase the local IT cant fix anything, so what do you think, can I know how many cpu sleep in my mainboard? :)

Edit.: I added a screenshot of motheboard page from the CPU-Z app too ;)
« Last Edit: August 07, 2019, 06:18:50 pm by totya »

Xor-el

  • Sr. Member
  • ****
  • Posts: 384
Re: NumCPULib4Pascal
« Reply #19 on: August 07, 2019, 06:21:08 pm »
And you are sure your PC has just one physical CPU?

I repair the computers in my workplace becuase the local IT cant fix anything, so what do you think, can I know how many cpu sleep in my mainboard? :)

sorry if my question seemed out of place but your PC has 2 Cores which CPU-Z and My Library agrees on.  :)


winni

  • Hero Member
  • *****
  • Posts: 602
Re: NumCPULib4Pascal
« Reply #20 on: August 07, 2019, 07:10:07 pm »
Hi!

Hardware: AMD Ryzen 5 2400 g (4 cores, 8 threads)
OS: Suse Tumbleweed

reports:

Logical CPU Count is 8
Physical CPU Count is 8

What kind of count is going on?

Winni






TraumTaenzerDieter

  • New Member
  • *
  • Posts: 25
Re: NumCPULib4Pascal
« Reply #21 on: August 07, 2019, 08:06:54 pm »
Hi,
my hardware: AMD Ryzen 5 1500x (4 Cores, 8 Threads),
my OS: Win7 64

report says:
physical 4, logical 8,
so everything is okay!

Xor-el

  • Sr. Member
  • ****
  • Posts: 384
Re: NumCPULib4Pascal
« Reply #22 on: August 07, 2019, 08:19:10 pm »
Hi!

Hardware: AMD Ryzen 5 2400 g (4 cores, 8 threads)
OS: Suse Tumbleweed

reports:

Logical CPU Count is 8
Physical CPU Count is 8

What kind of count is going on?

Winni

Hi Winni, is this a Virtual Machine?

Xor-el

  • Sr. Member
  • ****
  • Posts: 384
Re: NumCPULib4Pascal
« Reply #23 on: August 07, 2019, 08:21:39 pm »
Hi,
my hardware: AMD Ryzen 5 1500x (4 Cores, 8 Threads),
my OS: Win7 64

report says:
physical 4, logical 8,
so everything is okay!

Thanks for testing.

winni

  • Hero Member
  • *****
  • Posts: 602
Re: NumCPULib4Pascal
« Reply #24 on: August 07, 2019, 08:50:24 pm »
@Xor-el

No, this is native Suse Linux!

Winni

winni

  • Hero Member
  • *****
  • Posts: 602
Re: NumCPULib4Pascal
« Reply #25 on: August 07, 2019, 09:04:33 pm »
@Xor-el

The AMD processor page says definitly: 4 cores, 8 threads

The KDE Info Center reports 8 cores!

HardInfo reports 8 processors but doesn't say nothing if physical or logical!

This is a land of confusion ....

Winni

Xor-el

  • Sr. Member
  • ****
  • Posts: 384
Re: NumCPULib4Pascal
« Reply #26 on: August 07, 2019, 09:24:47 pm »
@Xor-el

The AMD processor page says definitly: 4 cores, 8 threads

The KDE Info Center reports 8 cores!

HardInfo reports 8 processors but doesn't say nothing if physical or logical!

This is a land of confusion ....

Winni

Confusion everywhere  :D :D :D :D :D :D :D

winni

  • Hero Member
  • *****
  • Posts: 602
Re: NumCPULib4Pascal
« Reply #27 on: August 07, 2019, 10:25:55 pm »
@Xor-el

In the case of linux it seems to be the easiest way to read /proc/cpuinfo. There is a very lot of information, but the two needed values are present:

......
processor       : 7
vendor_id       : AuthenticAMD
cpu family      : 23
model           : 17
model name      : AMD Ryzen 5 2400G with Radeon Vega Graphics
stepping        : 0
microcode       : 0x810100b
cpu MHz         : 1458.000
cache size      : 512 KB
physical id     : 0
siblings        : 8
core id         : 3
cpu cores       : 4
.........

That seems to be a secure and easy way.

Winni

Xor-el

  • Sr. Member
  • ****
  • Posts: 384
Re: NumCPULib4Pascal
« Reply #28 on: August 07, 2019, 10:30:42 pm »
@Xor-el

In the case of linux it seems to be the easiest way to read /proc/cpuinfo. There is a very lot of information, but the two needed values are present:

......
processor       : 7
vendor_id       : AuthenticAMD
cpu family      : 23
model           : 17
model name      : AMD Ryzen 5 2400G with Radeon Vega Graphics
stepping        : 0
microcode       : 0x810100b
cpu MHz         : 1458.000
cache size      : 512 KB
physical id     : 0
siblings        : 8
core id         : 3
cpu cores       : 4
.........

That seems to be a secure and easy way.

Winni

I do know but if you look carefully, you will notice there are about 8 occurences of cpu cores       : 4 in your output

winni

  • Hero Member
  • *****
  • Posts: 602
Re: NumCPULib4Pascal
« Reply #29 on: August 07, 2019, 10:54:58 pm »
Yes the info in /proc/cpuinfo is a little bit complicated. In the moment I found only a german page which explains it:
https://linuxwiki.de/proc/cpuinfo

The main issues are:

For every logical CPU there is an info block in the file - in your case 8, in mine 8.

So there is redundand info in the blocks. But even if it 4 or 8 times appears - the info is: There are 4 cores. And the same with the siblings. So dont't be afraid that you got suddenly 32 cores!

Winni