# New CPU, enable SMP



## Weaseal (Jan 16, 2009)

Hi all,
I just replaced my AMD Athlon64 3500+ (single core) with a dual-core 4200+.  Do I have to do anything to get FreeBSD to access the extra core?  I made sure options SMP is enabled in the kernel config.

Is there a way to dynamically check to see how many cores it recognizes?


----------



## ale (Jan 16, 2009)

Check with `$ sysctl hw.ncpu`


----------



## DutchDaemon (Jan 16, 2009)

And also top -P should show how many CPUs are used (and how).


----------



## Weaseal (Jan 16, 2009)

```
$ sysctl hw.ncpu
hw.ncpu: 1

$ dmesg | grep -i cpu
CPU: AMD Athlon(tm) 64 Processor 4200+ (2200.10-MHz K8-class CPU)
cpu0: <ACPI CPU> on acpi0
powernow0: <Cool`n'Quiet K8> on cpu0
acpi_throttle0: <ACPI CPU Throttling> on cpu0
```
What gives?


----------



## kamikaze (Jan 16, 2009)

Maybe the second core is deactivated in the BIOS. In FreeBSD 7.1 the default kernel is an SMP kernel, so you do not have to activate anything.


----------



## Weaseal (Jan 16, 2009)

I have read somewhere online that some motherboards require you to flash the BIOS when replacing a CPU (especially if you are adding cores)... could this be it?

I'll double-check the BIOS.


----------



## kamikaze (Jan 16, 2009)

It might be that the CPU was not available when your motherboard was built and you require a new BIOS version.


----------



## cpcnw (Mar 2, 2010)

I'd like to attempt a custom kernel on my X2 - currently ;


```
$ cat /var/run/dmesg.boot | grep CPU
CPU: AMD Athlon(tm) 64 X2 Dual Core Processor 5200+ (2700.27-MHz 686-class CPU)
FreeBSD/SMP: Multiprocessor System Detected: 2 CPUs
cpu0: <ACPI CPU> on acpi0
cpu1: <ACPI CPU> on acpi0
SMP: AP CPU #1 Launched!
```

and


```
$ top -P [sniped]
CPU 0:  0.0% user,  0.0% nice,  0.0% system,  0.0% interrupt,  100% idle
CPU 1:  0.4% user,  0.0% nice,  0.0% system,  0.0% interrupt, 99.6% idle
```

Is CPU0 even used? And is all that is required is to leave in my KERNCONF;


```
options 	SMP			# Symmetric MultiProcessor Kernel
device		apic			# I/O APIC
```


----------

