Previous topicNext topic

Project file crashing on load

Questions, comments, feedback, etc.
Post Reply
FourEyes
Posts: 7
Joined: Wed Apr 26, 2023 11:19 pm

Project file crashing on load

Post by FourEyes »

Hi all,

My main project file (containing many many scenes) now crashes Magic on load.

I'm running on Magic on my Macbook Pro, other projects open fine. When loading this specific project, all the progress bars make it to 100%, then as it starts loading the previously open scenes in the editor it crashes immediately.

I see the following output in my terminal window:
---
Last login: Wed Apr 26 16:00:15 on ttys000

The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
/Applications/Magic.app/Contents/MacOS/Magic ; exit;
Shawns-MacBook-2:~ labrecqu$ /Applications/Magic.app/Contents/MacOS/Magic ; exit;
Bus error: 10
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]
---

I was last working in the project this morning and unfortunately don't have a backup. Any ideas how I might be able to recover it?

Thanks!
FourEyes
Posts: 7
Joined: Wed Apr 26, 2023 11:19 pm

Re: Project file crashing on load

Post by FourEyes »

Upon further experimentation, the issue appears to be memory related... if I spam cmd-shift-C and repeatedly clear the graphics memory when the project loads Magic remains open. While I'm spamming the key combo, I can close the open scenes in the editor and scroll up and down in the folder panel but if I right click a scene or otherwise slow down my spamming of the key combo, Magic immediately crashes displaying the message from my previous post.

I was able to find a copy of my project from 15 months ago, so not ALL is lost, but lots of effort will be lost if I can't find a way back into this project. I appreciate any help the community can offer. Moving forward, I will definitely be sorting out a backup strategy that includes use of the built in Auto-Save and Auto-Backup capabilities! Ignoring these capabilities was major oversight on my part.

Thanks
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: Project file crashing on load

Post by Magic »

Yes, it is definitely related to memory. Specifically, it is related to graphics memory.

You should make sure that "Load All Scenes Into Graphics Memory" is NOT enabled. And further, you should NOT enable "Keep Scene In Graphics Memory" for any of your scenes.

If you can disable these settings while your project is open, your problem should be solved.
FourEyes
Posts: 7
Joined: Wed Apr 26, 2023 11:19 pm

Re: Project file crashing on load

Post by FourEyes »

Thanks for your reply.

I can confirm "Load All Scenes Into Graphics Memory" is NOT enabled.

However, there are 18 scenes in my project which I've configured to "Keep Scene in Graphics Memory". For instance, my webcam has its own scene for which i've enabled "Keep Scene in Graphics Memory" and it is referenced in a number of other scenes, I do the same for other effects or building blocks that I use over and over. If this is not best practice I will definitely change this going forward.

Unfortunately, I cannot remove these scenes from graphics memory before the application crashes. It seems that when I right click any of my scenes in the folder panel the key combo spamming is interrupted and Magic immediately crashes.
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: Project file crashing on load

Post by Magic »

Do you have access to any other computer that might be able to load the project without crashing? Then you can disable the memory option, save the project, and load it back on your original computer.
FourEyes
Posts: 7
Joined: Wed Apr 26, 2023 11:19 pm

Re: Project file crashing on load

Post by FourEyes »

Luckily i'm getting a new Macbook next week. I'll try opening it on the new machine when it arrives and see if that remedies the problem.

Thanks again for your help.
Terry Payman
Posts: 710
Joined: Sun Sep 14, 2014 8:15 am
Location: UK
Contact:

Re: Project file crashing on load

Post by Terry Payman »

There's a likely fix which you can try on your present system, thanks to a feature I requested years ago (thanks again Eric for implementing it!).
I had similar issues - the problem also arises if a big project is moved to a machine with less GPU memory (and in other scenarios).

Here's what to do:
Start Magic. Don't try to load your project, first change Magic's resolution settings:
Window > Magic Window Options > Graphics Resolution > 854x480 (or a lower resolution than your usual project settings)
Window > Magic Window Options > Lock Graphics Resolution (it won't then change to the previously saved resolution of your project)

Now your project should load just fine, as the memory requirement is hugely reduced at the low resolution.

Make a note of which scenes are kept in graphics memory.
You will now be able to remove the "Keep Scene in Graphics Memory" from some (or all) scenes.
Save your project, perhaps under a different name.

Now set the graphics resolution back to your normal settings. I usually keep my Graphics Resolution locked so the project loads at my current chosen resolution rather that the one saved along with the project. There's obviously a performance compromise without scenes kept in graphics memory, so you'll probably need to try a few variations once your project is back up and running.

I have noticed that Magic can crash on scene changes when one is very close to the graphics limit. Perhaps graphics memory requirement can spike during scene changes. Don't sail too close!
FourEyes
Posts: 7
Joined: Wed Apr 26, 2023 11:19 pm

Re: Project file crashing on load

Post by FourEyes »

Thanks for your suggestion Terry.

I tried progressively lower graphics resolutions until I got all the way down to 16px by 9px. Unfortunately this approach didn't work for me.

I did manage to solve the issue this morning! I installed some auto key clicking software and configured it to send cmd-shift-c every 100 milliseconds. While that was running, I loaded the project file and in each of the previously open scenes that were accessible through the editor I went in and powered off all the components. This reduced the memory usage enough that Magic no longer crashed.

I've now removed all scenes from Graphics memory and can save and re-open the project with no issues. Phew!

Moving forward I'd like to take advantage of the Auto-Backup feature and I have a question... where is the backup destination? The documentation references a temp folder, but I'm unsure where this is. I'm currently running Magic on macOS Big Sur (11.6.8).
Terry Payman
Posts: 710
Joined: Sun Sep 14, 2014 8:15 am
Location: UK
Contact:

Re: Project file crashing on load

Post by Terry Payman »

I'm glad your ingenious tactic worked, although I'm puzzled that it was necessary.

Regarding the temp directory location I only have Windows machines and don't know about Mac, so I tried searching for "temp directory" on this forum.

I found this answer from Sadler to the same question viewtopic.php?p=11292#p11292 which had the link https://www.cleverfiles.com/help/temp-folders-mac.html

I also tried asking perplexity.ai https://www.perplexity.ai/ "macOS Big Sur (11.6.8) : where is the temp folder?"

It responded with the following, each section with a link to the source.

The temp folder on macOS Big Sur (11.6.8) is located at /tmp
To access it, you can open the Terminal application, found in /Applications/Utilities/, and type "open /tmp" (without quotes).
Alternatively, you can click "Go" at the top of your screen, then scroll to "Utilities" and click on it. From there, you can click on "Terminal" and type the same command. It is important to exercise caution when deleting files in the temp folder, as removing certain files may cause instability in the system.
FourEyes
Posts: 7
Joined: Wed Apr 26, 2023 11:19 pm

Re: Project file crashing on load

Post by FourEyes »

Terry Payman wrote: Sun Apr 30, 2023 10:22 am I'm glad your ingenious tactic worked, although I'm puzzled that it was necessary.
After cleaning up my project file more, I think I understand the source of the issue.

I had a bunch of scenes in my post-processing scene that had post-processing applied to them. I suspect I hadn't flagged them to be excluded, so when I ran the "Add/Update Post Processing Scene" command I created a looping situation that would instantly eat up all the graphics memory.

Thanks for digging up the temp folder thread and introducing me to perplexity.ai!
Magic
Site Admin
Posts: 3440
Joined: Wed Apr 09, 2014 9:28 pm

Re: Project file crashing on load

Post by Magic »

The post-processing scene will automatically be excluded from looping. So it must have been some other issue. But, I'm glad you got it resolved.
hazardman
Posts: 74
Joined: Sat Nov 08, 2014 1:33 am

Re: Project file crashing on load

Post by hazardman »

you can also try using "import project" from the file menu in a blank magic project...

i had a troublesome file once that kept crashing after loading so i tired importing it instead and then saving it as a differently named file...i don't remember exactly what the problem was but this was a good fix in my case...
Post Reply