Citra multi threading cpu

Citra uses only 1 CPU. I tried setting the affinity only 1 cpu it doesn’t change the performance. It only stays 45-50% on a 2ghz CPU.

Yes. You just stated a fact. What did you expect as response?

In case you are asking for multi-threading: Multi-threading is hard (read: kind of impossible) for most emulators. It might happen in the future, but it won’t simply double the performance like many people expect. It might also reduce compatibility even further.


If you want to run emulators, buy a CPU with the highest single-core performance available (unless the authors tell you to do otherwise). This means that often a high-end i3 or i5 can be more useful than an i7 for the same price in case of emulation.

  • We don’t care if you spend $350 on your new CPU: it can still be the wrong tool for the job.

One last thing. If a 2ghz frequency is not enough to run citra. example Pokémon sun/moon on atleast 40-50 fps, then why its only measure 45-60% of CPU load even in battle or not. if that frequency is not enough to get atleast 40-50 fps then it supposed to gets 80%+ CPU load. Or maybe its just a wrong reading. Well. Thanks anyway for a detailed explanation. Have a good day sir.

Because there can be other bottlenecks in the system.

Citra has to wait until the frame has finished rendering on the GPU so the CPU will be idle / can work on other processes. Ideally we’ll synchronize this better in the future (possibly using threading or other APIs) but this will always contribute.
In some extreme cases it could also be the CPU waiting for data from RAM (if your CPU has a small cache) or even for data from a harddisk or SSD.

Even if the usage was 100% it would not describe how well we utilize the CPU. We could simply be using slow operations when faster, more complicated operations could be used. Thereby we could probably easily target 100% CPU usage but emulation speed would not improve - in fact it would only increase power usage and slow other programs down.
It also shows that clockspeed is not a good measure for performance: it depends on what you do each clock and some CPUs are more capable than others.

Multithreading in citra is a long term goal. It’s hard to do due to concurrency and consistency. (In theory the Emulated GPU could run apart from the main core but it’ll be better to delegate more work to physical gpu in the host system instead)

Either way, it’s not a goal right now. The only long term goal is to run the emulated gpu asynchroniously just like a real 3ds does.

I believe we should move some stupid pre-processing steps like texture swizzling into compute shaders on the GPU but otherwise move more work onto empty CPU threads.

Computing trend today is clearly to have more cores. So in a couple of year we’ll probably have twice the amount of cores we have now - even if we ever multithread the CPU emulation we’d still have a ton of free cores.
Chances are more work will be shifted away from GPUs, back to CPU cores as we move to more heterogenous platforms = GPUs won’t have to increase much in performance and will probably also scale in amount of cores, not necessary in complexity.

Texture swizzling can be done pretty fast actualy without using compute shaders. Look at this code: https://gist.github.com/FernandoS27/7505745e3d1b4c0277dba72c38e1cd49 it performs incredible fast. At 1 byte morton, it can detile and deswizzle a 10241024 texture in about ~400 microseconds (tested on haswell i5 cpu with -O2 -msse3) and 1 4 bytes 10241024 in about 1.5 miliseconds. It’s not really the most beautiful code due to how it abuses pragmas but compared to what dolphin does to achieve high performance decoding: https://github.com/dolphin-emu/dolphin/blob/master/Source/Core/VideoCommon/TextureDecoder_x64.cpp you can make a good guess.