Jump to content

Bugged Linux CPU usage


Recommended Posts

Hello all!

I'm running a clean install of KSP 1.1.3 on Ubuntu 16.04, kernel version 4.4.0. I've got dual Xeon E5-2670s, a GTX 1060 6gb and 64gb of ram, so I don't think my problem is a hardware limitation. Any scene with any 3D rendering, regardless of graphics settings, (including the kerbals floating in space on the main menu) uses 100% CPU (100% of all 32 cores!) and I'm getting terrible frame rates. I'm getting 10-40fps on different scenes, with terrible stuttering.

Is there a fix for this unreasonable cpu usage?

Link to comment
Share on other sites

Hi @Tim_p, to offer any sort of fix we'd have to first know what is going wrong here, it's certainly not normal, I also use Linux and KSP doesn't use 100% cpu even on my really old PC.

Please upload your KSP.log, Player.log and hardinfo report to a site like dropbox.com and I'll take a look.

Link to comment
Share on other sites

Can you try KSP without -force-glcore please, it should not be required with Nvidia and the proprietary drivers.

It might be why KSP is having trouble setting the resolution as can be seen in the player.log

Spoiler

Changing real window size to 1920 x 1080
Ignoring window size change to 1920x1080 : waiting for fullscreen at 1920x1080
Changing real window size to 1920 x 1080
Changing real window size to 1920 x 1080
Changing real window size to 1855 x 1056
Ignoring window size change to 1855x1056 : waiting for fullscreen at 1920x1080
Changing real window size to 1855 x 1056
Changing real window size to 1855 x 1056
Changing real window size to 1920 x 1080
Ignoring window size change to 1920x1080 : waiting for fullscreen at 1920x1080
Changing real window size to 1920 x 1080
Changing real window size to 1920 x 1080
Changing real window size to 1920 x 1080
Changing real window size to 1920 x 1080
Changing real window size to 1920 x 1080
MainCanvas MASK: 3458764513820540928

And 8 threads for Enlighten.

Spoiler

Setting up 8 worker threads for Enlighten.
  Thread -> id: 7f6d43fff700 -> priority: 1
  Thread -> id: 7f6d437fe700 -> priority: 1
  Thread -> id: 7f6d3affd700 -> priority: 1
  Thread -> id: 7f6d42ffd700 -> priority: 1
  Thread -> id: 7f6d427fc700 -> priority: 1
  Thread -> id: 7f6d40ff9700 -> priority: 1
  Thread -> id: 7f6d417fa700 -> priority: 1
  Thread -> id: 7f6d41ffb700 -> priority: 1
requesting resize 1920 x 1080
requesting fullscreen 1920 x 1080 at 60 Hz
Desktop is 1920 x 1080 @ 60 Hz

 

Link to comment
Share on other sites

No luck with that option either. I even tried a fresh install of ubuntu with the graphics card manufacturer's supported driver (v367.35)--rather than nvidia's newest driver--with the same results, including the eight threads for Enlighten.

Link to comment
Share on other sites

I tested KSP 1.0.5 on the same fresh ubuntu install. 1.0.5 works well without any cpu usage issues (though it does seem to have some minor v-sync related quirks). Is 1.0.5 older than the inclusion of Enlighten?

Link to comment
Share on other sites

Yes, 1.0.5 is made in Unity3D version 4, while 1.1 and newer use Unity3D version 5, Enlighten was added to the Unity3D engine to provide dynamic lighting and can't be removed.

This might be a driver bug, I have not tried the Nvidia 370.23 driver yet, I'm using 367 from the Ubuntu repository, but am thinking of downgrading because it's caused the colours to be incorrectly displayed when running Quake 2.

This doesn't happen with nouveau on my GTX650 or the radeonSI driver on my AMD A10's HD7880.

Link to comment
Share on other sites

After searching through the Unity forums: It seems that this is a known problem on systems with lots of cores--especially dual Xeon systems. Probably a problem with the multithreading code in Unity5. It affects all OSes and many games built on Unity5. So there's no way to fix it except to wait for the Unity devs to push out a new version with a fix, and from there to wait for the KSP devs to build KSP with that version.

Do you know if the KSP devs plan to keep up with Unity's minor version updates?

Link to comment
Share on other sites

7 hours ago, Tim_p said:

After searching through the Unity forums: It seems that this is a known problem on systems with lots of cores--especially dual Xeon systems. Probably a problem with the multithreading code in Unity5. It affects all OSes and many games built on Unity5. So there's no way to fix it except to wait for the Unity devs to push out a new version with a fix, and from there to wait for the KSP devs to build KSP with that version.

Do you know if the KSP devs plan to keep up with Unity's minor version updates?

You reminded me of something, we used to have to restrict KSP to one or two cores on Phenom cpu's, Windows users did this in the taskmanager and we can do this using the taskset command.

And yes, Squad will update Unity during each release cycle, though the actual release may be one or two behind Unity, this may not result in a fix however as the multithreading is handled by Nvidia's PhysX engine built into Unity which is currently on 3.3, so it will rely on Nvidia to provide an update for Unity to fix this.

Link to comment
Share on other sites

Yeah, already tried taskset. Unfortunately, even limited to running on one core the problem persists, even the eight enlighten threads. I guess even if the scheduler restricts the process to one core, it can still see that there are more cores.

Other users on other games have reported that disabling cores in the BIOS works, but that's a pretty messy solution.

Link to comment
Share on other sites

These three threads (all started by the same person) are the most informative I could find:

http://forum.unity3d.com/threads/unity-games-consume-100-cpu-on-many-titles.380442/

https://hardforum.com/threads/xeon-owners-i-need-your-help.1889547/

https://community.unity.com/t5/Editor/Unity-games-consume-100-CPU-on-MANY-titles/td-p/2481927

 Maplesyrupghost seems to be having the same problem I am, and a few volunteers checked their systems and some had similar problems as well.

 

Edit: two and a half threads. Two are mirrors of each other, but imperfectly synced (one is missing the newest posts), at least when I last accessed them.

Edited by Tim_p
Link to comment
Share on other sites

On 06/09/2016 at 5:34 PM, sal_vager said:

Interesting read @Tim_p, it's good news if it's really fixed in Unity 5.4, you should find that KSP 1.2 doesn't have this problem.

I'm very happy to report that this issue does not exist in the prerelease KSP 1.2. Performance for me is excellent and cpu usage is reasonable.

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...