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

high GPU usage after I quit - what's going on? #3004

Open
newearthmartin opened this issue May 22, 2024 · 19 comments
Open

high GPU usage after I quit - what's going on? #3004

newearthmartin opened this issue May 22, 2024 · 19 comments

Comments

@newearthmartin
Copy link
Contributor

newearthmartin commented May 22, 2024

Operating System Version:

MacOS (M1)

Popcorn Time Version:

0.5.1

Behaviour:

I've been noticing that my M1 Macbook Pro gets warm when it's supposedly idle. Then I've been noticing that this happens whenever I use Popcorn Time and I open the Activity Monitor and find a nwjs Helper process that can keep running for hours after I close PT. Sometimes it says just nwjs Helper and sometimes nwjs Helper (GPU). This happens even if I didn't download a movie.

Why does a process linger after I quit and why is it consuming 90% of the CPU? Even when I didn't download or play any movie. What is it supposed to be doing?

So, respectfully, what the heck is going on? It's really not easy to make an M1 Macbook Pro get warm. It feels like something fishy, as if the PT spawned a rogue process which is doing intensive processing.

Also PT is not a complex app, why is it so unstable in mac? Why does it take several attempts to open it?

Screenshot 2024-05-21 at 8 40 03 PM
@newearthmartin newearthmartin changed the title high GPU usage - what's going on? high GPU usage after I quit - what's going on? May 22, 2024
@merseyV
Copy link

merseyV commented May 22, 2024

Why does it take several attempts to open it?

Probably for the same reason as your other problem - "Why does a process linger after I quit"? I think you're using an osx64 version .. not recommended for Silicon Macs? You should be using the arm64 version?

and why is it consuming 90% of the CPU?

It's only using 90% of one core. Your M1 has 8 cpu cores (maybe 7 if it's a base model?) .. so it's using roughly 11/13% (it's slightly more complicated than that ... but not important for our purposes!). The highest cpu usage would be nwjs Helper (Renderer) ... under normal running. The "rogue" nwjs helper is probably "stuck in a loop!" .. in the background?

Activity Monitor

n.b.
Because it's a Silicon (Arm64) application, Safari will apply a ("sticky") 'Gatekeeper' quarantine flag to the download .. Silicon apps are required to be signed and notarised (with an Apple developer account).

It's necessary to manually remove the quarantine flag using Mac's 'Terminal' (command line) utility.
The command is xattr -c "/path/to/application.app".

Copy xattr -cinto Terminal > insert a space > and drag the PTapp into the Terminal window to insert its location (path) > 'Enter' . You should be able to open the PTapp if you've done it correctly?

As an alternative:
Download the 'xattred 1.5' utility from https://eclecticlight.co/xattred-sandstrip-xattr-tools/. Just drag the PTapp into its "name" box > click on "com.apple.quarantine" flag .. and then "Strip Flag" button.

@newearthmartin
Copy link
Contributor Author

It can be 90% of only one core but... the app is closed!
Why does this process remain? and what is it doing taking one core?

@newearthmartin
Copy link
Contributor Author

Yes, I was using the osx64 version because the arm version was not starting. Thanks for the tip about xattr, now it works and it's much better!

The nwjs helper takes much less CPU (20 - 40%) and apparently doesn't leave a running process after quitting.

@newearthmartin
Copy link
Contributor Author

How about adding a note about xattr for Apple Silicon macs in the README in the MacOS section?

@merseyV
Copy link

merseyV commented May 22, 2024

Why does this process remain? and what is it doing taking one core?

There's an issue with the new nwjs 0.86.0 version in the osx64 build ... it's not compatible with Rosetta 2 any more. One outcome is leaving behind the nwjs Helper after an aborted opening/crash? The orphaned nwjs child is just having a tantrum!!

How about adding a note about xattr for Apple Silicon macs in the README in the MacOS section?

I'm just a user (like yourself). That's beyond my pay-grade!!

@dutchy1001
Copy link
Collaborator

dutchy1001 commented May 22, 2024

So glad I refuse even to touch any apple products (even those growing on trees). 🤪🤪🤪

OOPS wrong button

@merseyV
Copy link

merseyV commented May 22, 2024

(even those growing on trees)

What!? You've never had a knobby russet or dog's snout? Not tasted a goose's arse (Tangy!!!) 🤣

@dutchy1001
Copy link
Collaborator

Tasted enough, just not my taste. Pineapples are allowed 🍍🍍🍍

@merseyV
Copy link

merseyV commented May 22, 2024

Pineapples are allowed 🍍🍍🍍

Lol ... that'll be in the cocktails 🍸🍸🍸🍸

@newearthmartin
Copy link
Contributor Author

Why did you reopen the issue?

Please respect developers also by not adding noise with pointless conversations

@merseyV
Copy link

merseyV commented May 23, 2024

Please respect developers also by not adding noise ......

"When the Cat's away ...."

200w

@dutchy1001
Copy link
Collaborator

Why did you reopen the issue?

Clicked the wrong button after I made the comment so I reopend it strait away. If your happy your issue has been resolved then I can close it again.

@merseyV weird looking cats you got there....

@newearthmartin
Copy link
Contributor Author

@merseyV your tip about xattr made it to the README

https://github.com/popcorn-official/popcorn-desktop

@merseyV
Copy link

merseyV commented May 26, 2024

@newearthmartin .. Nice one!!!

It's mentioned in numerous Subreddit posts and in the Popcorn Time Wiki (FAQ's). You've (now) covered it in the ReadMe. I'll guarantee - it'll get raised again! ... lol.

@newearthmartin
Copy link
Contributor Author

Well, I'm raising it again. Switching to arm64 didn't solve this. As you can see below, I had this process consuming a CPU core for 80 hours.

Screenshot 2024-06-23 at 12 29 49 PM

@merseyV
Copy link

merseyV commented Jun 24, 2024

You left your computer on for 80hrs ... after closing PTapp? Or you used PTapp several times over 80hrs? Did the app crash/freeze/misbehave prior to this particular instance?

Anyway, I've used osxarm64 for about 5 months - never experienced a "rogue" nwjs process? You've reported it once (for arm64) ... no-one else has yet (to date). Not exactly a bug! More like a conflict between PTapp and something in your set-up.

@newearthmartin
Copy link
Contributor Author

Look, if you have a Macbook, you are not supposed to turn it off every time you stop using it. You can just close the lid and the system will sleep. So I never turn the computer off. More info here

I don't know if that's 80 "physical" hours since the process started, or 80 actual hours of processor use. That's irrelevant. The idea here is that the process will live forever unless you kill it or shutdown your mac.

Maybe I'm the first one to report it. Maybe other users haven't noticed. That's not enough reason to dismiss this bug report.

@newearthmartin
Copy link
Contributor Author

newearthmartin commented Jun 24, 2024

For the most part I haven't been seeing this rogue process. Before, it was linked to the random app shutdowns because I was using the osx64 version in Apple Silicon. But now it appeared again and I'm using the arm64 version.

I will be keeping an eye on it. Especially if you experience any shutdowns, please check if you have any rogue processes.

@merseyV
Copy link

merseyV commented Jun 24, 2024

That's not enough reason to dismiss this bug report.

Not my intension. Just pointing out it's not very common - ergo, may be hard to pin down.

you are not supposed to turn it off every time you stop using it.

I've heard that said .. kept my mid 2010 MacBook Pro, going about 10 years before putting her out to grass!. Turned it off every day? 😆

please check if you have any rogue processes.

That's what I mean ... no crashes/freezes or unexpected shutdowns. Unlike osx64 which regularly left a trail of "orphans"? I often use Activity monitor with PTapp ... mainly checking on memory usage.

Yes, keep an eye on it ... and see if there's any coincidental connections with other processes/software? You didn't notice the fan coming on this time, or it getting warm: Usually happens with a hanging process.

n.b 100% cpu on 1 core would be real time. 10% cpu would be a tenth of real time.

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

3 participants