Location>code7788 >text

When multiple cores become single cores: the ultimate guide to solving the mysterious disappearance of CPU cores!

Popularity:872 ℃/2024-10-23 22:14:32

CPU Core and Thread Identification Problem Solving Document


1. contexts

Running on a physical hostlscpu command, I found that the system only recognized the1 core and 1 thread, despite the fact that the mainframe carries theIntel Xeon E5-2686 v4 The processor should have multiple cores and threads. This situation indicates that the system is not recognizing the CPU resources correctly and requires further troubleshooting and resolution.
image


2. preliminary screening

first bylscpu Output confirms the current CPU recognition:

lscpu

The output is as follows:

Architecture: x86_64
CPU: 1
Number of threads per core: 1
Number of cores per seat: 1
Block: 1
Model Name: Intel(R) Xeon(R) CPU E5-2686 v4 @ 2.30GHz

The above shows that the system only recognizes the1 core cap (a poem)1 thread, which clearly doesn't match the hardware configuration.


3. Viewing system startup parameters

To further troubleshoot the problem, check/proc/cmdline file to see the parameters used when the system boots:

cat /proc/cmdline

The output is as follows:

BOOT_IMAGE=/boot/vmlinuz-6.8.0-47-generic root=UUID=bcde7882-62a5-4ddc-a9e6-4f2ed6a6e8a3 ro quiet splash acpi=off =7

By examining the startup parameters, it was found that the startup uses theacpi=offThis means that ACPI (Advanced Configuration and Power Interface) is disabled, which is an important module for managing system hardware and power, and disabling it will cause the system to fail to correctly recognize hardware resources such as CPU cores, memory, and so on.


4. Analysis of the cause of the problem

due toacpi=off parameter is enabled, the system cannot use ACPI to correctly identify the number of CPU cores and threads. This is the main reason why the system only shows 1 core and 1 thread. To solve this problem, you need to remove theacpi=off Parameters.


5. Workout steps

5.1 removesacpi=off parameters
  1. Edit the GRUB configuration file:

    sudo nano /etc/default/grub
    
  2. Find the following line in the editor:

    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash acpi=off"
    
  3. removingacpi=off parameter, the modified line should look as follows:

    GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
    
  4. Save and exit the editor (in thenano snapshotCtrl + O Preservation.Ctrl + X (Exit).

5.2 Update GRUB and reboot the system
  1. Update the GRUB configuration to apply the changes:

    sudo update-grub
    
  2. Reboot the system:

    sudo reboot
    

6. Verification results

After rebooting, runlscpu Check the CPU core and thread recognition again:

lscpu

image

The system should be able to recognize the full CPU core and thread count.


7. Other possibilities to be ranked

If you remove theacpi=off After that the problem persists and you can continue to troubleshoot the following areas:

  1. BIOS Setup

    • Go into the motherboard BIOS setup and make sure Multi-Core and Hyper-Threading are enabled.
  2. Kernel or system configuration

    • Check the system startup parameters to make sure there are no other parameters that limit the number of CPU cores, such asmaxcpus
  3. CPU driver or firmware problems

    • Make sure that the system's kernel and CPU microcode have been updated to the latest version. You can use the following command to update the firmware:
      sudo apt update
      sudo apt upgrade
      sudo apt install intel-microcode
      
  4. Hardware issues

    • If all else fails, you may need to check the physical connections between the CPU and the motherboard, or use a hardware diagnostic tool to confirm the presence of a hardware failure.

8. summarize

On this physical host, theacpi=off The system is not able to recognize multi-core CPUs correctly. by removing this parameter and restarting the system, the system should be able to recognize all the cores and threads correctly. If the problem still exists, you can continue to further troubleshoot from BIOS setting, kernel configuration, firmware update and hardware status.