# CPU or GPU for Cesium?

**URL:** <https://community.cesium.com/t/cpu-or-gpu-for-cesium/19885>\
**Category:** CesiumJS\
**Created:** [August 8, 2022, 2:06pm UTC](https://community.cesium.com/t/cpu-or-gpu-for-cesium/19885 "2022-08-08T14:06:30Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![rpereira1](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/rpereira1/32/10316_2.png) [@rpereira1](https://community.cesium.com/u/rpereira1)\
**Post date:** [August 8, 2022, 2:06pm UTC](https://community.cesium.com/t/cpu-or-gpu-for-cesium/19885/1 "2022-08-08T14:06:30Z")

</div>

I am noticing slow responses from a cesium application and want to know what we can do to improve it.

I am using vm with an intel xeon 4 core CPU and 16 GB ram. Do I need to add more cores or maybe a GPU? In what scenarios, should a GPU be used for cesium?

---

<div class="post-metadata">

**Author:** ![sanjeetsuhag](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/sanjeetsuhag/32/1992_2.png) [@sanjeetsuhag](https://community.cesium.com/u/sanjeetsuhag)\
**Post date:** [August 8, 2022, 2:16pm UTC](https://community.cesium.com/t/cpu-or-gpu-for-cesium/19885/2 "2022-08-08T14:16:36Z")

</div>

Hi @rpereira1

CesiumJS relies on WebGL, which is hardware accelerated using the GPU. You should have no issues running CesiumJS on an integrated, discrete or mobile GPU. Could you share a [Sandcastle](https://sandcastle.cesium.com/) demonstrating a sample scene where you are seeing performance issues? Additionally, it would be helpful if you could share the output from [WebGL Report](https://webglreport.com/).

Thanks,  
Sam.

---

<div class="post-metadata">

**Author:** ![rpereira1](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/rpereira1/32/10316_2.png) [@rpereira1](https://community.cesium.com/u/rpereira1)\
**Post date:** [August 8, 2022, 3:17pm UTC](https://community.cesium.com/t/cpu-or-gpu-for-cesium/19885/3 "2022-08-08T15:17:28Z")

</div>

I cannot share a sandcastle because the data is proprietary.

Here is the WebGL report:

 ![image.png](https://global.discourse-cdn.com/cesium/original/2X/2/218ca20632c9c7d86623cc1e580b6635a7c2d838.png)

Thanks,  
Rydel

---

<div class="post-metadata">

**Author:** ![sanjeetsuhag](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/sanjeetsuhag/32/1992_2.png) [@sanjeetsuhag](https://community.cesium.com/u/sanjeetsuhag)\
**Post date:** [August 8, 2022, 4:01pm UTC](https://community.cesium.com/t/cpu-or-gpu-for-cesium/19885/4 "2022-08-08T16:01:00Z")

</div>

That’s ok @rpereira1.

From the WebGL report, it seems like [SwiftShader](https://github.com/google/swiftshader), a CPU-based implementation of Vulkan is being used. I think adding a GPU would help performance quite a lot.

---

<div class="post-metadata">

**Author:** ![James\_B](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/james_b/32/2424_2.png) [@James\_B](https://community.cesium.com/u/James_B)\
**Post date:** [August 9, 2022, 11:46am UTC](https://community.cesium.com/t/cpu-or-gpu-for-cesium/19885/5 "2022-08-09T11:46:52Z")

</div>

What kind of VM is this? Some environments support either pass-through or (better) emulated integrated GPUs. Falling all the way back to SwiftShader means that the browser couldn’t use any kind of accelerated video driver, and it’s a big red flag.

I’m running into this with users who are in [a secure VM environment](https://github.com/QubesOS/qubes-issues/issues/4234), where it’s a known issue. They suggested I file a bug with Google – feel free to [follow along there](https://bugs.chromium.org/p/chromium/issues/detail?id=1348913).

Of course, if Cesium can do anything to optimize its performance under SwiftShader, that would be great too. But for @rpereira1 , if you can possibly get off of SwiftShader, you really should.

---

<div class="post-metadata">

**Author:** ![rpereira1](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/rpereira1/32/10316_2.png) [@rpereira1](https://community.cesium.com/u/rpereira1)\
**Post date:** [August 9, 2022, 6:08pm UTC](https://community.cesium.com/t/cpu-or-gpu-for-cesium/19885/6 "2022-08-09T18:08:12Z")

</div>

Thanks for the response! I will check the type of VM and see if we can get a GPU.

Thanks!

---

<div class="post-metadata">

**Author:** ![rpereira1](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/rpereira1/32/10316_2.png) [@rpereira1](https://community.cesium.com/u/rpereira1)\
**Post date:** [August 15, 2022, 6:44pm UTC](https://community.cesium.com/t/cpu-or-gpu-for-cesium/19885/7 "2022-08-15T18:44:41Z")

</div>

Adding an integrated GPU might take awhile. Are there any other options we can use to make the vm more performant? It currently has 16GB of RAM and 4 cores. I can see the 4 cores are at 100% usage so would adding more cores help? Any other options?

---

<div class="post-metadata">

**Author:** ![sanjeetsuhag](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/sanjeetsuhag/32/1992_2.png) [@sanjeetsuhag](https://community.cesium.com/u/sanjeetsuhag)\
**Post date:** [August 16, 2022, 1:38pm UTC](https://community.cesium.com/t/cpu-or-gpu-for-cesium/19885/8 "2022-08-16T13:38:03Z")

</div>

> I can see the 4 cores are at 100% usage so would adding more cores help? Any other options?

I can only guess that since you’re using SwiftShader, which is using the CPU to essentially emulate a GPU, perhaps adding more cores could improve performance - but that’s a SwiftShader concern not a CesiumJS one. Typically, a single instance of CesiumJS running on a system would not demand a CPU usage that high (unless there is lots of custom geometry etc. being updated regularly).

---

<div class="post-metadata">

**Author:** ![James\_B](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/james_b/32/2424_2.png) [@James\_B](https://community.cesium.com/u/James_B)\
**Post date:** [August 17, 2022, 7:14am UTC](https://community.cesium.com/t/cpu-or-gpu-for-cesium/19885/9 "2022-08-17T07:14:29Z")

</div>

> [@rpereira1](#):
>
> Adding an integrated GPU might take awhile

Just to make sure this is clear, “integrated” GPU means one built into a hardware CPU. A standalone video card is a “dedicated” GPU. The idea of “adding” an integrated GPU to a VM really means passing through hardware-accelerated video rendering instructions to the (real) GPU portion of your host CPU. Typically, this is either a pretty simple configuration option in your VM environment, or it’s totally impossible. In the case I linked above, it is totally impossible to use hardware acceleration via integrated (on-CPU) video drivers, for security reasons.

So, maybe you could provide a bit more detail? It could be possible, or impossible, but I can’t think how it “might take a while”.

---

<div class="post-metadata">

**Author:** ![rpereira1](https://sea2.discourse-cdn.com/cesium/user_avatar/community.cesium.com/rpereira1/32/10316_2.png) [@rpereira1](https://community.cesium.com/u/rpereira1)\
**Post date:** [August 19, 2022, 4:13pm UTC](https://community.cesium.com/t/cpu-or-gpu-for-cesium/19885/10 "2022-08-19T16:13:23Z")

</div>

It is a process for the customer to add GPU’s. They are planning to loan me another vm with a dedicated GPU
