The UNEXPECTED KERNEL MODE TRAP error is a Blue Screen of Death (BSOD) that can suddenly appear while you are running an application or updating your Windows. In technical terms, this occurs because the kernel is unable to catch the trap generated by the CPU.

What causes this error?

Usually, the reason for this is a faulty RAM module or defective/out-of-service drivers. You should run the Windows Memory Diagnostic tool to repair any problems in the memory. Secondly, update your graphics card and other drivers to the newest versions.

The dust in your CPU components can also be the cause of this problem, as it makes the computer overheat and underperform. Therefore, it is recommended to clean your PC carefully every 3-6 months.

How can I fix the UNEXPECTED KERNEL MODE TRAP error?

The issue is surely annoying, especially when it starts to happen every time you try to start your computer. However, there is no need to worry, as we will guide you through nine different solutions to counter this BSOD.

1. Thoroughly clean up your PC.

Before implementing any software solutions, try cleaning your system and removing any dust. The CPU compartments can become dirty over time and require thorough cleaning.

First, disconnect the USB, printer, mouse, keyboard, and any other peripheral devices. Cleaning does not mean scrubbing the PC with soap or shampoo. Simply take a cotton swab, microfiber cloth, or a brush with soft bristles and gently rub it over the different components. The assistance of an air blower can also be utilized for quick work.

Begin by cleaning the CPU fan, RAM modules, hard drives, graphics drivers, and the rest of the sections. Once done, connect your peripheral devices and power on the computer to see whether the error has been rectified.

2. Remove and reconnect the hardware.

Newly installed hardware can also cause this BSOD issue sometimes. If you have recently installed a RAM module, hard drive, PCI/VGA cards, or anything else, try removing it and restarting your PC. If the error no longer appears, that particular hardware component was the problem.

In case you haven’t received any new updates for the hardware, remove the pre-installed peripheral devices, except for the keyboard and mouse. Now, boot up your system and start connecting the removed devices, one at a time, until one of them causes the UNEXPECTED KERNEL MODE TRAP error.

Now all you need to do is update the software of that particular device or change it completely.

3. Run the Hardware and Devices Troubleshooter.

Running the Hardware and Devices troubleshooter will further identify the corrupt hardware device generating this error. This troubleshooter will determine the issue and guide you on how to fix it.

  1. Press the Win + R keys and enter: msdt.exe -id DeviceDiagnostic.

  1. Now click OK to open the hardware troubleshooter.
  2. Click Next to start the scan.

  1. Wait for the identification of the problem.
  2. Follow the onscreen instructions.

4. Run the Windows Memory Diagnostic Tool.

The Windows Memory Diagnostic tool runs various tests on the RAM and notifies the user if the memory module fails any of them. If the RAM is unable to pass a test, it means it needs to be replaced. A malfunctioning RAM is one of the primary reasons for the error we are addressing.

For this process, your computer needs to boot up correctly. If it is failing to start, then power it up in Safe Mode. Follow our comprehensive guide on how to boot Windows 10 and Windows 11 in Safe Mode.

Once done, follow the instructions below.

  1. Open ‘Run‘ using the Win + R keys.
  2. Paste the following and press Enter: mdsched.exe.
  3. Select the ‘Restart Now‘ option to start the process immediately. If you want to do it later, select the second option.

  1. The computer will now restart and start checking the memory.
  2. Once the diagnosis is complete, you can view the report to see if there are any issues with the RAM.

5. Update device drivers.

It is always recommended to update your device drivers if new updates are available. Outdated drivers are not only a reason for unexpected kernel mode traps.

Here is how to update a device driver:

  1. Begin by pressing the Win + R keys together, then type “devmgmt.msc” in the Run dialog box and hit Enter.
  2. Click OK or press Enter.
  3. Click on the small drop-down arrow next to the Sound, video, and game controllers menu to expand it.
  4. Right-click on the graphics card you want to update, and then click on “Update Driver.

  1. Select the option: Search automatically…software.

  1. Install any available updates.

You can follow the same steps to update the drivers for network adapters, display adapters, disk drives, etc.

6. Disable memory caching in BIOS.

Memory caching essentially refers to the process by which applications and programs save a small portion of data in the RAM for quick access. Unfortunately, this can also be another source of the blue screen of death error.

To disable this option, users need to boot into the BIOS menu as follows:

  1. Restart your PC and as soon as the BIOS prompt appears, enter the BIOS setup key. The key varies from model to model; however, some common ones are F2, F10, Del, and Esc. If these keys don’t open BIOS for you, try the ones mentioned in our dedicated article for accessing BIOS.
  2. If you are unable to enter BIOS this way, let your PC boot up completely and then open the Windows Start menu.
  3. Hold shift and click on Restart.
  4. Navigate to Troubleshoot > Advanced Options.

  1. Go to UEFI Firmware Settings > Restart.

  1. You’ll now be in the BIOS menu.

Now that you have booted into BIOS, follow the steps below to disable memory caching:

  1. Click on the Advanced tab.
  2. Navigate to Cache Memory and enter its settings.

  1. Use the arrow keys to navigate to the ‘Enabled’ option next to ‘Memory Cache.’
  2. Use the change key to toggle the option to Disabled. The change keys are usually the +/- keys but they can vary for different models.

  1. Now go to the Exit tab.
  2. Click on Save Changes and exit BIOS. You can also directly press F10 for this purpose.

7. Run the SFC and DISM scans.

The SFC command will look for any faulty or corrupt files in the system and will fix them automatically. Secondly, the DISM scan will repair the image of the Windows operating system. In case there is an internal problem on your computer due to a malfunctioning file that may be causing the UNEXPECTED KERNEL MODE TRAP, it won’t be long before these scans rectify it.

Here’s how to run SFC and DISM to repair Windows:

  1. Open the Start menu and type cmd.
  2. Run the command prompt as an administrator.
  3. Now run the following commands in order:
    sfc /scannow
    exe /Online /Cleanup-image /CheckHealth
    exe /Online /Cleanup-image /ScanHealth
    exe /Online /Cleanup-image /RestoreHealth

8. Run the CHKDSK Scan.

The Check Disk (CHKDSK) command can scan all of your hard drives and SSDs to repair them or clean them up for better processing. In other words, it will fix all the bad sectors on the hard drives.

Here’s how to run CHKDSK:

  1. Run the Command Prompt as an administrator.
  2. Type the following and hit Enter:
    chkdsk C: /f

Note: This will scan the C drive. To scan other drives, you must make a slight adjustment. For instance, to scan the E drive, change the command to ‘chkdsk E: /f’. For the D drive, it will become ‘chkdsk D: /f’, and so on.

Now, wait for the scan to complete and look for any errors in the disk.

9. Perform a clean boot of Windows.

Performing a clean boot is equivalent to starting Windows with just the essential services and default programs. Generally, when you start a computer in normal mode, many unnecessary programs and services automatically start and begin to consume RAM. This overheats the CPU, resulting in blue screens of death.

Therefore, it is recommended to perform a clean boot on your system every once in a while (every 2-3 months) just to ensure that Windows performance remains at its highest.

Follow our detailed guide on how to perform a clean boot in Windows and carry out the prescribed steps.


Abdullah Iqbal

Abdullah is a Google IT certified Help Desk Technician with extensive experience in providing technical support to system users. He has a proven track record of effectively resolving IT issues, and is adept at working with tools like Jira and ZenDesk to efficiently manage support tickets. Abdullah is committed to staying up-to-date with the latest technological advancements and constantly seeks to improve his skills and knowledge through professional development opportunities.