Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the speed improvement with Hyper Thread and Dual Core

Dear All,

With 'a few years old' 1.7GHz Intel CPU, Labview 7.1 and IMAQ 3.1.3 we got
a) 6ms on black and white pattern recognization
b) 60ms on color pattern recognization

We want to buy a new CPU to improve speed.

Should we buy HT or Dual core or just stay with the older version (non HT) P4?

Grateful if you may comment on the likely speed improvement with the latest Intel hyper thread and/or dual core CPUs?

Search the forum and some past postings indicated that  there  were some  compatability issues with HT and Dual Core. Wonder if they were largely or completely solved by now. That is, for our new CPU, should we buy HT / Dual Core or just the older P4?
 
0 Kudos
Message 1 of 9
(4,979 Views)
Hello,

It is generally safe to say that a Hyperthreading processor is going to be faster than non-Hyperthreading processors for applications that support Hyperthreading (such as LabVIEW).  And it is also generally safe to say that a Dual core processor is going to be faster than a Hyperthreading processor due to the fact that there are two entire and separate processors and not just copies of certain registers. As with most applications,the improvements that you will see will be entirely dependent on how your code is written.  A helpful document for determining if your code is optimized to take advantage of Hyperthreading (or dual cores) can be found at the link below.

LabVIEW and Hyperthreading


Also, most of the Hyperthreading processors and dual core processors have more L2 cache, and faster clock speeds so this will also improve performance.  I can say that due to this you will definitely see an improvement in performance with the HT processor and probably a slightly better improvement with a Dual Core processor.  Benchmarks for a specific application have to be done on a machine that is physically similar to the machine you will be deploying to, so I can't give hard numbers for improvements you will see by moving to either of these processors.  Benchmarks for specific processors can be found by doing a search on your favorite internet search engine for the processor you are interested in however.

Finally,  I am not aware of any current issues with Intel HT or Dual Core processors with Vision and LabVIEW.  The decision to purchase any of the processors you mentioned will ultimately boil down how much money you have and your determination on how well your application is optimized for hyperthreading.
S. Arves S.
National Instruments
Applications Engineer
0 Kudos
Message 2 of 9
(4,961 Views)
Hello S A S,

Our application is a simple step-by-step image recognition.

Step 1, grap an image
Step 2, recognition of image_0 in the image
Step 2,
recognition of image_1 in the image
Step 3, recognition of image_2 in the image
etc. etc.

Assume the image grap time is small in proportion and ignore the improvement due to larger cache, would it be safe to say, we may expect 3 to 4 times perfromance improvement by HT and dual-core respectively, by the following reasoning:

Clock 1.7GHz to 3.0GHz,  about 2 times improvement from clock rate
HT, about "one-and-a-half" improvement as only some hardware is duplicated
Dual Care, about two times improvement as the whole CPU is duplicated

Many thanks
0 Kudos
Message 3 of 9
(4,949 Views)
One thing to consider- what is the frame rate of the camera/framegrabber (if you are using one)? For example if it is 30 fps, that is one image every 33msec- much slower than the 6msec for your B/W pattern recognition. So the camera could end up being the slowest link in the chain, a faster PC won't improve this situation.
~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
0 Kudos
Message 4 of 9
(4,941 Views)
Yes, camera frame rate is understood and we have numerical data for them so we know how to calculate this aspect of the total timing and we can make shopping decision on this particular aspect. e.g. analogue camera is 25, 30, 50, 60 frame per second and IEEE1394 camera has quite wide variation depending on price and resolution, etc.

In our application, for one grapped video frame, there will be n recognition, so the recognition time is multipled by n times. And, we know how to calculate this aspect too.

The part that we do NOT know is for the shopping decision on CPU.

Given our test result on 1.7GHz CPU, we want to know, at least in ball park range, the speed if we choose HT or Dual Core CPU.

0 Kudos
Message 5 of 9
(4,928 Views)
Hello John,

From your description, your application is not very thread intensive.  Based on that assumption, you will not see large speed improvements in your application with either the HT processor, or the dual core processors.  Those two processors will be a little faster than a standard Pentium due partially to their handling of other threads running in the background (such as virus programs, chat interfaces, or other utilities), but you would not see anywhere near a 2X improvement in speed by going with either the HT or Dual Core.  However, if speed is an issue I would recommend purchasing the fastest processor you can afford.

We do not have any bench marks for performance of our algorithms on either the HT or Dual Core processors at this time, so I cannot give you a range for how these processors will perform.

Regards,
S. Arves S.
National Instruments
Applications Engineer
0 Kudos
Message 6 of 9
(4,916 Views)
Hi S. Arves S,


I have read the NI HT article that you advise on your first posting. In the article, although I did not go into the fine details and not sure if I understand it 100% correctly, there is an example showing 'certain method' to illustrate breaking up a task into parallel threads.


Would it be possible to reformat my application into something alone the line of, says, splitting it into two thread for Dual Core CPU and get something more close to 2X improvement?

Step 1, grap an image
Step 2a, as thread 0, recognition of image_0 in the image
Step 2b,
as thread 1, recognition of image_1 in the image
Step 3a,  etc. etc etc.


The article states that LabVIEW itself is 'multi-thread capable'.

Is the IMAQ (running under LabVIEW) also
'multi-thread capable'?

How about running IMAQ under LabWindows/CVI?

a) Is the LabVIEW 'overhead' significant? Presumably, the LabVIEW will utimately calls the IMAQ library after some LV overhead while CVI C prrogram will just simply call the IMAQ library directly.

b) On threading capability, will
LabWindows/CVI and LabView differ?

Many thanks
0 Kudos
Message 7 of 9
(4,910 Views)
John89,

I've done some rough tests using Vision for LabVIEW on multiprocessor and hyperthreaded machines. A dual processor machine speeds up processing by a factor of about 1.9 (contention for other shared resources besides the processor prevent the increase in processors from giving a corresponding linear increase in speed). Hyperthreading is much less beneficial, since pattern matching is computationally intensive but hyperthreaded CPUs have only one execution unit. A quick test showed a speedup of only about 10%, if even that.

Your application, as you describe it, seems like an excellent candidate for use on a multiprocessor machine. Writing code in LabVIEW will make multithreading a breeze. Just make sure that your separate calls to IMAQ Match Pattern 2 have no dependencies on each other, and that you change the properties of IMAQ Match Pattern 2 so that the VI is reentrant (otherwise LabVIEW will force parallel code to be executed sequentially).

In regard to your other questions, LabVIEW overhead is not much different than the CVI overhead. CVI and LabVIEW both support threading in Vision, however, in CVI it is the programmer's job to split the application into threads, whereas in LabVIEW it will automaticall split the code into threads wherever the dataflow of the program doesn't prevent it.

Also, don't discount the importance of a larger cache, especially in image processing. Modern processors are so fast that many applications are limited by memory bandwith rather than processing speed.

Hope this clears some things up,
Kevin C.
National Instruments
NI Vision
Message 8 of 9
(4,886 Views)
Hi Kevin,

Thanks for taking time to run a real test on the case.

How is the 1.9X determined? Did you use the SAME dual-core computer and may be, disabled one CPU in one of the test?

I never wrote parallel thread in LabVIEW. I only read the article link on the second posting of this dicussion thread. Can you post the test code so that I can follow the format in writing parallel two-thread code?  For dual-core CPU, should I use two threads or more than two threads?

How is CPU speed affect perfromance? Do modern Intel CPUs have very similar assembly instruction set and the speed is 'mostly' LINEAR with CPU speed? That is, my present 'a few years old' 1.7GHz Intel CPU, Labview 7.1 and IMAQ 3.1.3 with
a) 6ms on black and white pattern recognization
b) 60ms on color pattern recognization


will get about double speed on a 3.0 GHz CPU (3.0 vs. 1.7GHz)

I must say I am lost on the effect of cache size and FSB speed. Could you list examples as something like:

a) if money is really no problem, buy ???GHz, ??? FSB, ??? L2 cache

b) at about 2000USD (including 'full-options' for disk, monitor, etc., this price is like DELL Dimemsion 9150 with full options. The bare Dimension 9150 is 1000 USD), buy buy ???GHz, ??? FSB, ??? L2 cache

c) at about 1000USD,  buy buy ???GHz, ??? FSB, ??? L2 cache

Many thanks in advance.
0 Kudos
Message 9 of 9
(4,867 Views)