Why are games single-core bound on CPUs and not multithreaded? I understand why the rendering is offloaded to GPUs but what about other tasks?

267 views

Why are games single-core bound on CPUs and not multithreaded? I understand why the rendering is offloaded to GPUs but what about other tasks?

In: 5

10 Answers

Anonymous 0 Comments

Multithreading adds a lot of complexity to code. This adds bugs & development cost. Some games also don’t need multithreading because they achieve good performance on a single thread.

Most of the work required to run a video game is drawing frames, which is done on the GPU. The CPU is doing some things but its main job while running a game is just taking data & sending it to the GPU, with little or no processing in between.

Anonymous 0 Comments

Traditional graphics libraries such as OpenGL are single threaded meaning only one thread can talk to the GPU at one time. This has changed with Vulcan which has multithreading built in.

If most of your code is about rendering, introducing multiple threads into the mix would only add complexity, and that is something you want to avoid at all cost in software projects.

It is common to offload other non-graphical tasks to other threads, and modern game engines have more modern paralell architectures that will better take advantage of multithreaded hardware.

Anonymous 0 Comments

GPUs are best for handling lots of independent calculations, where you don’t need the results of one to calculate the next. However game calculations don’t often fit this, as physics and game state calculations often are dependent on each other and so you can’t start computing a later part until the previous calculations are complete. This makes the CPU better suited for this as while it’s not good at calculating many things at once, it can do individual calculations much faster.

A good program is optimized to send different calculations to different processors depending on the nature of those calculations. If it’s lots of independent calculations, let the GPU do it. If it’s a series of somewhat interdependent calculations, split it between a number of CPU cores. If it’s a series of calculations that all depend on the previous result, then let the fastest core do it all.

You can’t always speed up a program by adding more processors just like you can’t make a baby faster by adding more women.

Anonymous 0 Comments

Games, almost all, are written, and developed, to run on the LCD (lowest common demoninator) of hardware, to sell to the widest audience possible.

Why spend money developing for multi-processor/multi-core/multi-thread machines?

And what ‘Other Tasks’? For a single player game, the tasks are probably 95% rendering, 5% actual logic. For MMORPG’s, 85% rendoring, 10% dealing with comms, and 5% actual logic.

Anonymous 0 Comments

Quite simply, games require many things to be done *in order*. And getting an ordered output from a multi-threaded process is not always easy (could literally be impossible) and can actually end up being slower than a single-threaded strategy. Not everything can be parallelized.

And games will almost always have a singular “loop” running on one thread/core. This loop synchronizes everything, signals other threads, and likely does quite a bit of other miscellaneous work.

There’s always going to be serial work that needs done, no matter how parallel your software is.

Anonymous 0 Comments

Games are commonly multithreaded.

Pretty much all demanding games over the last decade have been multithreaded. Consoles for quite a while now have had pretty low powered CPU’s with multiple cores, so developers have been forced to make multithreaded games since that’s the only way the game can he made to run adequately. However they often are only able to effectively make use of 2-4 cores. Some games do spread over many cores well, however its often programmatically difficult for developers to arbitrarily split up the work over an arbitrary number of cores. The game may, for example, use one core for rendering based tasks, one for AI and one for physics. These are discrete packages of work that can be nicely partitioned across a core each. Inevitably one of these tasks uses more CPU power than the others, so performance is limited by whatever that core needs to do. This means “single core performance” is often the most important factor in a gaming CPU, but that’s only because nowadays basically every CPU on the market has at least 4 cores, and if we’re comparing a CPU with 4 strong vs 8 weaker cores, the 4 core one would frequently be better even though on paper the 8 core cpu had more number crunching ability. There are crazy processors that are consumer accessible nowadays with 32 or even 64 cores, but they might not give much benefit in games since to cram this many CPUs on a single die you have to lower the power of each one.

Anonymous 0 Comments

Multithreading doesn’t always provide a benefit. Take the following TODO list:

1. Buy Groceries
2. Pick up child from school
3. Drop off child at soccer practice

If you had a friend to help you out with this list, #1 and #2 can be done at the same time, but #2 and #3 need to be done sequentially by the same person, so any more than 2 people working on this TODO list would be useless.

It’s the same with code. Some algorithms are easy to split into multiple “threads,” that can run at the same time, while some parts of the code either need to be run sequentially, or the small benefit of splitting it up isn’t worth the effort and added complexity.

Anonymous 0 Comments

Indie game dev here. Even our mobile game is multi threaded. So I’m not sure your question is even valid. I would say every game uses multithreading.

Anonymous 0 Comments

It all depends on the game. One game I worked on was cross PC and Xbox. We needed the game to look and play well to what people with PCs would expect and keep the Xbox on par with the PC. That meant a lot of multi-threading on the Xbox. AI, Physics, Audio and more got their own slice of a CPU and the game was sequenced in stages – Pre-physics, physics resolution, game state update. Threads that needed syncing up could wait for the stage event then start processing.

The game I’m working on now is server – mobile. Server has plenty of processing power and the mobile does the rendering. Not a multi-thread in sight.

Anonymous 0 Comments

You: *Hey CPU-1, I need you calculate how high and far the character jumps in the current gravity.*

CPU-1: *Ok*

You: *Hey CPU-2, while CPU-1 works on that I need you to calculate the new position of the character after jumping*

CPU-2: *ok… Hey wait, how high and far did the character jump?*

You: *I don’t know ask CPU-1…And have you seen CPU-3? I need to know if the character touched lava after jumping…*

CPU-3: *bitch I can’t do math on shit that ain’t happened yet wtf you want me to do?*

Hopefully, this demonstrated why it doesn’t really help to add more CPU’s to the equation.