Previous topicNext topic

Multithreading?

Questions, comments, feedback, etc.
Post Reply
jstark
Posts: 9
Joined: Tue Oct 11, 2016 7:36 pm

Multithreading?

Post by jstark »

Does magic support multi threading? We've been using this to develop 4k visuals and when the capture took 2 weeks as opposed to the 36 hours it takes on softwares like adobe/maya/3dsmax/digistar we started looking around and noticed that Magic only uses one cpu to capture the visuals. We're running intel xenon e5-1660v3 8 core cpus so only using one core is a pretty tight bottleneck.
Magic
Site Admin
Posts: 3441
Joined: Wed Apr 09, 2014 9:28 pm

Re: Multithreading?

Post by Magic »

Well, I appreciate the comparison to those much more expensive software packages :). For what a 1-year subscription costs for Maya or 3ds Max -- $1470 USD (!) -- you could buy more than 20 copies of Magic Performer (and own them forever, not just 1 year).

...but seriously. When you say "capture the visuals", I assume you mean exporting them to a movie file? If so, there are a few things to understand when comparing Magic to Maya, etc.

First, Magic is optimized for real-time rendering, meaning WYSIWYG -- what you see is what you get. You get the actual final rendering even while you are editing the project, and never anything less than the final rendering. This is very different than those other programs, which are focused on exporting movies "offline", rather than letting you see the final result in real-time -- especially at 60 fps. Magic relies almost entirely on the GPU, and surprising though it may be, it is highly inefficient to get a rendered image back from the GPU into main memory. So it actually takes longer to export content to a movie than it does to just display the content on the screen.

Second, and more importantly, many of Magic's visual effects and audio analysis techniques are very sequential in nature, meaning that rendered frames depend heavily on previously rendered frames. It is therefore nearly impossible to do anything in parallel, which is what multithreading would achieve. Further, GPU-based rendering does not support multithreading well -- it's just not how graphics acceleration works. You can search the web for any number of pages that say this. Here's one of the first results: http://stackoverflow.com/questions/1109 ... -on-opengl. To summarize, the GPU takes care of multithreading inside itself, meaning there is lots of parallelism happening in each frame, but only between different pixels in one frame at a time. Between different frames, there is not much that can be done. By contrast, in Maya or 3ds Max, the final rendering usually does not use the GPU (exclusively), mostly the CPU, so it is much more parallelizable.

Finally, and most importantly, I think your main bottleneck is this: because you are exporting from Magic in 4K, you are required to use the .png export format, since .mp4 doesn't support 4K. It is *much* slower to export to .png, because it uses lossless compression, and the files are much larger. But, unfortunately, you don't have a choice. This is partly our fault -- we haven't provided any alternative export options. But we will :)

So, to answer your overall question, yes, Magic does support multithreading, to the extent that it's possible. All the graphics rendering happens on one thread only, but other things happen in other threads.
jstark
Posts: 9
Joined: Tue Oct 11, 2016 7:36 pm

Re: Multithreading?

Post by jstark »

Thanks for the in explanation. We figured it likely wasn't an oversight but it never hurts to ask. You're right about the .png export. When we run tests we use a (relatively) low res mp4 export and it is of course much quicker. For the instant feedback when creating in your software it's still worth the wait of the long exports, other methods we use involve hard codes where it is 15-30 minutes of work before you get to see each change. Just thought we would look into it.

Side note. You're right about the different price points, we pay through the nose for those other softwares. That's actually a big selling point for your stuff. We've bought licenses for 5 or 6 workstations at this point because it's so immediately useful for creating light shows and we've paid what like 25% of our yearly adobe fee? Magic is a bit more of a one trick pony than the other softwares listed (not so useful for our educational content) but that's okay as long as its a really good trick. We also implemented a time code of sorts so we can cue things within a scene at a certain time rather than just by volume and that opens all kinds of doors.

Thanks again for the quick response.
Magic
Site Admin
Posts: 3441
Joined: Wed Apr 09, 2014 9:28 pm

Re: Multithreading?

Post by Magic »

Magic is a bit more of a one trick pony than the other softwares listed
Haha, well the Unix philosophy is "Do one thing and do it well": https://en.wikipedia.org/wiki/Unix_phil ... Do_It_Well. Of course, Magic isn't available for Unix :). But I still agree with the philosophy.

Steve Jobs also said "Do not try to do everything. Do one thing well." Not that I'm the biggest fan of Steve Jobs though :).
Post Reply