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

macOS problems #118

Open
Vutshi opened this issue May 30, 2024 · 17 comments
Open

macOS problems #118

Vutshi opened this issue May 30, 2024 · 17 comments
Assignees
Labels
bug Something isn't working

Comments

@Vutshi
Copy link

Vutshi commented May 30, 2024

Describe the bug
I have two issues on macOS:

  1. Purple stripes in fullscreen (in window mode everything is fine):
Screenshot 2024-05-30 at 14 14 06
  1. More complicated issue is that martyPC randomly freezes my macOS after approximately half an hour of work. First the system freezes such that only mouse can be moved, after that macOS (I guess) automatically reboots itself. Most likely it is an Apple's problem. Nevertheless, do you have any idea what can go wrong in this case?

Environment (please complete the following information):

  • macOS 13.6.7 (22G720)
  • 2,3 GHz Quad-Core Intel Core i7
  • Intel Iris Plus Graphics
  • Rust 1.78.0

Build info

@Vutshi Vutshi added the bug Something isn't working label May 30, 2024
@dbalsom
Copy link
Owner

dbalsom commented May 30, 2024

Thanks for the report. I am not sure why you'd have issues in fullscreen considering I request a borderless window instead of exclusive mode - but maybe that works differently in MacOS. The grey color is drawn by using the GPU's "clear color" - in fullscreen maybe there's an assumption that the entire screen will be drawn so this is turned off? If you toggle between scaling modes in fullscreen, are any artifacts of the previous display size left behind?

The reboot issue is very concerning. Obviously I don't want to damamge anyone's computer! In theory nothing a program could possibly do should be able to cause the operating system to unintentionally reboot, but there are always new bugs to find.

Are you running MartyPC as a normal user or an administrator?

The colors + rebooting makes me concerned a bit about potential GPU issues. Does your system get very hot? Do you have a way to monitor GPU/CPU temperatures?

Do you have a video game or other 3d application you can test to make sure that using the GPU itself isn't an issue?

Could you open Activity Monitor while MartyPC is running and examine the values for CPU % , GPU % and memory usage? Does memory usage continue to climb while MartyPC is running?

@Vutshi
Copy link
Author

Vutshi commented May 30, 2024

If you toggle between scaling modes in fullscreen, are any artifacts of the previous display size left behind?

Toggling the scaling modes does not affect the background stripes. Curiously, when switching to fullscreen mode, I see the expected plain gray background for a brief moment before the stripes appear. Maybe it is a bug in the GPU driver...

Are you running MartyPC as a normal user or an administrator?

Normal user.

The colors + rebooting makes me concerned a bit about potential GPU issues. Does your system get very hot? Do you have a way to monitor GPU/CPU temperatures?

It does get warm such that fan kicks in mildly. One cpu core is at 100%. Here is some monitoring data:
Screenshot 2024-05-30 at 17 22 05
I find it peculiar that the cpu load does not drop at all if I pause the emulation in martyPC.

In general, my MacBook is stable enough to run at full CPU load for days (I do some serious computations sometimes). However, it is not completely trouble-free. Occasionally, Mathematica or Firefox seem to be able to crash it, but this happens rarely, maybe a couple of times a year. In contrast, martyPC crashes macOS very consistently. It probably found a weak spot in this last Intel-based MacBook Pro, which Apple doesn't seem to support much anymore…

Do you have a video game or other 3d application you can test to make sure that using the GPU itself isn't an issue?

I can run 3D Switch games in Ryujinx.

Could you open Activity Monitor while MartyPC is running and examine the values for CPU % , GPU % and memory usage? Does memory usage continue to climb while MartyPC is running?

Memory consumption is around 100Mb it grows and drops back from time to time.
Screenshot 2024-05-30 at 17 23 36
Best

@dbalsom
Copy link
Owner

dbalsom commented May 31, 2024

Can you try building the egui example from here:
https://github.com/parasyte/pixels/tree/main/examples/minimal-egui

and see if you have any of the same issues?

Can you go back to the 0.1.3 release and see if it does the same?

@Vutshi
Copy link
Author

Vutshi commented May 31, 2024

Can you try building the egui example from here: https://github.com/parasyte/pixels/tree/main/examples/minimal-egui

and see if you have any of the same issues?

Yes, stripes are there, just red:
egui
I noticed that this simple example of a flying square loads one core to 100%. Is this normal?

Can you go back to the 0.1.3 release and see if it does the same?

Yes, it does the same.

@dbalsom
Copy link
Owner

dbalsom commented Jun 3, 2024

If you run the Pixels example for 30+ minutes does it also reboot your system?

@Vutshi
Copy link
Author

Vutshi commented Jun 4, 2024

If you run the Pixels example for 30+ minutes does it also reboot your system?

No, it does not. I ran Pixels all day without issues. The only abnormalities were the CPU load: ~30% when Pixels is in focus and ~120% when minimized to the tray. I'll report this on their GitHub.

Regarding macOS instability, it seems to occur when debug features (CPU state, instruction history, disassembly, etc.) are activated. I'll try playing a DOS game for an hour without these features enabled.

@dbalsom
Copy link
Owner

dbalsom commented Jun 4, 2024

can you show me the Performance window in MartyPC?

also, can you see if you have stripes in the wgpu examples (upstream of pixels)
https://github.com/gfx-rs/wgpu

@Vutshi
Copy link
Author

Vutshi commented Jun 5, 2024

can you show me the Performance window in MartyPC?

Here it is:
martyPC_performance

also, can you see if you have stripes in the wgpu examples (upstream of pixels)

Wgpu shows me the same strips but in a new color :). Should I report the bug to them as well, or is the Pixels bug report sufficient?

@dbalsom
Copy link
Owner

dbalsom commented Jun 6, 2024

If the issue is upstream of Pixels i'd say it is more appropriate to open it on wgpu. Pixels maintainer can't fix it

@Vutshi
Copy link
Author

Vutshi commented Jun 13, 2024

Hi @dbalsom,
how can I apply this workaround to martyPC?

@dbalsom
Copy link
Owner

dbalsom commented Jun 13, 2024

I suppose I can add a macos_stripe_fix flag to the config and then when we resize for fullscreen subtract one from the resize dimensions.

@Vutshi
Copy link
Author

Vutshi commented Jun 13, 2024

That would be awesome.

@Vutshi
Copy link
Author

Vutshi commented Jun 17, 2024

While testing the fix for #120, I encountered the freeze and reboot again. I've sent another report to Apple :)

@dbalsom
Copy link
Owner

dbalsom commented Jun 20, 2024

I bumped the wgpu version in the current branch. Can you check if you still have the same problems?

if you're still seeing the stripes, try the macos_stripe_fix setting.

@Vutshi
Copy link
Author

Vutshi commented Jun 20, 2024

if you're still seeing the stripes, try the macos_stripe_fix setting.

This workaround works!!! Thank you.

@Vutshi
Copy link
Author

Vutshi commented Jun 20, 2024

Hi @dbalsom,

Do you know what MartyPC is doing when emulation is paused? One CPU core is constantly at 100% utilization.

Screenshot 2024-06-20 at 22 49 42

@dbalsom
Copy link
Owner

dbalsom commented Jun 21, 2024

that's odd. it shouldn't really do anything different, but obviously it will spend less time per frame emulating, but it should just do updates and yield.

can you show me the performance window when paused?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants