I built my first PC last week and since then I'm having a random CPU spike on all cores ( goes around %50 to %99 ) and it slows down everything for 2-3 seconds then system gets back to normal operation and it happens again after 5-30 minutes or so, I have Ryzen 5 1600 and my graphic card is XFX Rx 580 8GB.
All the drivers are updated and I'm using the latest windows 10 ( Windows 10, version 1709 ), It's a fresh windows and because this problem occurs randomly it was really hard to find out what is going on and what program is causing the problem, In task manager every time that this spike happens it shows the process as system and the file is "ntoskrnl.exe" but by help of Windows Performance Analyzer I found out that the problem is in "Atikmdag.sys and ntoskrnl.exe ", It appears these two eats my CPU and it jumps to %99 ! To be honest I don't know what to do anymore.
I'm thinking maybe my graphic card is defective but that doesn't make sense since I'm able to play games without any problem and this happens randomly.
Also I have updated the bios to the latest version and this is my spec :
Ryezn 5 1600
XFX GTS XXX Edition RX 580 8GB
Asus ROG STRIX B350-F GAMING
Corsair Vengeance LPX (2x4GB) DDR4 DRAM 3000MHz ( running on 3000mhz)
EVGA 450 BT, 80+ Bronze 450W
Seagate 2TB BarraCuda
Crucial MX300 275 GB ( latest firmware )
Please help me to solve this problem.