Overview of network rendering

Network rendering is the distribution of the rendering process across more than one machine (sometimes called a render farm). For example, you can divide an animation into smaller sequences and render each sequence on a different computer. You can also control when and on which computer to render. Rendering across a network of computers is often referred to as distributed rendering.

Using Maya, there are three ways to set up network rendering.

mental ray network rendering: Satellite and standalone

mental ray network rendering allows you to distribute the rendering of each frame in your scene across multiple machines on your network. This requires mental ray rendering licenses, either mental ray for Maya Satellite or mental ray standalone.

The mental ray for Maya plug-in that is integrated in Maya always lets you render on up to 4 local CPUs. With Maya Complete, mental ray satellite rendering can take place on 2 additional remote CPUs. With Maya Unlimited, mental ray satellite rendering can take place on 8 additional remote CPUs.

The mental ray network rendering process can be invoked while working within Maya (in the Render View or batch rendering) or from the command line within Maya.

A mental ray distributed rendering can speed up all of the following tasks:

Terminology

When using mental ray for Maya and mental ray for Maya Satellite, master refers to the machine that is submitting the network render requests interactively, via batch or command line, and slave refers to an individual machine with mental ray standalone or mental ray for Maya Satellite on the network that receives and performs part of a network render and sends the information back to the client.

Any machine with mental ray standalone can be a master, a slave or both at the same time.

Note: While it is not recommended, you can mix any combination of Linux, Windows, and Mac OS X machines as masters and slaves.

What you need to set up network rendering

mental ray standalone

If you want to render Maya scenes (.mb or .ma) from within Maya or batch render with Maya, you need to install mental ray for Maya on all server machines and mental ray standalone on all slave machines.

If you want to render native mental images (.mi) scenes from the command line using the mental ray standalone renderer, you need to install mental ray on all master and slave machines.

mental ray for Maya Satellite

If you want to render Maya scenes (.mb or .ma) from within Maya or batch render with Maya, you need to install mental ray for Maya on all server machines and mental ray for Maya Satellite on all slave machines. You can use up to 2 CPUs (with Maya Complete) or 8 CPUs (with Maya Unlimited). For more information about installing mental ray for Maya Satellite, see the Installation and Licensing guide.

You can't render native mental images (.mi) scenes from the command line using the mental ray for Maya Satellite; you must use mental ray standalone.


Configuration files

To specify which network render slave machines a master uses, mental ray for Maya and mental ray standalone use different configuration files:

maya.rayhosts

mental ray for Maya and mental ray for Maya Satellite look for maya.rayhosts in the following directories:

To configure maya.rayhosts files, see Set up a master machine with mental ray standalone (method 2)

maya.rayrc

mental ray for Maya looks for (maya.)rayrc in the following directories:

maya.rayrc is installed with mental ray and additional configuration is generally not required.


Network render with mental ray for Maya

Before you begin, you must have networked workstations. See your system administrator if workstations are not networked.

You can set up masters using mental ray standalone or mental ray for Maya, using different method to specify which hosts to use as network render slaves.

Note: If you have multiple versions of mental ray standalone installed (not recommended), each must have their own TCP port number in the services file to avoid conflict.

For example:

mi_ray3_0maya4_0 7051/tcp
mi_ray3_1maya4_5 7052 and 7053/tcp
mi_ray3_2maya5_0 7054/tcp

Set up mental ray network rendering

To set up mental ray network rendering

  1. Ensure that you have networked workstations. The slave machines must be accessible on the network where the master machine is installed.
  2. Ensure that any firewall software is not interfering with the operation of your network rendering software.
  3. Ensure that all necessary services (for mental ray standalone or Satellite) are running.
  4. mental ray service should be installed and running.
  5. Set up your master machine by creating a rayhost file. Ensure that it is located in the right directory. You can set up your master machine using mental ray standalone or mental ray for Maya (Satellite).
  6. Install mental ray standalone or mental ray for Maya Satellite on each slave machine. All slave machines require mental ray for Maya Satellite or mental ray standalone.

If you have multiple versions of mental ray standalone installed (not recommended), each must have their own TCP port number in the services file to avoid conflict.

  1. Set up your slave machine(s).
  2. To verify which hosts file is being read, and which render slaves are being used, use the mentalrayrender command with a verbosity setting of 4 or higher.

Set up a master machine with mental ray for Maya or mental ray for Maya Satellite

First, create a file called maya.rayhosts.

maya.rayhosts file format

The maya.rayhosts file must contain a listing of each slave machine’s name. These slave machines must be accessible on the network where mental ray for Maya (the master machine) is installed.

For mental ray for Maya masters going to mental ray standalone slaves, you do not need to specify the port if you are using the default port (7007).

For mental ray for Maya Satellite masters, you must add the port number by typing “:<port number>” after the hostname in the maya.rayhosts file. The port number set on mental ray for Maya Satellite slave machines is 7107. For example:

pc-host1:7107
pc-host2:7107

If you are using a non-default port, you can specify it here as well:

lnx-host2:7555

You can use # to comment hosts out so they won’t be used; for example:

# pc-slave4:7107

You can use IP addresses as well as machine names.

Note
The port on which the slave listens is specified by the services file on the slave machine. It is 7007 for mental ray standalone and 7107 for mental ray for Maya Satellite (as of Autodesk Maya 2008).
The port on which the master issues requests is set in the maya.rayhosts file or defaults to 7007 (the mental ray standalone port).
The port number on the slave and the port number on the master must match for rendering to take place.

maya.rayhosts file location

Put the maya.rayhosts file in one of the following directories. (They are searched in order and the first maya.rayhosts file that is found is used.)

Windows

\Documents and Settings\<username>\My Documents\maya\2008\en_US\prefs

\Documents and Settings\<username>\My Documents\maya\2008-x64\en_US\prefs

\Users\<username>\Documents\maya\2008\en_US\prefs

\Users\<username>\Documents\maya\2008-x64\en_US\prefs

Mac OS X

Linux

~<username>/maya/2008/en_US/prefs

~<username>/maya/2008-x64/en_US/prefs

Verify which hosts file is being read

To verify which hosts file is being read

Set the verbosity level for messages from the translation process by using the MEL command as outlined in Export Verbosity. During a render, messages similar to the following are output to the Script Editor:


// Info: (mental ray) : loading startup file C:/Program Files/
Autodesk/Maya 2008/mentalray/maya.rayrc 
// mental ray for Maya: using rayhosts file C:/Documents and
Settings/user1/My Documents/maya//maya.rayhosts 

Additionally, error messages from mental ray for Maya are printed to the Maya Output Window.

Change the set of slaves used for mental ray for Maya renders

To change the set of slaves being used for mental ray for Maya renders

Close Maya, modify the appropriate maya.rayhosts file, and restart Maya.

Set up a master machine with mental ray standalone (method 1)

To set up a master machine with mental ray standalone - method 1

  1. Create the .rayhosts file. Each line of the file should specify the name of a machine to be used as a network render slave.

  2. Place the file in one of the following locations:

    • Place a file called .rayhosts in the home directory of the current machine. On Linux and Mac OS X the home directory is specified by the $HOME environment variable. On Windows machines, it is specified by %HOMEDRIVE%\%HOMEPATH% (on most machines, this is C:\).

    • Place a file called .rayhosts in the current directory, for example, from where the render will be invoked. A .rayhosts file in the current directory overrides one in the machine's home directory.

Note
To verify which hosts file (if any) is being read, and what network render slaves are being contacted, use the mentalrayrender command with a verbosity setting of 4 or higher. For example, running D:\> mentalrayrender -v 4 test.mi
could produce the output:

MAIN .0 info mental ray, version 3.4
 MAIN .0 info :
 [...]
 MAIN .0 info :
 MAIN 0.0 info : version 3.4, 4 Dec 2004
 MAIN 0.0 info : compiled on: Windows NT 4.0, x86
 MSG 0.0 info : reading hosts file C:\\.rayhosts
 MSG 0.0 info : connecting host foobar1:7054
 JOB 0.0 info : started thread 0 on foobar1 now known as host 1
 MSG 0.0 info : connecting host foobar2:7054
 JOB 0.0 info : started threads 0,1 on foobar2 now known as host
 2
 

This indicates that the hosts file C:\.rayhosts was read, and that it specified network render slaves foobar1 and foobar2 for use in this rendering. The started thread 0, 1... messages indicate that the slaves were successfully contacted.

Set up a master machine with mental ray standalone (method 2)

To set up a master machine with mental ray standalone - method 2

Use the -hosts option with the mentalrayrender command, for example:

mentalrayrender -hosts machine1 machine2 sceneFile.mi

This uses machine1 and machine2 as render slaves. This overrides any .rayhosts files on the master machine.

Slave machine setup

All slave machines require mental ray for Maya Satellite or mental ray standalone.

To set up a slave on Windows (mental ray standalone)

When you install mental ray standalone, the installation automatically sets up your machine as a server to receive network render requests. If you are encountering problems with network rendering follow the steps below.

  1. Ensure there is a rayrc file in the mental ray installation directory (C:\Program Files\Autodesk\mentalray). This file is automatically created during a default installation.

  2. Ensure that the mental ray service is installed and running.

To verify this, go to the Services window from the Administrative Tools and check to see if the Ray Server service exists and is started.

If the Ray Server service exists but is not started, go to step 5.

  1. If the Ray Server service does not exist, edit the services file located at:

    • (Windows 2000) C:\WINNT\system32\drivers\etc\services
    • (Windows XP) C:\Windows\system32\drivers\etc\services

  2. Make sure the following lines exist:

mayaray361 7007/tcp
mi-spm 7050/tcp

7007 represents the port number used for rendering requests and 7050 represents the port number used for licensing connections to SPM. Make sure the port number used for rendering requests is the same on the master machine and all slave machines (here, 7007).

  1. Open a command prompt window and type the following:

ray /install

ray.exe should automatically be in your path and is located in the bin directory of the mental ray installation.

  1. Double-click the Ray Server service in the Services Window (Administrative Tools in the Control Panel) to start it.

When the service successfully starts, the machine is ready to receive network render requests.

To set up a slave on Windows (mental ray for Maya Satellite)

When you install mental ray for Maya Satellite on a slave machine, the installation automatically sets up your machine as a server to receive network render requests. If you are encountering problems with network rendering follow the steps below.

  1. Ensure there is a rayrc file in the mental ray installation directory (C:\Program Files\Autodesk\mentalraysatellite\). This file is automatically created during a default installation.

  2. Ensure that the mental ray service is installed and running.

To verify this, go to the Services window from the Administrative Tools and check to see if the RaySat Server service exists and is started.

If the RaySat Server service exists but is not started, go to step 5.

  1. If the RaySat Server service does not exist, edit the services file located at:

    • (Windows 2000) C:\WINNT\system32\drivers\etc\services
    • (Windows XP) C:\Windows\system32\drivers\etc\services

  2. Make sure the following line exists:

mi-raysat 7107/tcp

7107 represents the port number. Make sure the port number is the same on the master machine and all slave machines.

  1. Open a command prompt window and type the following:

raysat /install

raysat.exe should automatically be in your path and is located in the bin directory of the mental ray installation.

  1. Double-click the RaySat Server service in the Services Window (Administrative Tools in the Control Panel) to start it.

When the service successfully starts, the machine is ready to receive network render requests.

To set up a slave on Linux (mental ray standalone)

The mental ray standalone installer does not set up your machine as a slave automatically. You need to follow the steps below with administrative privileges on all Linux machines.

  1. In a shell type:

/usr/autodesk/mi361/bin/netsetup -s

You are prompted for the name of the SPM license server. It defaults to the local host.

  1. Type in the SPM license server name if it is other than the default local host and then press Enter.

The machine is now ready to receive network render requests.

To set up a slave on Mac OS X (mental ray standalone)

The mental ray standalone installer does not set up your machine as a slave automatically. You need to follow the steps below on all Mac OS X machines with administrative privileges. To do so, you may need to edit the rayd file in the mental ray 3.6.1 bin directory. Fill in the name of your SPM License server and uncomment the setenv SPM_HOST line. This file may not be modifiable unless you have administrative privileges.

  1. Add the install location of mental ray to your path:

(Mac OS X) /Applications/Autodesk/mentalray3.6.1/bin

  1. Create a new environment variable called SPM_HOST to identify your license server machine.

The machine is now ready to receive network render requests.

Submit a job to render over the network

Once you are set up, the process of rendering over the network is fully automatic so that every render you invoke from a client machine is automatically distributed over the network.

To network render a Maya scene within Maya on a master machine

Ensure that the maya.rayhosts file has the name of all mental ray network rendering slaves you wish to use (see Set up a master machine with mental ray standalone (method 1)).

  1. Start Maya, open a scene and select Render > Render using > mental ray.

  2. Select Render > Render Current Frame.

  3. To verify that the slave machines are being used select Render > Render Current Frame > [] or Render > Batch Render and select Progress Messages from the Verbosity Level drop-down list.

You should see messages in the console window (or in the mental ray log file for batch render) telling you which slave machines were connected and which machine is being used to render particular tiles.

To network render a Maya scene with Maya from the command line on a master machine

Ensure that the maya.rayhosts file has the name of all mental ray network rendering slaves you wish to use (see Set up a master machine with mental ray standalone (method 1)).

  1. From a command prompt window, change to the directory where your Maya scene resides.

  2. Type the following:

Render -r mr sceneName.mb

To network render with a mental images (.mi) scene with mental ray standalone on a master machine

This works with mental ray standalone only; this operation is not supported for mental ray for Maya Satellite.

Ensure that the maya.rayhosts file has the name of all mental ray network rendering slaves you wish to use (see Set up a master machine with mental ray standalone (method 1)).

  1. From a command prompt window, change to the directory where your .mi file resides.

  2. Type the following:

mentalrayrender myFile.mi

  1. To get progress messages to show how the slave machines are being used, type the following command:

mentalrayrender -verbose 5 myFile.mi

Troubleshoot Network rendering with mental ray for Maya

The instructions below refer to mental ray for Maya 8.5 and mental ray standalone 3.6. For information on previous versions, refer to the documentation for that version of Maya or mental ray.

Why can't I install the rayserver service or edit the services file?

Ensure you have administrator (or root) privileges on the machine.

I have everything correctly set up, but I still can't network render.

Here are various possibilities to check.

Port number

One possibility is that the network port number you are using is already being used by another service. Ensure that there is no other entry in the services file that is using port 7007 (mental ray standalone) or port 7107 (mental ray for Maya Satellite). If that port number is already taken, you need to pick a new available port number and use that same number for all master and slave machines that are to work together.

You may need to change the port number.

To do so on Linux and WIndows, edit the port services file located at:

In the services file, ensure that the following line exists:

where 7107 or 7007 is the port number. Make sure the port number is the same on the master machine and all slave machines.

To do so on Mac OS X:

Licensing of mental ray standalone

(mental ray standalone) You may need to edit a file called the rayd file located in the mental ray 3.6.1 installation bin directory. Fill in the name of your SPM License server and uncomment the setenv SPM_HOST line.

Restarting the service (Windows)

To restart the server on Windows, go to mental ray bin directory and type the following:

raysat2008server.exe /stop
raysat2008server.exe /start

rayserver.exe /stop
rayserver.exe /start

inetd configuration

(Linux with versions of Redhat prior to 7.2) You may need to edit the inetd.conf file located at /usr/etc/inetd.conf and ensure that the following line exists:

mi-ray stream tcp nowait nobody /usr/local/mi35/bin/rayd rayd

mi-raysat stream tcp nowait nobody /usr/local/mi35/bin/raysatd raysatd

You may need to restart the inetd service by typing the following:

% killall -v -HUP inetd

(Linux only with version of Redhat 7.2 and 7.3) You may need to edit the services in the xinetd.d directory. See "To check your xinetd configuration on Linux" below.

To check your xinetd configuration on Linux

  1. In a Linux shell type:

ls /etc/xinetd.d

There should be a file named mayaray (mental ray standalone) or mi-raysat (mental ray for Maya Satellite).

  1. If there is no such file, become root, create the mayaray or mi-raysat file using a text editor and enter the following text:

mental ray:

# description: mental ray for maya network rendering service mayaray

{
flags = REUSE
socket_type = stream
user = nobody
wait = no
server = /usr/local/mi35/bin/rayd
log_on_failure += USERID
}

mental ray for Maya Satellite:

# description: mental ray for maya network rendering service mi-raysat

{
flags = REUSE
socket_type = stream
user = nobody
wait = no
server = /usr/local/mi35/bin/raysatd
log_on_failure += USERID
}

  1. Save the file.

  2. In order for xinetd to find the newly configured service, you need to restart it or send it a signal.

/etc/init.d/xinetd restart

ps -e | grep -v grep | grep xinetd

You should see a line similar to this:

980 ? 00:00:02 xinetd

The first number is the process id of xinetd.

If the system is RedHat 7.2, xinetd re-reads its configuration on receipt of the USR2 signal. For RedHat 7.3 it re-reads its configuration on receipt of the HUP signal. So for a RedHat 7.3 system where xinetd's process id is 980 you would execute:

kill -HUP 980

xinetd should have found the new service and you should be able to send it render requests from another node on the network.

How do I run multiple versions of mental ray on one machine?

If you want to run different versions of mental ray standalone in one machine, make sure that each version has its own mi-ray* entry in the services file.

For example, if you have mental ray 3.3 and mental ray 3.4 in one machine, and you can change the mi-ray entry for mental ray 3.3 (or 3.4).

Create your own mi-ray variable for mental ray 3.3 in the services file.

The services file might look like this

mi-ray 7003/tcp # used for mental ray 3.4
mi-raysat 7103/tcp # used for mental ray satellite 3.4
mi-ray_33 7155/tcp # used for mental ray 3.3

The server also needs to be updated.
To rename the server file (Windows)

  1. Go to mental ray 3.3 bin directory.
  2. Stop the service (rayserver.exe /stop).
  3. Rename rayserver.exe to ray_33server.exe.
  4. Restart the server (ray_33server.exe /start)

To rename the server file (Linux)

  1. Stop xinet.
  2. Rename rayd to ray_33d.
  3. Create a new file called mi-ray33 in the xinetd.d directory. This file must contain setup information. For example:

{
flags = REUSE
socket_type = stream
user = nobody
wait = no
server = /usr/local/mi33/bin/ray_33d
log_on_failure += USERID
}

  1. Restart the service.