Maya headless command line rendering

Maya headless command line rendering

Anonymous
Not applicable
5,159 Views
45 Replies
Message 1 of 46

Maya headless command line rendering

Anonymous
Not applicable

Hi all,  

 

We have an issue with trying to render on networked macs via the command line.

 

 

We're using the Render call, generally located at /Applications/Autodesk/maya2018/Maya.app/Contents/MacOS/Render on OSX with s, e, proj and rd flags.

 

The error we're getting currently is:

_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.
Assertion failed: (err == kCGErrorSuccess), function +[_NSCGSTransaction initialize], file /BuildRoot/Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1561.60.100/CGS.subproj/NSCGSTransaction.m, line 241.

 

This error only occurs if a user isn't logged in - we know apple released a security update back in March 2018 that prevented access to the window server while on the login prompt. 

 

Does anyone know a way to work around this? Is there some flag we can tell Maya to not access the window server so we can run it in an headless state?

0 Likes
5,160 Views
45 Replies
Replies (45)
Message 2 of 46

sean.heasley
Alumni
Alumni

Hi @Anonymous and welcome to the community!

 

I personally haven't seen a workaround for this since the security update.

 

That said, I passed your question along to our developers to see if we can hear back on a potential workaround for this and I'll get back to you as soon as I have an update!

 

 

0 Likes
Message 3 of 46

sean.heasley
Alumni
Alumni

Hi @Anonymous

 

I did some digging while waiting on hearing from the devs and I found this article that may help!

 

This will allow you to tweak file settings so they can work without being logged in and might help you out!

 

 

0 Likes
Message 4 of 46

Anonymous
Not applicable

Thanks for the reply @sean.heasley - we've tried various things with permissions - setting 777 to the binaries, changing owner to try run the process as root etc but we've had no luck. (running as root isn't something we'd like to do in this environment either).

 

Hopefully there's some flag we're missing that can be set.

 

0 Likes
Message 5 of 46

sean.heasley
Alumni
Alumni

Hi @Anonymous

 

I got a response from one of our devs:

 

"In general Maya batch should not be referencing GUI components, though some have slipped in from time to time before we catch them and add extract checks.

 

There are instances where code/plugins may want/need to use GPU for something and if there is no GUI may fail or if not checked may try to access it.

 

The workaround would probably be to allow automatic login so there is someone logged into the machine - hopefully the same userID as used for the remote access.

 

It would also be helpful if we could have an example to reproduce locally and it can help to determine what part of Maya is attempting to use GUI components."

 

 

 

 

0 Likes
Message 6 of 46

Anonymous
Not applicable

Hi @sean.heasley,

 

Yeah, we needed a user to be logged in for the batch render to work, however the macs we have are setup in a lab environment so it's not really feasible to have an account logged in all the time. What we do is track if a machine is in use or not, then depending on the result, we distribute render jobs to it via a remote call.

 

I've attached a sample project for your devs to test - it's not much different from a basic maya project with a couple of textures. Our procedure to rendering this project is similar to remote ssh'ing in as a user called render, then running the following command (I've placed the project files on the render account desktop for connivence here)

 

 

/Applications/Autodesk/maya2018/Maya.app/Contents/MacOS/Render -s 1 -e 1 -proj /Users/render/Desktop/maya_network_render/ -rd /Users/render/Desktop/test.exr /Users/render/Desktop/maya_network_render/scenes/test_scene.ma

 

 

Cheers

- Steven

0 Likes
Message 7 of 46

sean.heasley
Alumni
Alumni

Hi @Anonymous

 

Hmmm ok.

 

Thanks for attaching the file! I went ahead and sent it along to the devs so they can see if there are any potential workarounds and will probably get back to me over the weekend/Monday.

 

 

0 Likes
Message 8 of 46

sean.heasley
Alumni
Alumni

Hi @Anonymous

 

Out of curiosity, are you working with an educational license? Its possible that could be causing the issue.

 

Also, if someone is logged onto the machine is anything displayed on the desktop/display?

 

 

0 Likes
Message 9 of 46

Anonymous
Not applicable

Hi @sean.heasley

 

Yes we are on educational licenses - we have about 72 macs in the lab linked up to a networked license server. 

 

For when a user is logged in, we do notice that maya icon bounces shortly (like 20 seconds) in the dock - it doesn't open up a GUI or anything. 

0 Likes
Message 10 of 46

sean.heasley
Alumni
Alumni

Hi @Anonymous

 

Thanks for confirming that! We're currently compiling a log on this issue and I just need as much information as possible.

 

When this happens, do you get anything rendered or does the render hang and not proceed at all?

 

 

0 Likes
Message 11 of 46

Anonymous
Not applicable

Hi @sean.heasley,

 

The render doesn't proceed at all - Maya just hard crashes. What we see in the console is the error I posted in my original post with // Maya exited with status -1 afterwards.

 

 

 

0 Likes
Message 12 of 46

sean.heasley
Alumni
Alumni

Hi @Anonymous

 

Thanks for that information!

 

Is there is any info/files about crash files ~/Library/Logs/Diagnostics or /Library/Logs/Diagnostics directories on the remote machine?


It doesn't sound like Maya is actually crashing, but just exiting with -1 status.

 

 

0 Likes
Message 13 of 46

Anonymous
Not applicable

Hi @sean.heasley

 

Yes, there is a crash log at/Library/Logs/Diagnostics which I've attached. 

 

There's some element with the batch renderer that seems to want to access the appkit calls to the windows server.

0 Likes
Message 14 of 46

sean.heasley
Alumni
Alumni

Hi @Anonymous

 

Thanks for adding all of this! I added it all to our log on this issue and our dev team is working on reproducing it and figuring out if there is a workaround and/or if this needs to be fixed in an update/future release of Maya.

 

 

0 Likes
Message 15 of 46

Anonymous
Not applicable

Hi @sean.heasley,

 

Just wanna quickly ask if there has been any updates regarding this?

 

Cheers

 

0 Likes
Message 16 of 46

sean.heasley
Alumni
Alumni

Hi @Anonymous

 

There's no major update yet like a fix/release date etc but there has been a lot of back and forth on this specific issue by our dev team and they're steadily working on applying a fix for it.

 

 

0 Likes
Message 17 of 46

lab.licenses
Explorer
Explorer

We have hit the same problem with trying to render to Macs running the latest security updates while logged off.

 

Starting "/Applications/Autodesk/maya2018/Maya.app/Contents/MacOS/maya"

_RegisterApplication(), FAILED TO establish the default connection to the WindowServer, _CGSDefaultConnection() is NULL.

Assertion failed: (err == kCGErrorSuccess), function +[_NSCGSTransaction initialize], file /BuildRoot/Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1561.60.100/CGS.subproj/NSCGSTransaction.m, line 241.

// Maya exited with status -1

0 Likes
Message 18 of 46

lab.licenses
Explorer
Explorer

Hi,

When is this issue going to be resolved? The Maya 2018.4 Update does not fix it. Our student render farm is out of commission until batching rendering functionality is restored without a user logged in.

 

 

 

0 Likes
Message 19 of 46

sean.heasley
Alumni
Alumni

Hi @lab.licenses

 

They've found a fix for it but it didn't make the cut for update 4 so they are currently working on releasing it in a future update/version.

 

 

0 Likes
Message 20 of 46

Anonymous
Not applicable

Hi @sean.heasley

 

Awesome, that's great to hear, hopefully the update comes soon.

0 Likes