DrQueue 0.50 Install for Mac OS X
NOTE: Using Maya 6.5? Read this!
There has been a lot of work done on DrQueue in the past few weeks, plus I have discovered a number of things I could have done better.
So here we have the DrQueue Install for Mac OS X take II.
Some of this is the exact same as before, some is different. If this is your first visit, and you are starting out with 0.50 or later, this is the document you want. :)
NFS
The very first thing we need to do is get basic communication going between our cluster nodes. I used NFS seeing as we will have mixed Mac/Linux nodes.
Since we will launch our applications from an NFS mount at boot, we have a bit of work to do. It seems Apple has done some really messy things with NFS. Set up an NFS share as usual.
It is very important that your NFS shares look the exact same on all nodes as it will be used as a file path and will be the same for every node being queued. For example, I set up my NFS export to be mounted as /mnt/render on every node of my cluster. Both Mac OS X and Linux. You will have to create any directories that don't already exist before attempting to mount the export.
Luckily a fellow named Bill Scott helped me via the Apple Support Discussion forums. This is what is needed for any of your client machines. Here is what he said:
If I understand correctly what you are asking, you are trying to do the same thing that I am doing. Mine always works, so I will describe it, and apologies if it is not what you were asking.
1. Change the /etc/hostconfig file.
a. sudo cp /etc/hostconfig /etc/hostconfig_original
b. change the line in /etc/hostconfig to
AUTOMOUNT=-NO-
2. Change the /System/Library/StartupItems/NFS/NFS file
a. sudo cp /System/Library/StartupItems/NFS/NFS /System/Library/StartupItems/NFS/NFS_backup
b. Although this shouldn't be required from the change in part 1, I did this anyway: Comment out these lines:
# if [ "${AUTOMOUNT:=-YES-}" = "-YES-" ]; then
# automount -m /Network -nsl
# automount -m /automount/Servers -fstab -mnt /private/Network/Servers \
# -m /automount/static -static -mnt /private/automount
# ln -s /automount/Servers /Network/Servers
#
#
# Hint that the name /Network should be localized:
#
# ln -s . /Network/.localized
# fiand replace it with the single line
mount -a
c. sudo cp /System/Library/StartupItems/NFS/NFS /System/Library/StartupItems/NFS/NFS_modified_backup
3. Remove symbolic links that the automounter created in /mnt and replace them with directories. Kill the automounter if it is presently running.
4. Reboot. (sudo mount -a will allow you to mount without rebooting, but you should test to make sure it works).
PS: I used NFSmanager to do the mounting stuff. It will fail harmlessly at the last step with error 225 or something like that because you turned the automounter off. Ignore the error. It will work when you reboot or issue
sudo mount -a
XServe Warning!: If you are using both ethernet ports on your XServe, only the first seems to work 100% when using NFS in my experience.
Test out your machines and make sure they connect at boot every time. Another warining: If you have auto-login enabled, the mount will not appear on the desktop at first login. But as soon as you try to go to the path you had it mounted via the Finder, it will suddenly appear on the desktop. The path IS MOUNTED, even though the mount is not on the Desktop. I.E. any apps can have launched from it, and you can enter it from the terminal without seeing it on the desktop.
Configure the System PART I
Now we need to do a few system tweaks to make things easier later.
First lets set up our environment:
Use your favorite text editor as root to add the folowing lines to /etc/profile:
export DRQUEUE_ROOT=/mnt/render # NOTE: Of course put your own path here
export DRQUEUE_MASTER={ip address or host name of master machine}
Make sure you log out and log back in for the changes to take effect. Opening a new terminal window should be effective as well in place of a full log out and log in.
NOTE: If you wish to run the Master on the same machine that is exporting NFS, it may have a different path than the other machines. You can either put in that other path, or create a symbolic link to make it the same. WARNING: On Mac OS X any symbolic links you put in Volumes will dissappear on reboot. Don't be dumb like me and put a symbolic link in there. :)
DrQueue Compile and Installation
To install DrQueue you must compile it. Which means you need a few things first. For those of you that don't have a reason to put developer tools on every machine, you can easily compile on one machine, and since we are putting our binaries on a network share the other machines will be able to find and run them. You will need to have X11 and the other tools we will install below to use the Queue Manager drqman. So at least one machine will require it, unless you have a linux machine you will control from (this is actually how I do it.)
First we need to have Xcode installed. Either install from the Panther install discs, or download the latest version from ADC (free registration required).
With XCode installed you will need to install Fink.
At this point you have 2 options:
1) Use Apple's X11
2) Don't use Apple's X11
I suggest that you do use Apple's X11, as it is much friendlier to deal with. If you want to use it make sure it is installed before you do the following commands with Fink. If you do not want it, make sure it is not installed, and Fink will install Xfree86.
Now with Fink installed, run the following commands as root (with sudo if you haven't enabled the root account):
apt-get update
apt-get install glib2-dev
apt-get install gtk+2-dev
apt-get install pkgconfig
apt-get install atk1
apt-get install pango1-xft2-dev
After those have completed we are ready to compile drqueue. Go to the drqueue folder you downloaded and expanded. Then run the following commands:
make clean
make
make INSTROOT=$DRQUEUE_ROOT INSTUID={a user account/number} INSTGID={a valid group ID for that user} install
Added in 0.50 is better OS recognition, this will create *.Darwin executables. This means that when you go to compile and install your Linux executables there will not be any accidental overwriting. It also creates our directory structure for us if it isn't already there. Also by adding the environment variables before compiling, we can use the $DRQUEUE_ROOT variable to set the path for make.
Configure the System PART II
Now we need to do a few system tweaks to launch our apps automatically at boot.
Now the first issue we will run across is that the environment variables we set up before only work for users logged into the machine. Not for scripts running at startup. We will need to add the following to /etc/rc.common
export DRQUEUE_ROOT=/mnt/render
export DRQUEUE_MASTER={name or address of master machine}
After that is set up we need to create the actual startup scripts. In Mac OS X the startup scripts are found in /Library/Startup
In that directory create a directory called drqueue
And in there we will create two files. First create StartupParameters.plist with the following information:
{
Description = "drqueue render manager daemon";
Provides = ("drqueue");
Requires = ("NFS");
OrderPreference = "Late";
Messages =
{
start = "Starting drqueue";
stop = "Stopping drqueue";
};
}
Next create drqueue with the following info:
#!/bin/sh
. /etc/rc.common
/mnt/render/bin/slave
NOTE: For the master machine you may want to put master rather than slave. But only if you want your cluster to work. ;)
slave is a script that not only launches the slave for us, but will relaunch it if it happens to crash or be killed.
NOTE: If your master isn't up and running, your slaves will not work.
Now try rebooting your machines and lets see if it worked. You will need to have X11 and all the other stuff installed on one machine if you want to use the queue software on the Mac.
X11 doesn't get the environment variables from Mac OS X like it probably should. As such you will want to edit your /etc/X11/xinit/xinitrc file to add those variables. Here is an example of what I did, which launches drqman automatically when X11 is launched:
export DRQUEUE_ROOT=/mnt/render
export DRQUEUE_MASTER=149.164.100.29# start some nice programs
xterm &
/mnt/render/bin/drqman.darwin &# start the window manager
exec quartz-wm
NOTE: drqman doesn't automatically update its lists. You have to click the refresh button on the bottom of the screen to see any changes.
NOTE: If you open a subwindow, like right clicking on a computer and selecting details, the original window will appear to be locked up until you close the subwindow.
Working with drqman
First make sure you have a project ready to render. Then make sure it is available on your network share and that the nodes will have permissions to deal with it. With Mac OS X it is usually easier to just set the permissions with chmod 777 to ensure that anyone can write to the directories. You can do a bit of sleuth work to set up accounts on all your machines with similar UID's and GID's to be a bit more secure. I do this on my Linux clients, but not on my Macs. Simply because my Linux clients complained about not having access, and my Mac clients never did.
When saving your project in Maya, make sure to go to Render Globals and set everything how you want it. DrQueue will parse this information from the Maya file. There are no render settings in DrQueue!
In drqman make sure you have the Jobs tab selected. Right click in the window and choose New Job.
See below for a picture sample.
There are several entries here:
Name: Put in here how you want drqman to display the job name. This only affects drqman's display
Command: Either fill out details below and click Create Script to autofill this, or if you have done a similar job before enter the path and name of the drqueue script to use.
The rest is mostly easy to figure out, so we will skip to the Kind of Job dropdown where you choose what rendering software you are using. I selected Maya.
Scene File: This is the path to the Maya scene you want rendered.
Render Directory: This is the directory that Render should put your finished frames in.
Output Image Filename: This is what you want frames to be named, do not put extensions or frame numbers here, that will automatically be added by drqueue/Render
The next few entries I do not use because as mentioned above I use chmod 777 due to Mac OS X NFS weirdness.
Do take notice of the last entry, if you think you will render a scene multiple times you may want to save your script somewhere you can find it again, as most likely changes will be done in Maya, not in drqueue. :)
Now click the Create Script to autofill the Script line, and actually create the script that DrQueue will use.
Then click on Submit. You will notice in my screenshot that if you have a 1024x768 screen, you can't actually see the submit button. However if you use a very small window decoration theme, you can mouse around the bottom edge of your screen until you find it. The other option is since you have already created your script, you can set the Kind of Job to General to shrink the window down.
Some errata here. Many times if a slave has an error drqueue will not notice and assume the frame was done. Also right clicking on a frame in the job detail window and viewing the log will only get you truncated information. I usually leave a terminal window up with PWD as /mnt/render/logs/projectname/ so that I can manually more the files.
Mental Ray for Maya isn't natively supported by drqueue right now. However after you create a script, you can hand edit it by finding the Render line and adding -r mr right after Render. Be forewarned that you only can use as many instances of Mental Ray as you have copies of Maya. Where as according to the Alias licensing you can use as many instances of the software renderer as you have machines to put it on.





Post new comment