Introducing RealityServer

RealityServer is a platform for integrating photorealistic 3D rendering into your application. It is based on a web services methodology and can be used both for rendering automation and fully interactive rendering. In this introduction we will cover the core concepts of RealityServer development and what you need to understand in order to get started.

Read More

Continue Readingred arrow

New Client Library for RealityServer

The legacy JavaScript client library shipped with RealityServer was designed in 2010, back when JavaScript in the browser was mostly unusable without some sort of framework like jQuery, WebSockets were still under design and JavaScript on the server was virtually unheard of. A lot has changed since then, JavaScript has significantly evolved and is supported by a huge module ecosystem, WebSockets are under the hood of everything and Node.js is becoming ubiquitous. The RealityServer client library however has barely changed. Until now.

Read More

Continue Readingred arrow

Installing RealityServer

So you’ve got your RealityServer release email and downloaded everything but how do you install it? This article will take you through the steps in setting up RealityServer on Windows or Linux as well and also provide an overview of the RealityServer directory structure. We’ll also cover how to setup your licensing.

Read More

Continue Readingred arrow

Adding Objects with Server-side V8

Add Objects

Continuing our series of articles on using the server-side V8 API we will now add some objects, loaded from a model file to the scene that we setup and lit in our previous articles. This one is going to be very simple but for bonus points we’ll add multiple copies of the object in different locations.

Read More

Continue Readingred arrow

Environment Lighting with Server-Side V8

In a previous post we covered creating an empty scene by writing a server-side V8 command in JavaScript. Now let’s turn on some light by adding an environment lighting setup to our empty scene. We’ll create two new commands, one to add lighting based on a spherical HDRI image and another using the built in physically based sun and sky system.

Read More

Continue Readingred arrow

RTX Performance Explained

RTX

NVIDIA RTX technology was announced late last year and has gathered a lot of coverage in the press. Many software vendors have been scrambling to implement support for it since then and there has been a lot of speculation about what is possible with RTX. Now that Iray RTX is finally about to be part of RealityServer we can talk about what RTX means for our customers and where it will be most beneficial for you.

Read More

Continue Readingred arrow

What’s New in RealityServer 5.2 Update 326

RealityServer

Our next RealityServer update is here. This is an incremental release with quite a few requested fixes and enhancements but also contains a few great new features for heavy users of MDL materials. This will be the last RealityServer 5.2 release as we will shortly be releasing RealityServer 5.3 with NVIDIA RTX support so watch out for that one. In the meantime, let’s checkout whats new in this version.

Read More

Continue Readingred arrow

RealityServer Helps Timex Visualise Design Choices

The Timex Group has joined the growing list of household names who use RealityServer to create the imagery that pushes customers to choose their products over a competitors. The retail sector demands the highest quality imagery in order to replace traditional photography with photorealistic 3D rendering. Not just quality, but speed and scale in everything from real-time, interactive and offline rendering.

Read More

Continue Readingred arrow

What’s New in RealityServer 5.2 Update 259

Our first update for RealityServer 5.2 is here. It includes an Iray version bump and some nice convenience features. The most significant feature however is support for queuing renders with Iray Server. This will be of interest to those building internal rendering automation tools with RealityServer.

Read More

Continue Readingred arrow

What’s New in RealityServer 5.2

RealityServer 5.2 is here and adds some great functionality. Hugely expanded glTF 2.0 importer support, wireframe rendering, lightmap rendering, section plane capping, MDL 1.4 support, UDIM support and many more features have been added along with many fixes and smaller enhancements based on extensive customer feedback. In this post we will run through some of the most interesting functionality and how it can help you build your applications.

Read More

Continue Readingred arrow

Creating an Empty Scene with Server-side V8

We’ve covered server-side V8 commands before but in this post we will go into a little more detail and use some of the helper classes that are provided with RealityServer to make common tasks easier. Quite often you want to kick off an application by creating a valid, empty scene ready for adding your content. Actually, it’s something we we need to do in a lot of our posts here so to avoid repeating it each time, lets make a V8 command to do it for us.

Read More

Continue Readingred arrow

Managing User Sessions with UAC in RealityServer

In this article we’ll take a quick look at how to use the UAC system in RealityServer to effectively manage user sessions and clean up server memory when users go away. There won’t be a lot of pretty pictures (well there is one if you make it to the end) but for those of you getting your hands dirty with RealityServer in production, you’ll get some valuable pointers to help keep your server from filling up with unused data.

Read More

Continue Readingred arrow

Lighting Configurators with Compositing

In our last post we explored using the RealityServer compositing system to produce imagery for product configurators at scale. Check out that article first if you haven’t already as it contains a great introduction to how the system works. In this follow up post we will explore the possibilities of using the same system to modify the lighting in a scene without having to re-render, allowing us to build a lighting configurator.

Read More

Continue Readingred arrow

Configurators at Scale With Compositing

RealityServer 5.1 introduced a new way to generate images of configurations of your scenes without the need to re-render them from scratch. We call this Compositing even though it’s actually very different to traditional compositing techniques. In this article we will dive into the detail of how to use the new system to render without rendering and speed up your configurator.

Read More

Continue Readingred arrow

What’s New in RealityServer 5.1 Update 251

RealityServer 5.1 Update 251 has just been released. It’s mainly a bugfix release but adds a few nice extras that several customers have asked about, including a PBR MDL material, Iray Viewer loader and commands for manipulating measured BSDF data.

Read More

Continue Readingred arrow

What’s New in RealityServer 5.1 Update 227

RealityServer 5.1 Update 227 has just been released and it has some great new features. A new Iray version with improvements to the AI Denoiser, an easy to use compositing system and a bunch of new convenience commands. This post gives an overview of the new functionality, however the compositing features are so significant that we are currently writing a dedicated article for that feature which will be out soon.

Read More

Continue Readingred arrow

Basic Canvas Operations in V8

RealityServer 5.1 introduced new functionality for working with canvases in V8. In this post I’m going to show you how to do some basic things like resizing and accessing individual canvas pixels. We’ll build a fun little command to render a scene and process the result into a piece of interactive ASCII art. Of course, this doesn’t have much practical utility but it’s a great way to learn about this new feature!

Read More

Continue Readingred arrow

RealityServer on AWS

A lot of new customers ask us where they can run RealityServer since they don’t have their own server or workstation with NVIDIA GPU hardware available. Starting up RealityServer on Nimbix is covered in another article where everything is pre-configured for you, on AWS however you need to do a bit more setup yourself. We are assuming here that you are already familiar with Amazon Web Services and starting instances on Amazon EC2, along with basic concepts like security groups. We won’t cover the basics of how to start an instance here however there is lots of good information about that online, including this guide from Amazon. So, let’s get started.

Instance Selection and Starting

Before you dive in to launch some instances on AWS to run RealityServer, you should first think about where you want to run your server (which region) as well as which instance type you want to use. While RealityServer can work on pure CPU instances to access all features and get the best performance, you should really use AWS GPU instances. There are currently three types of GPU instances available on AWS that support RealityServer well:

  • p2 – NVIDIA Tesla K80 (p2.xlarge, p2.8xlarge, p2.16xlarge)
  • g3 – NVIDIA Tesla M60 (g3.4xlarge, g3.8xlarge, g3.16xlarge)
  • p3 – NVIDIA Tesla V100 (p3.2xlarge, p3.8xlarge, p3.16xlarge)

All of the current generation instance types use Tesla GPU hardware and offer various level of performance and memory capacity. The p3 instances use the Tesla V100 GPU and at the time of writing was the fastest available. Of course Amazon offerings might change in the future. You can see our benchmark data on how these instance types perform. When selecting which region to start your node in consider how far it is likely to be from you; closer servers mean lower latency. We do not recommend previous generation instance types for RealityServer and they may not be supported in some cases.

When you start your instances, ensure you open TCP ports 8080, 8081 and 1935 in your security group, in addition to the standard SSH port. We generally use the standard Amazon Linux 2 HVM AMI (usually first in the list which launching from the console); for GPU instances you must use HVM AMIs. These instructions assume you are using the standard Amazon Linux 2 AMI; other distributions can also be used with RealityServer, but you will need to sort out the installation process yourself. In general since Amazon Linux is Red Hat Enterprise based, CentOS and RHEL should behave in a similar way.

Dependencies and Configuration

Once you have launched your instance and are ready to connect you can ssh into your instance and start setting up the GPU drivers and RealityServer. First let’s install some dependencies we will need:

sudo yum update -y
sudo yum install -y gcc make wget libX11 libGLU libSM
sudo yum install -y kernel-devel-$(uname -r) kernel-headers-$(uname -r)

If the yum update command installs a new kernel version you should reboot prior to installing the kernel headers and development package. In order to obtain your licenses for RealityServer you need to set the SPM_HOST environment variable. You can do this by hand each time you login, but to keep it persistent you can do the following:

sudo sh -c 'echo setenv SPM_HOST licensing.migenius.com > /etc/profile.d/spm.csh'
sudo sh -c 'echo export SPM_HOST=licensing.migenius.com > /etc/profile.d/spm.sh'

One additional step is required to obtain your licenses; you need to tell SPM which port to connect to our servers on (we definitely realise this licensing process is a bit complex and are working on ways to simplify this in the future). Add the licensing port to your /etc/services file as follows (replacing [port] with the licensing port provided by migenius):

sudo sh -c 'echo -e "mi-spm\t[port]/tcp\t# migenius SPM License Server" >> /etc/services'

Make sure you use the double redirections, you don’t want to overwrite your /etc/services file! Next let’s get the NVIDIA drivers installed. You can check for the latest Linux version here. Here we used the versions that worked well at the time this was written (on the p2 instance types), substitute as needed:

wget http://us.download.nvidia.com/XFree86/Linux-x86_64/430.50/NVIDIA-Linux-x86_64-430.50.run
sudo sh ./NVIDIA-Linux-x86_64-430.50.run -a

Follow all of the prompts, it’s pretty self-explanatory. When running RealityServer you may get warnings about ECC being enabled, unfortunately AWS do not offer the ability to disable this GPU feature, so you may get a slight performance hit and you will lose 12.5% of your GPU memory capacity. This is just due to the way AWS works and sadly not something we can fix with RealityServer. Future releases of RealityServer may require more recent CUDA versions and therefore ensure the driver you install supported the minimum level of CUDA needed.

Installing RealityServer

With the GPU drivers installed (if you want to confirm they detect the GPU just run nvidia-smi and check out the output) you can now download and install RealityServer:

sudo mkdir -p /usr/local/migenius
cd /usr/local/migenius
sudo wget http://download.migenius.com/releases/RealityServer/rsws-53-2593.88.tgz
sudo tar zxvf rsws-53-2593.88.tgz
sudo chown -R ec2-user:ec2-user rsws-53-2593.88
sudo ln -s rsws-53-2593.88 rsws

Obviously replace the RealityServer link with that to the release you want to use. The last line above creates a symlink to the version you have installed, we will use this later when setting up services so you can easily switch versions later if you need to.

Test Run RealityServer

If all goes well you can now do a test run and get RealityServer going. We recommend doing this before trying to install RealityServer as a service since it will be more difficult to diagnose issues at that stage. Here are the commands to test run RealityServer, assuming you are still in the directory from above:

cd rsws
. /etc/profile.d/spm.sh
./realityserver

You should see a lot of log output. You can then connect to RealityServer and explore the examples and documentation by going to the following address (where ec2-ip is the public IP of your AWS instance):

http://ec2-ip:8080/

If you want to start RealityServer so that it keeps running after you log out you can use nohup for that:

nohup ./realityserver_ws > rs.log 2>&1 &

Here we are sending the log output to rs.log so you won’t see anything on screen. To see the log output you can just tail the file:

tail -f rs.log

When you’re done with your instance and don’t want to leave it running, you can just power it off:

sudo poweroff

On AWS this puts the instance into a stopped state and you can restart it at anytime. You don’t get charged for the instance while it’s stopped (only for the storage associated with it), so this can be a handy way to keep a RealityServer development node ready to run. Now, that things are working correctly we can install RealityServer as a system service so that it runs on startup and restarts if it fails for any reason.

Installing as a System Service

The raging debate over init.d vs systemd is now pretty much in the past so we can now recommend using systemd to manage your RealityServer service. This isn’t a complete guide to systemd but we’ll run through the basics of how to use systemd to control RealityServer. First you will need to create the service file in /etc/systemd/system/realityserver.service. We can do this in one command with:

sudo tee -a /etc/systemd/system/realityserver.service > /dev/null << EOL
[Unit]
Description=RealityServer
After=network.target remote-fs.target nss-lookup.target
 
[Service]
ExecStart=/usr/local/migenius/rsws/linux-x86-64/bin/realityserver --config_file /usr/local/migenius/rsws/realityserver.conf $RS_ARGUMENTS
# Required on some systems
WorkingDirectory=/usr/local/migenius/rsws
Restart=always
# Restart service after 5 seconds RealityServer crashes
RestartSec=5
# Output to syslog
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=realityserver
User=ec2-user
Group=ec2-user
Environment=LD_LIBRARY_PATH=/usr/local/migenius/rsws/linux-x86-64/lib
 
[Install]
WantedBy=multi-user.target
EOL

This is a single multi-line command you can cut and paste the entire command at once. Next we need to make the configuration directory for our service:

sudo mkdir /etc/systemd/system/realityserver.service.d

This directory holds the override.conf file which allows us to setup environment variables that are used when starting RealityServer. We can add this with another multi-line command:

sudo tee -a /etc/systemd/system/realityserver.service.d/override.conf > /dev/null << EOL
[Service]
Environment=SPM_HOST=licensing.migenius.com
Environment="RS_ARGUMENTS='--network off' '-o iray_render_mode=cuda_dynamic'"
Environment=MDL_SYSTEM_PATH=/opt/nvidia/mdl
EOL

The last line of the configuration adds the MDL system path environment variable which you will need if you have vMaterials or the MDL Material Exchange libraries installed. If you don’t use either of these you can omit this line. You’ll also want to uncomment the lines in your realityserver.conf file that reference the MDL_SYSTEM_PATH environment variable.

At this point there is a service setup and you should be able to check this with the following command:

systemctl status realityserver

You should see something like this:

● realityserver.service - RealityServer
   Loaded: loaded (/etc/systemd/system/realityserver.service; disabled; vendor preset: disabled)
  Drop-In: /etc/systemd/system/realityserver.service.d
           └─override.conf
   Active: inactive (dead)

So it’s there and everything has been found but it hasn’t yet been enabled and it isn’t running. Before we fix that we’ll setup one more thing, logging. The service is currently setup to log all of it’s output to syslog which is going to make it difficult to separate RealityServer messages from other system messages. To fix that we need to do a little rsyslogd configuration. We’ll use the following multi-line command to set this up:

sudo tee -a /etc/rsyslog.d/realityserver.conf > /dev/null << EOL
\$FileCreateMode 0644
\$template RealityServerFormat,"%rawmsg%\n"
\$template RealityServerFile,"/var/log/realityserver.log"
if \$programname == 'realityserver' then {
        -?RealityServerFile;RealityServerFormat
        ~
}
\$FileCreateMode 0600
EOL

This will change the configuration so that all output is now logged to /var/log/realityserver.log. If you want to allow reading of the log files as the ec2-user then you will also need to modify /etc/rsyslog.conf by adding the following lines at the top:

# Reset umask so FileCreateMode can be used instead
$umask 0000
 
# By default logs should only be readable by process owner
$FileCreateMode 0600

We now need to force rsyslogd to reload our configuration before we start RealityServer:

sudo systemctl restart rsyslog

Finally we are ready to enable the service so that it starts up on system boot.

sudo systemctl enable realityserver

Which should output something similar to this:

Created symlink from /etc/systemd/system/multi-user.target.wants/realityserver.service to /etc/systemd/system/realityserver.service.

Since we haven’t rebooted the service is not yet running so we can now start it up with:

sudo systemctl start realityserver

If you tail the contents of /var/log/realityserver.log you should see the last couple of lines look something like this:

19/09/06 09:35:35   1.0   V8     main info : Started.
19/09/06 09:35:35   1.0   PLUGIN main info : Started RealityServer(R) Web Services.

Assuming you can connect to RealityServer in your browser as you did in the earlier steps then everything should be working now. You can test that the service runs on startup by rebooting the machine. Of course, don’t forget to shutdown the instance if you are not using it. You now have an instance which will automatically run RealityServer on startup using the standard systemd process. If you create an AMI of this instance you can then start more instances with the same configuration.

NVIDIA Persistence Daemon

We’ve seen some issues recently were during startup the NVIDIA driver was not initialised and loaded. This could cause issues with RealityServer startup. To ensure the driver is always loaded we recommend installing and enabling the NVIDIA Persistence Daemon. This is installed by the driver however not as a system service. You can add it as a system service in a similar way to RealityServer with the following commands.

sudo tee -a /etc/systemd/system/nvidia-persistenced.service > /dev/null << EOL
[Unit]
Description=NVIDIA Persistence Daemon
Wants=syslog.target

[Service]
Type=forking
ExecStart=/usr/bin/nvidia-persistenced --user ec2-user
ExecStopPost=/bin/rm -rf /var/run/nvidia-persistenced

[Install]
WantedBy=multi-user.target
EOL
sudo systemctl enable nvidia-persistenced
sudo systemctl start nvidia-persistenced

Taking it Further

There is a lot we haven’t covered here and, in a production system, load balancing, clustering and many more topics. We don’t cover this here however don’t hesitate to contact us if you want more details on how to do these things. We also haven’t covered creating an AMI from your work here so you can start more nodes. This is essentially no different to any other Amazon instance type, so there is a lot of good information out there on that.

One note, if you want to try clustering multiple nodes on AWS, you will need to use TCP based clustering (without the UDP discovery option) because AWS does not support UDP multicast on its network.

Happy Rendering!

Continue Readingred arrow

What’s New in RealityServer 4.4 Update 93

We recently released RealityServer 4.4 build 1527.93. This update included Iray 2016.2 and some interesting new features. While still an incremental update, the big item many of our customers have been asking for is finally here, NVIDIA Pascal architecture support. So your Tesla P100, Quadro P6000, Quadro P5000, GeForce GTX TITAN X, GeForce GTX 1080, 1070 and other Pascal cards will now work with RealityServer. Keep reading for some more details of the new features in update 93 of RealityServer.

Read More

Continue Readingred arrow

RealityServer on Nimbix JARVICE 2.0

The number of cloud service providers offering NVIDIA GPU resources is increasing and in today’s article we will show you how to get started using RealityServer with Nimbix. migenius has deployed several of its customer projects on the Nimbix platform and it offers some unique advantages such as containerised environments (instead of virtualisation), fast start-up times and usage charged by the minute instead of by the hour. On Nimbix migenius has set-up a pre-configured RealityServer environment for you, keep reading to learn how to sign up for Nimbix services and get RealityServer up and running. Read More

Continue Readingred arrow

3D Transformations – Part 2 SRT

In this, the second part of our article on transformations I will introduce SRT (Scaling, Rotation, Translation) transformations. Unlike the previous article, this one will have a lot less maths and shows you a simpler way to work with transformations in RealityServer. Additionally the method allows for automatic interpolation of transformations over time in a smooth way which is great for creating animations. Once things are moving you can also introduce motion blur for more realistic results. Read on to discover the ease of SRT transformations.

Read More

Continue Readingred arrow

3D Transformations – Part 1 Matrices

Transformations are fundamental to working with 3D scenes and something that can be frequently confusing to those that haven’t worked in 3D before. In this, the first of two articles I will show you how to encode 3D transformations as a single 4×4 matrix which you can then pass into the appropriate RealityServer command to position, orient and scale objects in your scene. In a second part I will dive into a newer method of specifying transformations in RealityServer called SRT transformations which also allows for the easy animation of objects.

Read More

Continue Readingred arrow

Creating Lighting Programmatically

In this article I am going to show you how add light sources to your RealityServer scene using the Web-services API. You will learn how to add several different types of lights, including a photometric light using an IES data file, an area light, a spot light and daylight. This will be a very simple example but will give you all of the pieces you need to programmatically add lighting to your scene. You can expand on the concepts shown here to make different types of lighting very easily.

Read More

Continue Readingred arrow

VR Rendering with RealityServer 4.4 Update 46

RealityServer 4.4 build 1527.46 has just been released adding Iray 2016.1.1 which includes support for rendering stereo, spherical VR imagery suitable for viewing with devices such as the Oculus Rift, HTC Vive, Samsung GearVR, OSVR and Google Cardboard viewers. There are also numerous small additions and bug fixes and some other new features such as spectral rendering, however VR rendering is the headline item. In this article we will show you how to do simple VR rendering with RealityServer.

Read More

Continue Readingred arrow

Creating a Simple Scene Programmatically

In this article I am going to show you how to create a simple 3D scene, completely from scratch using RealityServer. You will learn about the anatomy of a RealityServer scene and the different components that go into making it up, including options, groups, instances, cameras, geometry and environment lighting. While the scene will be very simple there will be many key principles of RealityServer and NVIDIA Iray demonstrated which you can expand on to build more complex scenes.

Read More

Continue Readingred arrow
Get in Touch