§ ¶How I ran AMD CodeAnalyst on an Intel CPU
It's been asked how I managed to run AMD CodeAnalyst on an Intel CPU, since the documentation and Wikipedia page says that it requires an AMD CPU. Someone suggested that I might have hacked out the CPUID check.
I actually used the following very sneaky technique:
- Install CodeAnalyst.
- Run CodeAnalyst.
CodeAnalyst works fine on an Intel CPU, as long as you use Time-Based Sampling (TBS). It will blue-screen the machine if you use Event-Based Sampling (EBS) or Pipeline Simulation, or at least it used to. Call graph profiling might not work either, but I never use that anyway.
As for why CodeAnalyst works on Intel CPUs, only AMD knows for sure, but there are good reasons for doing so. One reason is that you can analyze runs on a different machine than the one that did the profile; another is that the vast majority of optimization benefits execution on any CPU. A third possible reason is simply that it happens to work and there's no reason to spend time breaking it. In any case, I'm glad that this is the case, because CodeAnalyst is free and easy to install, and even though it's not the fanciest sampling profiler, it works.
(Disclaimer: This is version 2.84. Might not work on some future version.)
You Are definitely a master Hacker!!
nine - 04 11 09 - 19:58
Thanks for the tip - the last time I needed to profile something on my Core 2 Quad I had to resort to Microsoft's VS2008 Performance Tools and the command line... gonna try it out next time. :)
Leak - 05 11 09 - 05:43
You remind me of something that's supposed to have happened long time ago - some physicist once calculated that silicone monocrystals can't grow more than 15 cm in diameter or they collapse. So everybody was making 15 cm monocrystals ... except one company which wasn't aware of the research so they were happily creating perfect 30 cm ones :)
Might be an urban legend though.
Kasuha - 05 11 09 - 22:22
Is CodeAnalyst faster / lighter / more reliable than Intel's VTune? VTune is an ugly beast and oprofile isn't very intuitive, so it'd be nice to find an alternative.
splicer - 07 11 09 - 08:13
Argh... my machine just crashed, and analyzing the dump file Windows spat out that it's cause was a driver (AMPCORE.SYS) installed by AMD CodeAnalyst - not cool. :(
Leak - 07 11 09 - 09:37
CodeAnalyst is lighter than VTune, yes, but it's UI isn't as powerful. It can't collect samples by file or by namespace, and it can't do automated detection of basic blocks in foreign disassembly.
As for the blue screen, some threads in the CA forum seem to indicate that the problem may be stray interrupts hitting the CodeAnalyst driver while it isn't active. You might try disabling the CodeAnalyst service when you're not using it, if it's running.
Phaeron - 07 11 09 - 13:31
Another alternative is the profiler in VS2008. Running pgomgr /summary returns a list of functions sorted by cpu usage. Unfortunately the instrumented application is noticeably slower.
Haali - 07 11 09 - 23:58
Phaeron helping with GCC could make the whole opensource-world a bit faster xD
Your blog is always such a fine evening literature =)
Draget - 08 11 09 - 02:31
Wouldnt it be better to get an AMD CPU and also at the same time benefit from the performance counters provided and utilize the CodeAnalyst (and also now CodeXL) more efficiently?
Evren Yurtesen - 14 11 12 - 07:25
Please keep comments on-topic for this entry.
If you have unrelated comments about VirtualDub, the forum is a better place to post them.