OPNsense Forum

English Forums => Hardware and Performance => Topic started by: guest41684 on December 21, 2023, 12:05:01 pm

Title: DEC750 only 4 logical cores
Post by: guest41684 on December 21, 2023, 12:05:01 pm
Hi everyone,

I bought a DEC750 a few days ago and I'm a bit confused regarding the logical cores.

The ryzen V1500B should have 8 logical cores with SMT but the web interface and the CLI (sysctl)
only show 4 logical cores.

SMT seems to be enabled but the sysctl output only shows 1 logical core per physical core.
Title: Re: DEC750 only 4 logical cores
Post by: guest41684 on December 22, 2023, 02:22:15 pm
Commands I used:

Code: [Select]
sudo sysinfo cpu
output:

Code: [Select]
Generated by SysInfo v1.0.1 by Daniel Gerzo

CPU information

Machine class: amd64
CPU Model: AMD Ryzen Embedded V1500B
No. of Cores: 4
Cores per CPU:

Code: [Select]
sudo sysctl kern.smp
output:

Code: [Select]
kern.smp.topology: 0
kern.smp.cores: 4
kern.smp.threads_per_core: 1
kern.smp.cpus: 4
kern.smp.disabled: 0
kern.smp.active: 1
kern.smp.maxcpus: 256
kern.smp.maxid: 3



Code: [Select]
sudo dmidecode
output:

Code: [Select]
Processor Information
Socket Designation: FP5
Type: Central Processor
Family: Zen
Manufacturer: Advanced Micro Devices, Inc.
ID: - (removed due to privacy concerns)
Signature: Family 23, Model 17, Stepping 0
Flags:
FPU (Floating-point unit on-chip)
VME (Virtual mode extension)
DE (Debugging extension)
PSE (Page size extension)
TSC (Time stamp counter)
MSR (Model specific registers)
PAE (Physical address extension)
MCE (Machine check exception)
CX8 (CMPXCHG8 instruction supported)
APIC (On-chip APIC hardware supported)
SEP (Fast system call)
MTRR (Memory type range registers)
PGE (Page global enable)
MCA (Machine check architecture)
CMOV (Conditional move instruction supported)
PAT (Page attribute table)
PSE-36 (36-bit page size extension)
CLFSH (CLFLUSH instruction supported)
MMX (MMX technology supported)
FXSR (FXSAVE and FXSTOR instructions supported)
SSE (Streaming SIMD extensions)
SSE2 (Streaming SIMD extensions 2)
HTT (Multi-threading)
Version: AMD Ryzen Embedded V1500B
Voltage: 1.2 V
External Clock: 100 MHz
Max Speed: 2200 MHz
Current Speed: 2200 MHz
Status: Populated, Enabled
Upgrade: None
L1 Cache Handle: 0x0005
L2 Cache Handle: 0x0006
L3 Cache Handle: 0x0007
Serial Number: Unknown
Asset Tag: Unknown
Part Number: Unknown
Core Count: 4
Core Enabled: 4
Thread Count: 8
Characteristics:
64-bit capable
Multi-Core
Hardware Thread
Execute Protection
Enhanced Virtualization
Power/Performance Control


So apparently SMT is enabled (see dmidecode output) but opnsense / freebsd do not see it.

I wonder whether that means that opnsense does not use the additional 4 threads ?
(which would make a big difference for e.g. wireguard)
Title: Re: DEC750 only 4 logical cores
Post by: Monviech on December 22, 2023, 02:56:22 pm
On my DEC740 it shows this:

Code: [Select]
root@opn02:~ # sysctl kern | grep core
kern.smp.cores: 4
kern.smp.threads_per_core: 2
FreeBSD/SMP: 1 package(s) x 4 core(s) x 2 hardware threads

So what you see is not normal as you suspect. I don't know how to fix it though, maybe some BIOS setting is wrong?
Title: Re: DEC750 only 4 logical cores
Post by: guest41684 on December 22, 2023, 03:07:59 pm
That is very interesting thank you.
What version of Opnsense are you running ?
I did not change anything in my BIOS, do we have to enable SMT ourselfs ? (I would have thought thats the default ...)

Because my output only shows 1 hardware thread per core:

Code: [Select]
admin@OPNsense:~ $ sudo sysctl kern | grep core
kern.smp.cores: 4
kern.smp.threads_per_core: 1
FreeBSD/SMP: 1 package(s) x 4 core(s)
FreeBSD/SMP: 1 package(s) x 4 core(s)
FreeBSD/SMP: 1 package(s) x 4 core(s)
FreeBSD/SMP: 1 package(s) x 4 core(s)


My BIOS version:
Code: [Select]
Vendor INSYDE Corp.
Version 05.32.50.0021-A10.28
Release Date 08/29/2023

My OPNsense version:
Code: [Select]
OPNsense 23.10.1-amd64
FreeBSD 13.2-RELEASE-p7


Cloud you tell me what you get when you check the following tunables ?

Code: [Select]
admin@OPNsense:~ $ sudo sysctl machdep | grep "thread"
machdep.hyperthreading_intr_allowed: 0
machdep.hyperthreading_allowed: 1
Title: Re: DEC750 only 4 logical cores
Post by: Monviech on December 22, 2023, 03:13:50 pm
What does this say?

Code: [Select]
root@opn02:~ # sysctl hw.ncpu
hw.ncpu: 8

Code: [Select]
root@opn02:~ # sysctl machdep.hyperthreading_allowed
machdep.hyperthreading_allowed: 1

Oh didn't see you edited already a few times.

Code: [Select]
root@opn02:~ # dmidecode -t bios
# dmidecode 3.5
# SMBIOS entry point at 0xce157000
Found SMBIOS entry point in EFI, reading table from /dev/mem.
SMBIOS 3.1 present.

Handle 0x0000, DMI type 0, 26 bytes
BIOS Information
        Vendor: INSYDE Corp.
        Version: 05.32.50.0014-A10.24
        Release Date: 12/14/2022
        Address: 0xE0000
        Runtime Size: 128 kB
        ROM Size: 7488 kB
        Characteristics:
Title: Re: DEC750 only 4 logical cores
Post by: guest41684 on December 22, 2023, 03:19:16 pm
Sorry for the edits, I will make new posts from now on.

ncpus are also 4 in my case:

Code: [Select]
admin@OPNsense:~ $ sudo sysctl hw.ncpu
hw.ncpu: 4

By the way what does the following print in your case ?

Code: [Select]
admin@OPNsense:~ $ sudo sysinfo system
Generated by SysInfo v1.0.1 by Daniel Gerzo

System information

Manufacturer: Deciso B.V.
Product Name: DEC2700 - OPNsense Appliance
Option 1: String1 for Type12 Equipment Manufacturer
Option 2: String2 for Type12 Equipment Manufacturer
Option 3: String3 for Type12 Equipment Manufacturer
Option 4: String4 for Type12 Equipment Manufacturer

INFO: Run `dmidecode -t system` to see further information.

Base board information
Manufacturer: Deciso B.V.
Product Name: Netboard-A10 Gen.3
Title: Re: DEC750 only 4 logical cores
Post by: Monviech on December 22, 2023, 03:21:14 pm
Code: [Select]
root@opn02:~ # sysinfo system
Generated by SysInfo v1.0.1 by Daniel Gerzo

System information

Manufacturer: Deciso B.V.
Product Name: NetBoard-A10
Option 1: String1 for Type12 Equipment Manufacturer
Option 2: String2 for Type12 Equipment Manufacturer
Option 3: String3 for Type12 Equipment Manufacturer
Option 4: String4 for Type12 Equipment Manufacturer

INFO: Run `dmidecode -t system` to see further information.

Base board information
Manufacturer: Deciso B.V.
Product Name: NetBoard-A10 Gen.3

Maybe write an Email to Deciso where you bought it and ask?
Title: Re: DEC750 only 4 logical cores
Post by: guest41684 on December 22, 2023, 03:26:55 pm
Thank you for your help so far  :)

Well yes I suppose I should ask them via mail and if that does not resolve it create a bug report on github.


I have just a few more questions, if you could spare the time I would appreciate it very much :)

Are you using the OPNsense community or business version ?
I use the business version 23.10.1

Also could you please tell me what your setting for the following is ?

Code: [Select]
machdep.hyperthreading_intr_allowed
Because mine shows 0:

Code: [Select]
admin@OPNsense:~ $ sudo sysctl machdep | grep "thread"
machdep.hyperthreading_intr_allowed: 0
machdep.hyperthreading_allowed: 1
Title: Re: DEC750 only 4 logical cores
Post by: stefan00 on December 22, 2023, 05:28:41 pm
4C / 8T on my DEC750

Bought last year, same CPU:

„AMD Ryzen Embedded V1500B (4 cores, 8 threads)“
(dashboard system info, no shell access right now)

Business edition, latest update.
Title: Re: DEC750 only 4 logical cores
Post by: guest41684 on December 22, 2023, 06:00:56 pm
Hi @stefan00
thank you very much for this information.

What is your bios version (You can get it from the dashboard, see the attached screenshot) ?
My BIOS version is:     
Code: [Select]
05.32.50.0021-A10.28

Do you have the version with the 1GB ports ?
I have the new version with the 2.5GB ports, so maybe it is related to that.


Also the dashboard says that I have a DEC2700 which is not correct but maybe the new DEC750
has the same hardware as the DEC2700.
Title: Re: DEC750 only 4 logical cores
Post by: guest41684 on December 22, 2023, 09:23:46 pm
FYI @Monviech @stefan
it is working now, I checked the BIOS settings and the SMT option (I found it under the "ZEN" settings) was indeed disabled.

I should have checked it right away, I just did not expect it to be disabled by default.


Merry Xmas and
thank you both for your help :)
Title: Re: DEC750 only 4 logical cores
Post by: guest41684 on December 23, 2023, 03:53:40 pm
Just in case someone else has this problem,

I did write an email to Deciso / the OPNsense team yesterday afternoon and I got a reply this morning.
Since I figured it out yesterday I did not need the instructions in the mail anymore
but in case someone else wants to enable HT/SMT (it is now disabled by default for new devices)
these are the instructions from Deciso / the OPNsense team:

Quote
We disable hyperthreading by default these days as in practice for networking it often has a (slight) negative effect on performance.

If you do want to enable HT, just go to the bios with the mini-usb cable supplied.

In order to reach the bios, you need serial console connectivity (https://docs.opnsense.org/hardware/serial_connectivity.html) and may press <ESC> during boot to go into the bios part.

 Inside the setup utility, go to AMD CBS -> Zen Common Options  -> Core/Thread Enablement  -> SMTEN  -> Auto

For my own use case I think it makes sense to enable it since (AFAIK) wireguard profits from HT / SMT.
Title: Re: DEC750 only 4 logical cores
Post by: nghappiness on December 26, 2023, 06:53:34 pm
Do you see any performance improvement after enabled SMT?