78

How are GPUs more faster then CPUs? I've read articles that talk about how GPU's are much faster in breaking passwords than CPUs. If thats the case then why can't CPUs be designed in the same way as GPUs to be even in speed?

Faisal Abid
  • 8,900
  • 14
  • 59
  • 91
  • 7
    GPU: limited instruction sets to perform specialised operations; specialised hardware to perform limited operations very quickly and in parallel. – Mitch Wheat Jun 22 '11 at 05:45
  • 3
    It's not that they are faster all-around, just faster at certain types of calculations. – Asaph Jun 22 '11 at 05:45
  • 2
    GPUs have high throughput, CPUs have high speed (generally speaking). There's a difference between speed and throughput. – user Jun 25 '13 at 15:40

2 Answers2

79

GPU get their speed for a cost. A single GPU core actually works much slower than a single CPU core. For example, Fermi GTX 580 has a core clock of 772MHz. You wouldn't want your CPU with such a low core clock nowadays... The GPU however has several cores (up to 16) each operating in a 32-wide SIMD mode. That brings 500 operations done in parallel. Common CPUs however have up to 4 or 8 cores and can operate in 4-wide SIMD which gives much lower parallelism.

Certain types of algorithms (graphics processing, linear algebra, video encoding, etc...) can be easily parallelized on such a huge number of cores. Breaking passwords falls into that category. Other algorithms however are really hard to parallelize. There is ongoing research in this area... Those algorithms would perform really badly if they were run on the GPU.

The CPU companies are now trying to approach the GPU parallelism without sacrificing the capability of running single-threaded programs. But the task is not an easy one. The Larabee project (currently abandoned) is a good example of the problems. Intel has been working on it for years but it is still not available on the market.

KetZoomer
  • 2,701
  • 3
  • 15
  • 43
CygnusX1
  • 20,968
  • 5
  • 65
  • 109
  • 1
    can you give examples of algorithms that are hard to parallelise ? – ihebiheb Sep 30 '17 at 21:20
  • 5
    For example, algorithms that have deep recursion. For example, sequential graph algorithms that use BFS/DFS as part of it. If you cannot take BFS/DFS out of it, you will have hard time parallelizing it, because someone can always put a single path as a graph, forcing you to perform O(n) steps regardless of your processor count. – CygnusX1 Oct 01 '17 at 16:09
68

GPUs are designed with one goal in mind: process graphics really fast. Since this is the only concern they have, there have been some specialized optimizations in place that allow for certain calculations to go a LOT faster than they would in a traditional processor.

In the case of password cracking (or the molecular dynamic "folding at home" project) what has happened is that programmers have found ways of leveraging these optimized processes to do things like crunch passwords at a faster rate.

Your standard CPU has to do a lot more different calculation and processing types that what graphics processors do, so they can't be optimized in a similar manner.

Dillie-O
  • 29,277
  • 14
  • 101
  • 140
  • 2
    Ah okay that makes a lot of sense. Thanks perfect explanation. – Faisal Abid Jun 22 '11 at 06:05
  • 2
    That is just not true. GPUs have full blown ISAs these days, with FMA instructions, and SIMD galore. feel free to read up this 4 year old instruction set 400 page manual for the GCN 3rd gen architecture. http://developer.amd.com/wordpress/media/2013/12/AMD_GCN3_Instruction_Set_Architecture_rev1.1.pdf – MarcusJ Dec 09 '17 at 09:55