Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

My GPU on my Mac overheats when running Overlap2D #413

Open
KevinNorth opened this issue Jul 13, 2016 · 105 comments
Open

My GPU on my Mac overheats when running Overlap2D #413

KevinNorth opened this issue Jul 13, 2016 · 105 comments

Comments

@KevinNorth
Copy link

KevinNorth commented Jul 13, 2016

When I run Overlap2D on my Mac, my GPU quickly reaches nearly 100ºC and stays at that temperature until I close the editor. This happens even when I leave Overlap2D running in the background without opening a project.

Here's a screenshot showing the temperature of my GPU when I'm running Overlap2D:

Notice my fan speeds and the "TCGC PECI GPU" temperature. The CPU is doing fine.

Here are my computer's specs:

General information:

  • Model Name: MacBook Pro
  • Model Identifier: MacBookPro11,2  Processor Name: Intel Core i7
  • Processor Speed: 2.2 GHz
  •   Number of Processors: 1
  • Total Number of Cores: 4
  •   Memory: 16 GB
  •   Boot ROM Version: MBP112.0138.B17

GPU:

  • Chipset Model: Intel Iris Pro
  • Type: GPU
  • Bus: Built-In
  • VRAM (Dynamic, Max): 1536 MB
  • Vendor: Intel (0x8086)

Molitor:

  • Display Type: Retina LCD
  • Resolution: 2880 x 1800 Retina
  • Pixel Depth: 32-Bit Color (ARGB8888)

My computer is running Java 1.8.0_74 as its JRE.

@KevinNorth
Copy link
Author

(I also posted this issue on the Overlap2D community forums.)

@reegankens
Copy link

Yes I have the problem too, i test in my imac and my macbook pro retina display. i think u must fix this problem. thanks KevinNorth I check in my ram, cpu process but no problems, apparently the problem is in the GPU

@bruceloco
Copy link

I'm still new at this, I have not see the graphical calls, but it could be a java issue.
How do other java apps behave? play some sort of graphics intensive java game and see if it has anything to do with your java version

@meonlineonmess
Copy link

I am also experiencing high CPU usage with Overlap2D and also VisEditor when these 2 and minimized on OS X. Please fix the issue on Overlap2D.

@bruceloco
Copy link

bruceloco commented Jan 7, 2017

CPU or GPU?
VisEditor is also based on Java.
What is your graphics card?
Sounds like it could be java trying to us hardware acceleration via OpenCL and doing it wrongly.

@meonlineonmess
Copy link

meonlineonmess commented Jan 7, 2017

I have a mac retina early 2015 which has intel iris graphics 6100. I am 100% the issue is only on macOS because I just tried 5 minutes ago Overlap2D in a Windows 7 virtual machine and I get no issue in Windows, just on OS X. I use AppPolice(in macOS) to limit the cpu usage of the Overlap2D process which I keep it at 20%. Therefor I do not permit it to go higher than that, but it is using resources for no reason and I read on this forum that it has something to do with the FPS which tries to go over 60 fps. The thing is that in OS X Mavericks and macOS Sierra all apps are limited to 60fps and they can not go higher, whereas in older OS X versions this limitation was not imposed. I used an app to see how many FPS I get when running Overlap and it always shows me 60fps and sometimes 61.5 and it looks like something is struggling to keep the FPS below 60. In other apps when running them I get around 10 fps when moving the mouse.

It is definetly something with the rendering, unfortunately I have no idea how to fix it. I read here that it was fixed in some early release but it doesn't seem to the case and I am not the only one experiencing this issue.

I hope my information will help fix this issue somehow, because Overlap2D is awesome :)

@bruceloco
Copy link

Can you build from source?
I think I might have found the place to fix this

@meonlineonmess
Copy link

Well I just downloaded the sources and I imported the gradle projects in my eclipse workspace(common-api,master,runtime-libgdx, extension and spine-runtime-libgdx). The master project and the spine-runtime-libgdx both are marked as having issues because of some missing imports. If you'll tell me where to change the code to make it work I'll give it a try to see if it'll fix the problem and I will let you know :).

@bruceloco
Copy link

I am not even sure it is this file, I was just looking a bit on how this is done and trying to find bugs on the underlying libs:
this led me to package com.badlogic.gdx.backends.lwjgl, function LwjglApplicationConfiguration:

public boolean vSyncEnabled = true;

and
/** Target framerate when the window is in the foreground. The CPU sleeps as needed. Use 0 to never sleep. /
public int foregroundFPS = 60;
/
Target framerate when the window is not in the foreground. The CPU sleeps as needed. Use 0 to never sleep, -1 to not render. **/
public int backgroundFPS = 60;

based on these threads:
libgdx/libgdx#3629
I could be totally off track but give it a go

@bruceloco
Copy link

Ah yeah, there were some instructions on the forum on how to build from source:
http://overlap2d.com/forums/topic/how-to-compile-and-run-overlap2d-editor-from-source-code/
Otherwise you can't build it

@meonlineonmess
Copy link

I get too many errors(100) after running ./gradlew assemble

@meonlineonmess
Copy link

I downloaded the source files and after importing the repo in eclipse it can not find the main class to run. In Run Configurations I can't select it. I guess I am supposed to run ./gradlew assemble first and after that it'll generate some other files. I don't know.

@bruceloco
Copy link

use git and follow the advice on the forum to set the branch

@meonlineonmess
Copy link

meonlineonmess commented Jan 8, 2017

I get this error when compiling:

"IdeaProjects/overlap2d/spine-runtimes/spine-libgdx/spine-libgdx/src/com/esotericsoftware/spine/Animation.java:770: error: cannot find symbol
float[] vertices = verticesArray.setSize(vertexCount);
^
symbol: method setSize(int)
location: variable verticesArray of type FloatArray

"

Also it can not run the project because it can not find setSize()

@bruceloco
Copy link

bruceloco commented Jan 8, 2017

git clone https://github.com/UnderwaterApps/overlap2d.git
cd overlap2d
./gradlew assemble
cd spine-runtimes
git checkout 419982695f3e41e36e7582ccf26c85db897c0416
cd ..
./gradlew build
./gradlew run

for me the error went away
then you only need the last 2 commands to build and run after changes

@meonlineonmess
Copy link

meonlineonmess commented Jan 8, 2017

well I got my clone using git from IntelliJ this time and at "./gradlew assemble" I get the failed message cause of some methods like setSize() which could not be found

I ran "./gradlew assemble" manually. Run -> main gives me the same issue.

@bruceloco
Copy link

yeah, I don't use intelij to build anymore, just command line

@meonlineonmess
Copy link

this time I used the terminal to clone the repo and I got the same error :|

@bruceloco
Copy link

bruceloco commented Jan 8, 2017

did you just run the commands as pasted? or did you use intelij to build?
the above commands worked for me. I have jdk 8, java runtime 1.8, gradle 3.3
Running a 2009 27" imac with Sierra on it

The first gradlew assemble will fail, but the build will work after that branch is checked out

@meonlineonmess
Copy link

I recorded my terminal actions. You can watch the video clip here, it is a dropbox share link->. https://www.dropbox.com/s/3iuf47bt7rlmimm/Issue.mov?dl=0.

@bruceloco
Copy link

./gradlew assemble is expected to fail.

Go ahead and do this after it fails:
cd spine-runtimes
git checkout 419982695f3e41e36e7582ccf26c85db897c0416
cd ..
./gradlew build
./gradlew run

@meonlineonmess
Copy link

ok it opens Overlap after building and ./gradlew run.

@bruceloco
Copy link

now you can play with the settings above:

public boolean vSyncEnabled = true; <- possibly try with false
and
/** Target framerate when the window is in the foreground. The CPU sleeps as needed. Use 0 to never sleep. /
public int foregroundFPS = 60;
/ Target framerate when the window is not in the foreground. The CPU sleeps as needed. Use 0 to never sleep, -1 to not render. **/
public int backgroundFPS = 60; <- possibly -1, not sure why this would actually be enabled for background work

@meonlineonmess
Copy link

ok I'll try at 12 o'clock cause I have to go to sleep. It is 3:30am where I live. I guess I have to replace the .jar dependency with the modified one(new jar compilation from https://github.com/libgdx/libgdx/tree/master/backends/gdx-backend-jglfw/src/com/badlogic/gdx/backends/jglfw ), right? cause the .class can not be changed.

@meonlineonmess
Copy link

I can't change the vSync variable because it is in a .class file and it is a Gradle dependency which I guess it means that it always downloads the requested .jar and it overwrites it.

@bruceloco
Copy link

I'm trying to decompile the file
gdx-backend-lwjgl-1.7.1.jar(stored in the gradle cache) to edit it to change the settings and see if this is the issue.
Then you can edit build.gradle and comment out:
compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion"

However, I have never done java before or intelij or whatever so it is a bit of a hard effort for me.

@meonlineonmess
Copy link

I tried to integrate a Scene into my project but the tutorials are beyond outdated

@azakhary
Copy link
Contributor

azakhary commented Jan 8, 2017

Hi guys! can I help in any way? what has to be changed to fix this? I am not sure why you try to decompile things, if the source is already here to change things in it?

@meonlineonmess
Copy link

@azakhary you could try to play with the vSync feature to turn it off just to see if makes a difference on macOS.

public boolean vSyncEnabled = true; <- possibly try with false
and
/** Target framerate when the window is in the foreground. The CPU sleeps as needed. Use 0 to never sleep. /
public int foregroundFPS = 60;
/ Target framerate when the window is not in the foreground. The CPU sleeps as needed. Use 0 to never sleep, -1 to not render. **/
public int backgroundFPS = 60; <- possibly -1, not sure why this would actually be enabled for background work

@azakhary
Copy link
Contributor

azakhary commented Jan 8, 2017

I do remember that it is related, and I tried something like that but it broke something else, while fixed the CPU load. I'll try from osx machine when I get to office. But if you guys can just run it from sources, then take a look at Main.java ( https://github.com/UnderwaterApps/overlap2d/blob/master/overlap2d/src/com/uwsoft/editor/Main.java#L69) maybe you can configure vSync for JglfwApplication or config (one of them has to have that)

@meonlineonmess
Copy link

@azakhary I'll try

@meonlineonmess
Copy link

meonlineonmess commented Jan 8, 2017

with 60,60,60 it still doesn't get hot but my FPS counter now shows it is using 68 fps to render the program. The process of Overlap doesn't go below 9% which means it is using resources that it should not use. It drains the battery faster.

@bruceloco
Copy link

I got
java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b16)
wonder if that is the problem

@bruceloco
Copy link

@meonlineonmess
Copy link

@bruceloco I opened your jar and I get the same behaviour as before: black screen when opening and then after a couple of seconds it shows the content. I also get low fps and low cpu usage whether if the program is minimized, in or not in focus.

@meonlineonmess
Copy link

It seems to work ok despite the black screen at which one is supposed to wait a little.

@bruceloco
Copy link

i have it opened for a minute and nothing

@meonlineonmess
Copy link

@bruceloco I switched between programs and only after that it showed up the content.

@bruceloco
Copy link

whats your jdk?
so it's not the player and not the source code, so we are up to the compiler now

@azakhary
Copy link
Contributor

azakhary commented Jan 8, 2017

Maybe it's the you run it? double clicking, versus right click open or some other way, may make it go to background during the startup sequence, and silently come back, leaving jglfw think that it's still on background. imho it's either osx version difference, or just the way the app is executed.

@bruceloco
Copy link

@azakhary @meonlineonmess has the same behaviour as me running on his system with the app I built.
I got OSX Sierra, 64bit. I am assuming that his is the same.
So I am inclined towards the JDK version.
I installed gradle via sdkman, I am using Gradle 3.3
My jdk is 1.8.0_112

@bruceloco
Copy link

Ok,
if I do:
System.setProperty("apple.laf.useScreenMenuBar", "true");
System.setProperty("com.apple.mrj.application.apple.menu.about.name", "Overlap2D");
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
config.width = (int) (width);
config.height = (int) (height);
config.backgroundFPS =-1;
config.foregroundFPS = 60;
config.vSyncEnabled = false;
config.title = "Overlap2D - v" + AppConfig.getInstance().version;
new LwjglApplication(overlap2D, config);

for OSX it works, stays a couple seconds black but works
But the switching of libraries here, using the LWJGL vs the JGLFW, not sure about the impact here

@meonlineonmess
Copy link

I use macOS Sierra 10.12.2 and Oracle JDK

java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)

@meonlineonmess
Copy link

meonlineonmess commented Jan 8, 2017

I wonder if VisEditor suffers from the same issue with the black screen. It also has the high CPU usage too and I saw the source code and it's the same issue there too with LwglApplication... Maybe after adding the settings for VisEditor like in Overlap2D, it will suffer from the same issue with the black screen. This could be a Hint.

@bruceloco
Copy link

also, I was just reviewing badlogic's repos and the lwjgl vs jglfw, and the jglfw repo has not been updated in 3 years.
also the badlogic libs for both lwjgl and jglfw are also at least 2 years old and all the new stuff comes on lwjgl3.
@azakhary any reason why the repo did not move?

@bruceloco
Copy link

@meonlineonmess lets keep the issue here based on overlap2D.

@bruceloco
Copy link

Also for future reference:
VSync is enabled by default on OSX and cannot be disabled easily
Someone created the following tool:
https://www.tonymacx86.com/threads/beamsyncdropper-tool-to-disable-beamsync-permanently.92201/

@meonlineonmess
Copy link

@bruceloco As far as I remember BeamSyncDropper when I used this app it did not work in El Capitan or Sierra because the rendering was changed in these versions.

@bruceloco
Copy link

@meonlineonmess yeah, don't see any updates on the project for 2 years.

@bruceloco
Copy link

@meonlineonmess have you tried using lwjgl on mac?
Since I don't have any project running I cannot see any issues/performance impact

@meonlineonmess
Copy link

@bruceloco no I didn't use it before

@bruceloco
Copy link

can you try with these settings?
System.setProperty("apple.laf.useScreenMenuBar", "true");
System.setProperty("com.apple.mrj.application.apple.menu.about.name", "Overlap2D");
LwjglApplicationConfiguration config = new LwjglApplicationConfiguration();
config.width = (int) (width);
config.height = (int) (height);
config.backgroundFPS =-1;
config.foregroundFPS = 60;
config.vSyncEnabled = false;
config.title = "Overlap2D - v" + AppConfig.getInstance().version;
new LwjglApplication(overlap2D, config);

Thanks

@azakhary
Copy link
Contributor

azakhary commented Jan 9, 2017

there was a reason we used Jglfw instead of Lwjgl. if you change it, other things will not work.

@bruceloco
Copy link

@azakhary does this include lwjgl3? or the standard lwjgl? you use it on windows, so there might be a mac bug or two which could easily be addressed no?

@azakhary
Copy link
Contributor

azakhary commented Jan 9, 2017

standart lwjgl. so yeah, 3 might be good. dunno

@azakhary
Copy link
Contributor

azakhary commented Jan 9, 2017

I can't sadly remember what exactly was not working... so maybe if you guys get it working, and confirm that everything is ok.... then it's worth trying.

@meonlineonmess
Copy link

Will Overlap2D ever support Box2D Joints? and when will it get out of the Alpha version?

@azakhary
Copy link
Contributor

azakhary commented Jan 9, 2017

Sadly I am afraid, I am occupied currently with other projects. So can't say anything.

@meonlineonmess
Copy link

Adding Box2D joints and keeping it free will surely increase the programs popularity which means Ads can generate revenue. Just keep in mind the fact that to develop a game requires some time and this means Overlap2D will be kept opened generating revenue through Ads Impressions.

@bruceloco
Copy link

@meonlineonmess add the feature on the program.
Or lets discuss this on the forum. This section is for ticket management

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants