Render is a client application. It runs on a remote host and communicates with server. Server sends tasks to render to run.

Launch Methods

  • MS Windows script


  • UNIX script


  • Linux daemon when packages are installed

    sudo systemctl start afrender

  • Setup CGRU environment and launch a command:

    cd cgru
    source ./

To register a render already in [nimby|NIMBY] state use command:

afrender [nimby|NIMBY]



Each render has an unique name. If new render comes to server with the name which already exists, server will not register it. Users and jobs hosts masks are based on render names and Regular Expressions (they are Perl-like). To launch another render on the same host use AF_HOSTNAME environment variable to override render name.


IP address with family (IPv4 or IPv6).


Network interfaces information (name, mac and ips).


Time the application was launched.


Time the render was registered on server.


Last time the render has update its resources usage.


Time the last any Wake-On-LAN operation was performed.


Running tasks number and some its attributes (user, job, etc.).


Capacity used by running tasks.

Editable Parameters


Who launched a render. Can be changed only by administrators. Note that process do not change uid. This value for afanasy only.


Render with greater priority get task first.


You can override host farm setup capacity.


You can override host farm setup maximum running tasks.


Services that render can run. If empty it it configured by pool.


You can disable some services.


Annotate render GUI item.


Online ONL Is online.
Offline OFF Is offline.
nimby Nby Is taken by his user. Only render user can render on it.
NIMBY NBY Is taken by his user and he don’t want to render on it.
Busy RUN Executing one or more tasks.
Dirty DRT Capacity changed or some service disabled.
WOLFalling WFL Is falling a sleep. It was asked to sleep, but still online.
WOLSleeping WSL Is sleeping.
WOLWaking WWK Is waking up. It was asked to wake up but still is not online.
Paused PAU Is paused, like super-Nimby, never will be free automatically.
Sick SIC Is seek, produced errors only from different users.



CPUs x Cores number.


Fist Processor frequency.


Load average.


User usage percentage.


User ‘nice’ usage percentage (low priority processes).


System usage percentage.


Idle percentage (CPU free).


Waiting for I/O complete percentage.


Interrupts servicing percentage.


Soft interrupts servicing percentage.


Total amount of memory in megabytes.


Free memory in megabytes.


Cached memory in megabytes.


Buffered memory in megabytes.


Total swap space in megabytes.


Used swap in megabytes.


Total disk space in gigabytes.


Available free disk space in gigabytes (in root - ‘/’).


Disk reading in kilobytes per second.


Disk writing in kilobytes per second.


Percentage of system ticks spend for the disk IO.


Network receiving traffic in kilobytes per second.


Network sending traffic in kilobytes per second.


The official product name of the GPU. It will be empty, if GPU is not detected. You can check it length for zero to find out GPU exists.

  • NVIDIA cards are processed via nvidia-smi command line utility. So nvidia-smi must be in PATH.

    • Linux: Any NVIDIA driver installation from some repository or official site adds this binary to PATH, you should do nothing to get it work.

    • Windows: NVIDIA driver installation should add nvidia-smi.exe to C:\Program Files\NVIDIA Corporation\NVSMI folder. The folder can differ on some custom installation. You should add that folder to PATH. You can do this via system environment settings. Better not to modify the system environment permanently, but to do it by demand via scripting. You can create a setup_gpu.cmd script in CGRU root folder with a following content:

      set "PATH=C:\Program Files\NVIDIA Corporation\NVSMI;%PATH%"
    • macOS: Was not checked. Like on other platforms nvidia-smi should be in PATH.

For now only NVIDIA cards are supported.


GPU utilization of core GPU.


GPU temperature of core GPU.


GPU total memory. You can check for zero, to find out that GPU was detected.


GPU used memory.

Paths Map

CGRU has an ability to map paths. Every client can have own paths map file to translate paths to server and from server.

Paths map is described in config files by pathsmap object. It is an arrays of ["CLIENT","SERVER"] paths pairs:


When job constructs (on the client side) all commands and working directories are translated from client to server. When task starts (on the client side) all commands and working directories are translated from server to client. Server does know nothing about paths map.

MS Windows platform issues

  • You can write only / slashes in a config. It will try both slashes directions. Some applications allows client to use and \ and / slashes, so pattern will be matched in any case.
  • When client searches a pattern it converts paths in lower case. So no matter how client wrote a path //server/projects/, //SERVER/PROJECTS/, //SERVER/projects/ or //server/PROJECTS/. It will work any way.
  • Module (Python Class) can works in UnixSeparators mode. During translation from server to client it uses / slashes for client paths. For example NUKE uses only / slashes on any platform.

A part of a real working config.json with map example:

            ["P:/",             "/ps/prj/"],
            ["//box/project/",  "/ps/prj/"],
            ["Q:/",             "/ps/prj2/"],
            ["//box2/project/", "/ps/prj2/"],
            ["//sun/libs/",     "/ps/lib/"],
            ["//sun/vault/",    "/ps/vault/"],
            ["T:/",             "/ps/etc/"],
            ["c:/ps/",          "/ps/"],
            ["c:/temp/",        "/tmp/"]


Service is a Python class that will be instanced by render on each incoming task.

Python classes stored in


and based from


The class stands for:

  • Define default service parser, that you can override.
  • Instance needed parser and pass task output data it.
  • Method to fill in numeric block pattern with frames.
  • Method to transfer commands and paths from server to client (different OS-es can have different paths).
  • Check rendered files.
  • Generate thumbnails.
  • Check exit status for tasks that can return non zero exit status on success.
  • Method to insert in task command variable capacity coefficient.
  • Method to fill in multi-host task command with captured hosts.

You can write custom service class based on to override any functions for customization.


Parser read task output and calculate running percentage and frame (for multiply frames per render).

Python classes stored in


and based from


Parser class stands for:

  • Parse task progress frame and percent of a current frame and a total(all frames) percentage.
  • Parse output for rendered file to make thumbnails, that render will send to server.
  • Stop task on bad output.
  • Produce a warning just for user notification.
  • Mark success finish as error on bad output.
  • Append some string to task log for some useful info.
  • Make some job report what will be shown in GUI job item as something important.
  • Parse some resources, for example triangles count or pear memory usage.

To write a custom parser you should inherit base parser class and override main function:


def do(self, i_args):

Input arguments are passed via dictionary:

  • i_args[‘mode’] (str)

    • RUN: Task is running.
    • EXIT_CODE:STOP_TIME: Task is not running, process exit status and stop time if task was asked to stop (zero if was not).
  • i_args[‘pid’] (int)

    Task process identifier.

  • i_args[‘data’] (str)

    Current portion of a task process output.

  • i_args[‘resources’] (str)

    Host resources JSON. Designed to query/modify for self.resources construction.

This method can return nothing or a string. In string case this string will be stored instead of incoming data. You can use it to produce some message, by appending incoming data with your information. Or you can cut some useless information.

All parser notifications and actions are transferred by setting class members:


Task execution percentage.


Task execution frame. May set for multiply frame tasks to show current frame in GUI.


Task execution current frame percentage.


Whether the task progress has changed. By default is True when any output with a not zero length was produced.


Some warning. To notify user only.


Error. Render will try to terminate a task and later kill if task ignored termination.


Error. Task will finish with an error. In this case render will not try to kill it, sometimes you don’t need kill and want to wait finish. You can use at the end of task execution, at final result check.


Success. Task will finish with a success. Parser can consider that task is already done and should not to continue. Render will terminate(kill) task process and send “done” status to server(not an “error”).


Some string to inform user about task running stage. For example: Nuke current rendering view when stereo, Movie Maker convert or encode stage.


Any custom resources string. For example: triangles:155000000.


Some string to append to the task server log. For example when server or parser noticed some error, you can specify it here.

Some info string for an entire job. GUIs will show it a job item(not task). Some most important info should be here. Most suitable for a job with one or several big tasks. For example you can put big file on FTP and show speed here.


Thumbnails are small previews of a task rendered files. They can be generated by render and shown by GUI.

If task (block) has files parameter or parser finds images thumbnail will be generated. Thumbnails are generated by afrender after task process finish. Python service doPost function returns commands for it. Thumbnail files binary data is send by afrender to afserver along with task output. Server stores all files that afrender sends on task finis. You can get tasks thumbnails from afserver by HTTP GET method.

If parser found some image during output parsing it can call a special function:

appendFile(i_file, i_onthefly)

  • i_file

    Path to the image file to append.

  • i_onthefly

    • False Thumbnail will be generated after task process finish. This is a most common method.
    • True Thumbnail will be generated just after this function call. Task probably will be still running in this case. This can be useful for a long time task that process many images. Good example is a movie encoding or dailies creation.


    "af_thumbnail_cmd":"convert -identify \"%(image)s\" -thumbnail \"100x100^\" -gravity center -extent 100x100 \"%(thumbnail)s\"",

Custom Resources

You can write custom resources meter(s) on Python. Render instances a class and runs update method periodically (each time the Render updates). You can inherit base resbase class and set its properties.

There are some custom resources meters in Afanasy:


Just an example. It increments a value from 0 to 100, changes label text, plotter and label size, graph and back color.


Shows parsed output of Linux iostat command. Graph value is utilization percentage (or %busy).


Shows parsed output of Linux nvidia-smi command. It shows NVIDIA driver version, product name, total and used memory, temperature, running processes.

../_images/custom_resouces_nvidia_plot.png ../_images/custom_resouces_nvidia_message.png

Python classes stored in


and based from


Information is passed within class properties:



The resource value to watch.


Maximum resource value for graph scale.


Preferred plotter widget height for GUI.


Preferred plotter widget width for GUI.




Graph color.


Label text.


Label text font size.




Label text font color.




Plotter background color.


Widget tooltip.


Resource meter validness. Should be set to True in constructor, or update function will not be called. Set False if resource meter initialization failed.

Windows Must Die

Farm based on MS Windows OS can produce some ‘bad’ windows. If process crashed, Windows OS can launch a window with apologizes, and ‘hung’ the process until someone closes this window.

Afanasy Render client periodically finds and closes windows listed in af_render_windowsmustdie configuration parameter.

It closes them by sending WM_CLOSE signal.

af_render_windowsmustdie parameter example:

        "ImageMagick Studio library and utility programs",
        "Microsoft Visual C++ Runtime Library",
        "QuickTimeHelper-32.exe - Application Error",
        "Visual Studio Just-In-Time Debugger"