How GPUs work? When to use GPU over CPUs?

Aakashi JaiswalAakashi Jaiswal
4 min read

What are GPUs ?

GPUs are the graphical processing unit(GPU), it is an electronic circuit which ca easily perform calculations at a high speed.

Vertical or Horizontal GPU Mounting – What's the Difference? | AORUS

It is mainly used for the computing tasks like machine learning, graphics rendering and many more.

But the question is this kind of tasks can also be performed by CPUs, then what’s special in GPUs?

CPU vs GPU 2024 What's the Difference? - Lucky Falcon

A CPU, or central processing unit, is a hardware component that is the core computational unit in a server. It handles all types of computing tasks required for the operating system and applications to run.

CPUs are optimized for performing tasks like these:

-System management

-Multitasking across different applications

-Input and output operations

-Network functions

-Control of peripheral devices

-Memory and storage system multitasking

GPU is more specialized, it is also similar to hardware component but are more efficient and can handle complex operations runs in parallel than a general CPU. But sometimes we get to confuse on when to use GPU.

When to use GPUs over CPUs?

It is very important to have an idea about when to use CPU as well as GPU.

Every server or server instance in the cloud requires a CPU to run. However, some servers also include GPUs as additional coprocessors. Specific workloads are better suited to run on servers with GPUs that perform certain functions more efficiently.

For example, deep learning algorithms recognize complex patterns in pictures, text, sounds, and other data to produce accurate results and predictions. GPU-based servers provide high performance for machine learning, neural networks, and deep learning tasks.

Origin of the GPU

Before the GPU, we had dot matrix screens, which released in the 1940s and 1950s. Vector and raster displays released after, then later the first video game consoles and PCs released.

At the time, a non-programmable device called a graphics controller coordinated display to the screen. Graphics controllers traditionally relied on the CPU for processing, some included on-chip processors.

Around the same time, there was a 3D imaging project concerned with generating a single pixel on a screen with a single processor.

The goal was to produce an image that combines many pixels in a short amount of time. This project was the origin of the GPU as we know it.

It wasn’t until the late 1990s that the first GPUs came out. These were aimed at the gaming and computer-aided design (CAD) markets.

Evolution of GPU technology

Nvidia was the first to market the single-chip GeForce 256 GPUs in 1999. The 2000s and 2010s marked a growth era where GPUs gained functions like ray tracing, mesh shading, and hardware tessellation. These led to increasingly advanced image generation and graphics performance.

It wasn’t until 2007 that Nvidia released CUDA, a software layer making parallel processing available on the GPU. Around this time, it became clear that GPUs were very effective at performing highly specific tasks. Specifically, they excelled at tasks that require a large amount of processing power to achieve a particular outcome.

When Nvidia released CUDA, it opened up GPU programming to a wider audience. Developers could then program GPU technology for all sorts of different compute-intensive practical applications. GPU computing started to become far more mainstream.

GPUs are an in-demand chip for blockchain and other emerging applications. They being highly used in artificial intelligence and machine learning (AI/ML).

How does a GPU work?

Modern GPUs typically contain a number of multiprocessors. Each has a shared memory block, plus a number of processors and corresponding registers. The GPU itself has constant memory, plus device memory on the board it is housed on.

Each GPU works slightly differently depending on its purpose, the manufacturer, the specifics of the chip, and the software used for coordinating the GPU. For instance, Nvidia’s CUDA parallel processing software allows developers to specifically program the GPU with almost any general-purpose parallel processing application in mind.

GPUs can be standalone chips, known as discrete GPUs, or integrated with other computing hardware, known as integrated GPUs.

-Discrete GPUs

Discrete GPUs exist as a chip that is fully dedicated to the task at hand. While that task has traditionally been graphics, now discrete GPUs can be used as dedicated processing for tasks like ML or complex simulation.

When used in graphics, the GPU typically resides on a graphics card that slots into a motherboard. In other tasks, the GPU may reside on a different card or slot directly onto the motherboard itself.

-Integrated GPUs

In the early 2010s, we started to see a move away from discrete GPUs. Manufacturers embraced the introduction of the combined CPU and GPU on a chip, known as the iGPU. The first of these iGPUs for PC were Intel’s Celeron, Pentium, and Core lines. These remain popular across laptops and PCs.

Another type of iGPU is the system on a chip (SoC) that contains components like a CPU, GPU, memory, and networking. These are the types of chips typically found in smartphones.

-Virtual

Like other types of computing hardware infrastructure, GPUs can also be virtualized. Virtualized GPUs are a software-based representation of a GPU that shares space alongside other virtual GPUs on cloud server instances. You can use them to run your workloads without having to worry about underlying hardware maintenance.

10
Subscribe to my newsletter

Read articles from Aakashi Jaiswal directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Aakashi Jaiswal
Aakashi Jaiswal

Coder | Winter of Blockchain 2024❄️ | Web-Developer | App-Developer | UI/UX | DSA | GSSoc 2024| Freelancer | Building a Startup | Helping People learn Technology | Dancer | MERN stack developer