In our application we have many versions of the same routine optimized for different kind of processor architectures. During install we run performance tests and select the best version of routine.
Latest processors can boost their frequencies if few cores are in use, so sometimes our tests peeking wrong version of routine. Is there some way to temporarily turn off Turbo Boost?
I don't know the opcode for enabling/disabling turbo boost directly, but apparently it's possible because TMonitor - which is a Windows application - can do it at runtime.
There are MSR registers (https://en.wikipedia.org/wiki/Model-specific_register) in Intel CPUs to disable/enable per-core turbo boost. In linux, there are msr-tools package which allow root to read/write to MSR registers. There are two posts about Turbo Boost disabling/enabling in Linux:
https://askubuntu.com/questions/619875/disabling-intel-turbo-boost-in-ubuntu "Disabling Intel Turbo Boost in ubuntu", answer by Maythux from 2015
http://luisjdominguezp.tumblr.com/post/19610447111/disabling-turbo-boost-in-linux
Disabling Turbo Boost in Linux, Luis J. Dominguez P, 2012-2013; Sandy Bridge - "38th bit of the 0x1a0 register."
http://notepad2.blogspot.com/2014/11/a-script-to-turn-off-intel-cpu-turbo.html
And there is kext for OSX to do the same: Disable Turbo Boost on Core i7 Mac?
In windows OS you can add the following reg key.
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Power\PowerSettings\54533251-82be-4824-96c1-47b60b740d00\be337238-0d82-4146-a960-4f3749d470c7]
"Attributes"=dword:00000002
Then in advanced power settings you will get new option that allows you turning off turbo boost.
Related
I am kinda new to Android Studio & stuff. So today, I was installing the Android Studio with the SDK Manager. All was going smooth until an error came up which says:
Unable to install Intel HAXM
Your CPU does not support required features (VT-x or SVM).
Unfortunately, your computer does not support hardware accelerated virtualization.
Here are some of your options:
Use a physical device for testing
Develop on a Windows/OSX computer with an Intel processor that
supports VT-x and NX
Develop on a Linux computer that supports VT-x or SVM
Use an Android Virtual Device based on an ARM system image (This
is 10x slower than hardware accelerated virtualization)
I've attached a pic of my system specs. Can someone please throw some light on this issue?
Thanks
It is because you had not intialize virtual technology in your device.You Need to go in BOOT Option before starting WINDOWS OS and enable VT-x from there>
The option of enabling Virtual technology is putted in different option depends on device manufacturer
Edit: Android Studio emulator won't run on Windows with an AMD processor. The error message is kind of misleading, as it suggests the problem is with your CPU. But it is within the troubleshoot message: "Windows/OSX computer with an Intel processor". Basicallly, that means it is not going to work properly in your current setup. Either try installing Linux and running Android Studio on that (which might come with its own issues), using a physical device for testing or use the slow ARM images.
You are using an AMD processor. SVM is AMD technology and VT-x is Intel technology. So you won't be able to get VT-x to run, but SVM might be possible.
As another poster had suggested, virtualization may have been disabled in the BIOS. There may be an option to enable virtualization. It does however seem to happen that virtualization is activated in the BIOS and Android-Studio does not recognize that. I have not figured out how to fix that either.
You could use the emulator with an ARM image, which will be very slow. Alternatively, you could use another emulator that is not integrated into Android-Studio.
is there a windows equivalent of the linux command "perf stat"? For example to see frontend stalls, cache misses and other performance counter data?
perf is Linux-only profiler capable to access hardware event counters (cache miss, cpu stalls, etc). This profiler supports many CPUs, but can't be used in MS Windows.
For Windows you may try profilers from your CPU vendor:
VTune from/for Intel ($$$)
CodeAnalyst/CodeXL from/for AMD (free)
Intel PCM from/for Intel (free) - https://software.intel.com/en-us/articles/intel-performance-counter-monitor (needs some compilation with DDK kit to get msr.dll driver and pcm.exe tool)
Visual Studio Profiler from Microsoft (part of Studio, some counters for several CPUs) - https://msdn.microsoft.com/en-us/library/bb385772.aspx "CPU Counters", "Portable Events", VSPerfCmd/VSPerfMon command line tool (it may be wrong with some events on recent CPUs)
Some people who find this question might be actually looking for xperf, or the new ETW stuff which is replacing it which could be downloaded here.
I wonder, are there any ways to generate with the gcc some native x86 code (which can be booted without any OS)?
Yes, the Linux kernel is compiled with GCC and runs in ring 0 on x86.
The question isn't well-formed. Certainly not all of the instructions needed to initialize a modern CPU from scratch can be emitted by gcc alone, you'll need to use some assembly for that. But that's sort of academic because modern CPUs don't actually document all this stuff and instead expect your hardware manufacturer to ship firmware to do it. After firmware initialization, a modern PC leaves you either in an old-style 16 bit 8086 environment ("legacy" BIOS) or a fairly clean 32 or 64 bit (depending on your specific hardware platform) environment called "EFI Boot Services".
Operations in EFI mode are all done using C function pointers, and you can indeed build for this environment using gcc. See the gummiboot boot loader for an excellent example of working with EFI.
Linux kernel 3.9 support ARM processor for KVM. (http://kernelnewbies.org/Linux_3.9)
There should be CPU H/W support for KVM such as Intel VT or AMD-V. So, my questions are:
What kind of ARM processors can be used for KVM?
What ARM technologies enables KVM on ARM?
Best Regards.
I found this information from Linux kernel commits (http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=749cf76c5a363e1383108a914ea09530bfa0bd43).
Only supported core is Cortex-A15 for now.
And, ARM Coretex A15 provides H/W Virtualization Extension and LPAE(Large Physical Address Extension). Please see this document for more information.
I collected some related information in my blog. It's written in Korean, but you can use Google translate.
Is there any way to programmatically disable Turbo Boost on a Core i7 mac running Mac OS X ? I need to be able to do this for benchmarking purposes during code optimisation etc. Failing that, any kind of utility which can disable/enable Turbo Boost, even if it requires a reboot, would be useful.
There is a related question (not Mac-specific) on SO: How to turn off Turbo Boost temporarily? but even for PCs it seems that there may be no way to do this programatically/on-the-fly ?
I wrote kernel extension that let's you disable TB, have fun:
https://github.com/nanoant/DisableTurboBoost.kext
If you want to disable TB on Linux here another recipe: http://luisjdominguezp.tumblr.com/post/19610447111/disabling-turbo-boost-in-linux
I've just coded an app that allows to load / unload the kernel extension mentioned before, helping to track the system behaviour displaying CPU Temp & current fan speed.
You can check it out here https://github.com/rugarciap/Turbo-Boost-Switcher
Here is an screenshot of how it looks like http://i.stack.imgur.com/tsKaG.png
You can't. Certain stuff needs to be configured from the BIOS, such as TurboBoost or Vt.
In particular, this is done with the IA32_FEATURE_CONTROL MSR. On a PC, at boot time the MSR is unlocked and the BIOS sets the correct bits to enable or disable features. Once configuration is complete, the BIOS locks the MSR for the changes to take effect and prevent future modification.
I don't know if it's possible to unlock the MSR again before the PC is brought into protected mode, and I don't know how this works on a MacBook where EFI is used instead of BIOS. You'll probably be able to pull it off with an EFI extension of sorts.
CPUID.com's Tmonitor utility can disable/enable Turbo Boost on-the-fly from within Windows, not at boot! There must be a way to do the same thing from within OSX.
Finally there seems to be a good solution for this problem which I have tested with Mac OS X Lion on a Core i7 MacBook Pro today and it appears to work well. Adam Strzelecki, a researcher in parallel computing at Jagiellonian University in Krakow, Poland has written DisableTurboBoost.kext - this is a small kext which can be loaded and unloaded at will (via the command line) to disable/enable TurbBoost.