Items with no label
3335 Discussions

How to reduce the CPU utilization of Realsense D415 in Unity project?

ZQiu1
Beginner
2,341 Views

HI,

My project is in Unity. Whether it is 1280*720 resolution or 640*480, when I use D415 to get Color Image, the CPU utilization rate will go up to 100%. I tried too many computers, but the situation did not improve.

I have seen the script provided by the official, but there is not a lot of optimized places. Maybe I am not high enough. Is there any optimization plan? My project needs 1280*720 resolution.

Thank you very much!

0 Kudos
9 Replies
MartyG
Honored Contributor III
1,001 Views

Are you using the latest version of the RealSense SDK 2.0 and an up to date camera firmware driver please? Older versions had problems with CPU load, but changes were made to fix it.

0 Kudos
ZQiu1
Beginner
1,001 Views

I have using the latest version of the RealSense SDK 2.0.

May i ask what do you mean by the camera firmware driver? Is it the camera firmware driver of Windows?

0 Kudos
MartyG
Honored Contributor III
1,001 Views

The firmware is a driver that tells the camera how to function. It is stored inside the camera instead of on the PC. You can download the firmware from here, and also download a firmware updater tool from that page to install the firmware file:

https://downloadcenter.intel.com/download/27792/Latest-Firmware-for-Intel-RealSense-D400-Product-Family?v=t Download Latest Firmware for Intel® RealSense™ D400 Product Family

0 Kudos
ZQiu1
Beginner
1,001 Views

I have updated the latest camera firmware driver。

As the chart, when I opened 11, Cpu occupancy rate below 20%.

But when I open your company provide the case in Unity, Cpu usage to 100%.

I feel that this update doesn't work in Unity. Am I wrong?

My Cpu is E5-1620 v4, and i download the RealSense SDK 2.0 from here:

https://github.com/IntelRealSense/librealsense/releases/tag/v2.11.0 Release Intel® RealSense™ SDK 2.0 (Build 2.11.0) · IntelRealSense/librealsense · GitHub

0 Kudos
ZQiu1
Beginner
1,001 Views

Sorry.

I wrote a wrong word, figure 1 is when I open the Intel.RealSense.Viewer.exe

0 Kudos
MartyG
Honored Contributor III
1,001 Views

Thank you, your images were very helpful.

I ran some tests with my own Unity project and found that when the project is not running, the load in the Task Manager for the Unity Editor was around 0.1 to 0.3 percent. When the project is run in the Editor, the load jumps to about 45 to 47 percent in the Task Manager. I am not using RealSense in my project. So the problem is likely related to the Unity editor rather than the RealSense sample.

Unity 5 and Unity 2017 had an issue where the Profiler performance tool was reporting similarly high loads for the 'Editor Overhead' part of the project when running in the editor. This is because when the project is running in Editor mode, it is still checking parts of the editor interface. It has been said that this load does not occur in full Build and Run mode because the editor isn't being used during that run mode.

I am using Unity 2018.1 myself, and the Editor Overhead load in the Profiler is significantly less, around 3%. This is because Unity did large improvements in their rendering system in the 2018 version. Though the Task Manager outside of Unity still reports a 45% editor load.

0 Kudos
ZQiu1
Beginner
1,001 Views

Thanks for your compliment.

I've tried to build and run a project. As shown, the situation has not improved.

I find that the point is not in the Unity Editor, but in Color acquisition of D415.

As shown in the figure, when I only open the depth and infrared acquisition, close the color acquisition of D415, the Cpu utilization rate is only about 10 percent.

And when I open the color of D415, you already know.

0 Kudos
MartyG
Honored Contributor III
1,001 Views

Thank you. Using the information you supplied, I located another case where your problem was occurring and 100% CPU load was being generated. So I apologize.

https://github.com/IntelRealSense/librealsense/issues/1173 Issues running Unity wrapper (High CPU usage/No texture write) · Issue # 1173 · IntelRealSense/librealsense · GitHub

0 Kudos
ZQiu1
Beginner
1,001 Views

I have read the issue you provided, it seems that the problem has not been solved.

I don't have much time to spend on this issue, but I will pay attention to it and see if anyone will give an answer,

Or if you solve the problem, please let me know in time.

Thinks.

0 Kudos
Reply