Author Topic: OSX Environment Variables vs. Qube  (Read 6862 times)

dmeyer

  • Sr. Member
  • ****
  • Posts: 40
OSX Environment Variables vs. Qube
« on: February 08, 2010, 08:46:55 PM »
Hello,

I am in the final stages of an integration here and one thing is holding me up.  I have configured my OSX workers with the proper environment variables for mayabatch.  (if i remote into a worker, and from terminal do a "Render filename" it works, and env is reporting correctly).

Now, if i do a cmdline job and send "env" to that worker, I get back a different set of variables, not including the necessary stuff like MAYA_LOCATION etc.

Needless to say, if I submit a MayaBatch job with just "Render" it will fail as it doesn't know how to handle the command.

I have tried setting the environment vars on the workers via several methods, (/etc/launchd.conf,   /etc/profile)   etc.  I would prefer these to be set system-wide which seems to work with /etc/profile.

Any ideas where I am going wrong? 

jburk

  • Administrator
  • *****
  • Posts: 493
Re: OSX Environment Variables vs. Qube
« Reply #1 on: February 08, 2010, 11:16:16 PM »
Since the jobs run in a non-interactive shell, /etc/profile and ~/.profile are never sourced.  If you need an environment variable set for every job that runs on a worker, it must go into ~/.login.

But there's a better way:

The Maya BatchRender submission UI in QubeGUI v5.5 has a field to handle exactly this scenario: the "osxMayaEnv" control in the "Parameters" section.

If you provide the full path to the Render executable in the 'mayaExe' field, and set the 'osxMayaEnv' to anything other than 'disabled', the job will include a command to source the MayaENV.sh script located in the same directory as the Render executable.  This script sets up several environment variables, including MAYA_LOCATION.

There is a known issue with Maya 2010 on OSX which necessitates sourcing this file to set MAYA_LOCATION, and this control was added to directly address this issue.


But if you are writing a custom pipeline and want to build the Render command yourself, you need to build the command so that it sources the MayaEnv.sh and then calls the Render executable with the full path:

in bash/sh:

". /Applications/Autodesk/maya2010/Maya.app/Contents/bin/MayaENV.sh && /Applications/Autodesk/maya2010/Maya.app/Contents/bin/Render <args>"
« Last Edit: February 08, 2010, 11:23:36 PM by jburk »

dmeyer

  • Sr. Member
  • ****
  • Posts: 40
Re: OSX Environment Variables vs. Qube
« Reply #2 on: February 09, 2010, 03:44:34 AM »
jburk,

Thanks for the reply.  I have moved the environment variables into ~/.login as advised yet they do not seem to take.

export QBDIR=/Applications/pfx/qube
export ALIAS_LOCATION=/Applications/Autodesk
export MAYA_LOCATION=$ALIAS_LOCATION/maya2010/Maya.app/Contents
export PATH=$QBDIR/bin:$QBDIR/sbin:$MAYA_LOCATION/MacOS:$PATH

Overall, my goal is to get the MayaBatch sumbission to work across both Windows and OSX workers in one job, which I cannot really do if I explicitly set the exe path.  My windows workers are picking up the "Render" command ok.  Is this possible?


jburk

  • Administrator
  • *****
  • Posts: 493
Re: OSX Environment Variables vs. Qube
« Reply #3 on: February 09, 2010, 03:43:34 PM »
What does the output from "qbsub printenv" look like? 

Instead of modifying the environment directoy, you should be sourcing /Applications/Autodesk/maya2010/Maya.app/Contents/bin/MayaENV.sh, and letting it set up your environment for you.

But on a different note, I'd have to (very) strongly recommend against mixing frames from renders on different platforms in the same sequence.  Differences in floating point calculations between different platforms can cause minute variations in the final appearance of some materials and shaders not immediately apparent to the eye until you play the sequence at speed. 

If you mix and match frames from different platforms within the same sequence, you will invariably see crawl or flicker at some point.  And it will probably be on the tip of the hero's nose when he's in close-up...

dmeyer

  • Sr. Member
  • ****
  • Posts: 40
Re: OSX Environment Variables vs. Qube
« Reply #4 on: June 01, 2010, 05:24:31 PM »
Thanks jburk.  You are right, in the past mixing platforms was a big no-go in Apple's PPC days.  Since their move to Intel I've yet to see it occur.  In any case, in doing product design renderings we are generally submitting 'animations' that are not really animations per se, but are a collection of stills that would never be viewed as an animation.  We merely make them sequential so we do not have to submit them over and over again.

This does bring up an idea I'd like to submit as a feature request however.  Dealing with all the environment variables when supporting multiple rendering applications can be a pain, especially with system OS/updates changing things etc.  What if on the supervisor we could configure a command matrix?  So for instance a user simply chooses "maya 2011 software" to render, and the supervisor knows which platform each worker is on and submits the proper command.  This could be configured in a matrix of some kind of qbwrk.conf.