Besides just running an infinite loop, are there any tricks (like maybe cache misses?) to making a CPU as hot as possible?
This could be architecture specific or not.
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It only takes a minute to sign up.Sign up to join this community
I know cpuburn had special switches to turn on platform specific instructions for getting the maximum heat out and since the source code is readily available under the liberal MIT license, you can just peek at the code your self.
Generally performing the most complex operations possible - e.g. floating point, SIMD, etc. - will raise the temperature the most. The more logic in the CPU you can exercise at the same time, the hotter it will get. Simply running a while loop won't do much more than prevent the CPU from going to sleep.
Dynamic power in a digital circuit can be approximated by the equation $$P = N \cdot f \cdot C \cdot V^2$$
where V is the supply voltage, C is the capacitance of a logic gate, f is the clock frequency, and N is the average number of gates switching every cycle. So first, turn up the voltage and clock frequency -- especially the voltage!
The gate capacitance is fixed by the manufacturing process and physical layout. That leaves N. You need to get the most gates possible switching as often as they can. This is inherently architecture-specific. You have to consider things like parallelism, the presence of coprocessors, on-board cache memory, and whatever clock- or voltage-gating the CPU uses to save power. The program will be written in hand-crafted assembly code with a lot of trial and error. Even a CPU designer probably couldn't figure out the absolute worst case software without experimenting.