Intel Hyper-Threading
Intel introduced their Hyper-Threading Technology a few years ago and it has struggled ever since to reach general acceptance. While all their recent processors have had this technology in-built confusion still seems to exist around it's usage and benefits. As Blender (3D modeling/ rendering/ animation/ Game Engine) now supports (as of version 2.37a) multi-threaded processing I thought I'd demonstrate the usage and benefits of a Hyper-Threading enabled processor.
Read more...
The specification of the workstation used for this test can be seen here and the latest official release of Blender 2.37a can be downloaded from here.
For this test I created a simple Blender scene with 1 sun lamp, 16 Sample Ambient Occlusion, Raytraced with a slight Ray Mirror applied to the floor and OSA setting of 16 samples. Rendered at 320x240 a larger version can be seen by clicking on the image. The .blend file as used in this test can be downloaded from the link at the bottom of this post.
Hyper-Threading can only be enabled/disabled through the BIOS settings of your Motherboard. So after going into the BIOS settings, disabling Hyper-Threading and booting to Windows I had a workstation with a single 3Ghz Pentium IV processor. To check that Hyper-Threading is disabled go to the Task Manager (CTRL-ALT-DEL) and click on the "Performance" Tab. You should see only one "CPU Usage History" graph (click on image to enlarge). This confirms that we have 1 physical processor capable of 1 logical process.
Rendering the image at the default settings contained in the .blend file produced the image in 99 seconds. No other applications were running at the time apart from the Windows processes required by the Operating System. To help iron out any anomalies I repeated the test 3 times and took the average of the results. The results were all within 1 second of each other so confidence is high. As this is a single processor workstation enabling/disabling "Threads" within Blender made no difference whatsoever (as expected). To activate "Threads" press "F10" for "Render Settings" and in the "Output" panel you will see the "Threads" option. Click on (image to enlarge). If you have "Task Manager" open during rendering you will see the CPU Usage hit 100% during the duration of the render.
All well and good, we now have a benchmark of 99 seconds for a single processor with no Hyper-Threading, how much faster can we get this to render? Read on...
Now we'll switch on Hyper-Threading. Re-boot the workstation and go into BIOS set-up and activate Hyper-Threading. Save the changes and continue booting to Windows. To check that Hyper-Threading has been enabled go into Task Manager again but this time you should see two "CPU Usage History" graphs. Nice eh? This means we have 1 physical processor but it is capable of 2 logical processes, Woof!
Rendering the scene again, with "Threads" enabled in "Render Settings" and wooooah, it's quicker, 71 seconds a saving of 28 seconds from a non Hyper-Threading processor. As before the test was averaged out over 3 separate runs. If you have Task Manager running you'll see the "CPU Usage" and "CPU Usage History" graphs hit 100% on both graphs.
OK, but does Hyper-Threading have a negative impact running on 1 thread within Blender? Turn off the "Threads" option in Blender and render the scene again. In theory this should give us the same result as when we had Hyper-Threading disabled (99 seconds). Again, averaging the results out over 3 runs and the figure was actually slightly quicker at 97 seconds. How can this be? Well, even though we had disabled "Threads" within Blender the Hyper-Threading was still enabled within the processor allowing Windows to run it's internal processes without impacting the rendering process resulting in shaving a couple of seconds off the total time. Nice, even if you don't have multi-threaded applications you can get a small boost by enabling Hyper-Threading (albeit very small).
If you had Task Manager running for this test you will have noticed that the CPU usage only reached 50%. This is because Windows is calculating it as 1 process running at 100% and 1 process running at 0% giving an average across both processes of 50%. It's this fact that seems to confuse people resulting them in declaring that activating Hyper-Threading in effect halves your speed when running a non threaded application. This, as you've seen, is not the case. Simple conclusion is, if you've got a Hyper-Threading capable processor then activate it. There is no downside and a big upside to doing so.
Can we make it even quicker? Yes we can. For many Blender releases now An][ares has been producing an unofficial build which optimises the code for higher-end Pentium and AMD chips. In theory this should give another speed boost to reduce render times. You can read all about the optimised build and download it from this thread on Elysiun.
After installing the optimised build I ran the same tests as detailed above to gauge the further boost that can be expected from the new code and Hyper-Threading. With Hyper-Threading disabled in BIOS the scene rendered in 70 seconds (the fastest yet). Again, the results were averaged over 3 renders. An amazing achievement for the optimised build. But what would happen when Hyper-Threading was activated? After enabling in BIOS and re-booting the test scene was run again with "Threads" enabled within Blender, the result.... wait for it.... 53 seconds. Holy cow! By ditching the official build for an optimised version and switching on Hyper-Threading we've taken the render time from 99 seconds down to 53 seconds and all for free.
To summarise the results;
Official Blender 2.37a
No Hyper-Threading, no "Threads".......99 seconds
No Hyper-Threading, with "Threads".....99 seconds
With Hyper-Threading, no "Threads".....97 seconds
With Hyper-Threading, with "Threads"...71 seconds
Optimised Blender 2.37a
No Hyper-Threading, no "Threads".......70 seconds
No Hyper-Threading, with "Threads".....70 seconds
With Hyper-Threading, no "Threads".....69 seconds
With Hyper-Threading, with "Threads"...53 seconds
Another big advantage of enabling Hyper-Threading is that it allows your computer to multi-task much more effectively. If you're running an application that is eating up 100% of your CPU time then you'll know how difficult it is to use your computer for anything else. With Hyper-Threading you would be able to have your computer rendering a scene while working on another application, checking e-mail, browsing the web etc without noticeably impacting the render time.
Unfortunately Blender only supports a maximum of 2 threads. On my Dual Xeon workstation with Hyper-Threading enabled I have 2 physical processors capable of 4 logical processes. Blender can't make use of all of them but Yafray can :-) When I get the time I'll run a few trials with Yafray rendering across 4 threads.
Blend file used in this test: abstract.blend


6 Comments:
Great little article. Whould have replied on the other fourms but elYsium seems to be down.
I tried the file on a AMD64 3000+ with 1gig ram. Under linux of course ;).
The 32bit version of blender gave me 93 secs +-1 sec.
The 64bit version (GCC 4.0.0) gave me 58 secs +-0.5 sec.
Pretty good eh? Not to mention that i have all sorts of things running at the same time.. Azureus(bitTorrent) Webbrowsers currently downloading things and Xemacs.
Uptime 45 days and counting...
Linux rocks.. AMD64 are fast.
delt0r
By
Anonymous, at 18 July 2005 23:26
I didn't even know there was a 64bit Linux build. So by rights the next generation of processors should be 64 bit dual core beasts that will need nailed to the desk to stop them from taking off. Can't wait.
By extrapolation a 64 bit dual core with HT and an optimisied Blender build capable of true multi-threading would knock that scene out in less than 14 seconds.
I know from the dev logs that Ton has already highlighted the need to move Blender to 64bit to take account of the coming generation of processors :-)
By
Ricky Dee, at 19 July 2005 07:12
i've mailed to Ton, blender project leader, and this is what he answered:
>does blender works on ly with one processor (two logic processors)?
No, it works with 2 processors fine too. Blender just only uses 2 threads for now. Whether it's one processor with dual core, or two processors, or hyperthreaded... that's what Blender doesn't care for.
> what about your plan and the possibility to extend to a dual core
(so that blender can use two processors with HT (4 logical processors))?
Moving up to to support 4 (or more) threads is not scheduled yet. Threaded rendering is still new in Blender, and will require a lot of testing still (as will go on in Studio Orange as well). :)
I rather spend time now on getting the 64 bits version of Blender stable.
-Ton-
By
bullx, at 17 September 2005 11:46
great article!
i'm wondering why you have 100% cpu usage on your HT-enabled machine (screenshot)?
when i use my dual xeon HT, there´s alot activity on all logical cpu´s (threads enabled),
but as you said, it doesn´t reach over 50% of the cpu usage...
any hint to get the 100% cpu usage?
bleen
By
Anonymous, at 3 November 2005 16:45
Bleen,
I explained in the article that Blender (at the moment) can only manage a maximum of two threads. Your Dual Xeons with HT will be capable of 4 threads... you wont be able to get 100% CPU usage with Blender as it is. Yafray, however, can render multiple threads by setting the number of processors, in your case to 4, in the "Yafray" tab.
HTH
NB: Yafray has a bug where you must set the number of processors before rendering in any one session. If you render with 1 processor and then in the same session set it to 2 or more it will still only launch 1 thread (look in the console output to see how many threads it launches).
On my Dual Xeons with HT at work I can hit 100% CPU usage with Yafray but only on really intensive scenes.
By
Ricky Dee, at 13 November 2005 19:12
Nice article,
Someone mentioned above that they were wondering what it would be like with 64bit dual core, well, I have one. it's a 2.0 ghz, athalon X2 dual core 64 bit processor, with 512M ram(not much I know) and it renders like a dream. You're little test file renders in 30 secs with threads turned on, and optomized blender.
By
Anonymous, at 13 December 2005 16:43
Post a Comment
<< Home