Try Me: Intel® OSPRay Studio Application Showcase on High-performance Amazon Web Services (AWS)* EC2* Systems

ID 标签 687967
已更新 9/16/2021
版本 Latest
公共

author-image

作者

Objective

 

Try the Intel® OSPRay Studio to quickly explore the Intel® oneAPI Rendering Toolkit (Render Kit) in a production, performance, and scalable system environment. Intel OSPRay Studio is an interactive showcase application in the Render Kit. This walkthrough explains how to quickly deploy and try the Intel OSPRay Studio with Amazon Web Services (AWS)* EC2*. Use this demonstration to understand the feature capability, performance, and deployment options.

Estimated time: 15 minutes (depends on bandwidth)

Video

Watch the video of the walkthrough at Develop an Intel® OSPRay Studio Application on High-Performance EC2* Systems.

Prerequisites

  • Active Amazon Elastic Compute Cluster* (Amazon EC2*) account with the following:
    • Ability to configure IP and port access for IP based protocols in the security group
    • If you use an organizational account, proxy access through the AWS security group
  • Windows* OS, Linux* OS, or macOS* client platform.
    • If you use the Linux OS, you can deploy the server completely on your own client, forgoing a remote host.
  • HTML5-compatible web browser and/or a standalone VNC client. For example:
    • A web browser: Mozilla* Firefox*, Chrome*
    • A VNC client:
      • On Windows OS: TigerVNC*, RealVNC*
      • On Ubuntu*: TigerVNC* Viewer, on CentOS*, Fedora*, RHEL*: TigerVNC
      • On macOS: RealVNC
  • A SSH client:
    • On Windows OS: Cygwin* OpenSSH*, PuTTY*, MobaXterm*
    • On Linux OS: OpenSSH
    • On macOS: OpenSSH
    • NOTE: Open ports through your firewall as needed. Check with a network administrator for your organization.

  • High-bandwidth internet connection

NOTE: The walkthrough presented in this article was tested on a 1 GB/s connection from California with AWS ECS2 ‘us-east’ Ohio, USA-based servers.

Solution and Components


The solution demonstrates a virtual desktop with a running instance of Intel OSPRay Studio. The solution uses a VNC server and an HTML5-based VNC client to present Intel OSPRay Studio to your client system. VNC provides good performance for remote interactive rendering experiences given sufficient bandwidth.
Interactive or offline ray-tracing workloads scale greatly on a workstation class and a greater compute hardware. However, such systems might not be easily accessible for an application. Run the Intel OSPRay Studio on powerful Intel® Xeon®-based high-performance systems to get high-fidelity interactive experiences that end-users demand. The walkthrough uses lean scripting that is applicable for many client platforms and GNU/Linux* server environments.
 

Scripts

Review the scripts below to understand the whole workflow that will be used in this walkthrough:

  • create-demo.sh
#!/usr/bin/bash
DIMAGE_TAG=studiodemo-$(date +%Y%m%d-%H.%M.%S)
tee > ${HOME}/Dockerfile.${DIMAGE_TAG} << EOF
FROM consol/centos-xfce-vnc@sha256:785d27ec7508182db3bcfd670d4a92e00297211ab8ee56fa8c573bfc58f5441a
USER 0

RUN /usr/bin/bash -c "printf '[oneAPI]\nname=Intel(R) oneAPI repository\nbaseurl=https://yum.repos.intel.com/oneapi\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=1\ngpgkey=https://yum.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB' > /tmp/oneAPI.repo"
RUN /usr/bin/bash -c "printf '[Desktop Entry]\nEncoding=UTF-8\nVersion=0.6.0\nType=Application\nName=launch_ospStudio\nComment=launch_ospStudio\nExec=/usr/bin/bash -c \"sleep 3 && source /opt/intel/oneapi/setvars.sh && ospStudio dragon.obj\"\nOnlyShowIn=XFCE;\nStartupNotify=false\nTerminal=true\nHidden=false' > /etc/xdg/autostart/launch_ospStudio.desktop"
RUN mv /tmp/oneAPI.repo /etc/yum.repos.d
RUN yum-config-manager --disable tigervnc-el7
RUN yum -y install intel-renderkit-2021.2.0.x86_64
RUN yum -y install blender python3 pip3
RUN /usr/bin/bash -c "wget https://graphics.stanford.edu/pub/3Dscanrep/dragon/dragon_recon.tar.gz -P \${HOME}/."
RUN /usr/bin/bash -c "pushd \${HOME} && tar -xvf dragon_recon.tar.gz && popd"
RUN /usr/bin/bash -c "printf 'import bpy\nimport sys\n\nbpy.ops.object.select_all(action=\"SELECT\")\nbpy.ops.object.delete()\nbpy.ops.import_mesh.ply(filepath=\"\${HOME}/dragon_recon/dragon_vrip.ply\")\nbpy.ops.export_scene.obj(filepath=\"dragon.obj\")\n' > \${HOME}/convert.py"
RUN blender --background --python \${HOME}/convert.py
RUN sed -i '/^.*.png.*$/d' /headless/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml && sed -i '/^.*image-style.*$/d' /headless/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml && sed -i 's/^\(.*image-show.*\)true\(.*\)$/\1false\2/' /headless/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-desktop.xml
## switch back to the default user
USER 1000
EOF

#update may take a while, skipping it
#sudo yum -y update
sudo yum -y install wget docker
sudo systemctl start docker
sudo docker pull consol/centos-xfce-vnc@sha256:785d27ec7508182db3bcfd670d4a92e00297211ab8ee56fa8c573bfc58f5441a
echo "Building OSPRay Studio demo sandbox: ${DIMAGE_TAG}"
sudo docker build -f ${HOME}/Dockerfile.${DIMAGE_TAG} -t ${DIMAGE_TAG} .
echo "Adding new docker image tag to ${HOME}/dockerimagetag"
echo "${DIMAGE_TAG}" > ${HOME}/dockerimagetag
  • run-demo.sh
#!/usr/bin/bash
DIMAGE_TAG=$(cat ${HOME}/dockerimagetag)
sudo docker run -d -p 5901:5901 -p 6901:6901 -e VNC_PW=your_password -e VNC_RESOLUTION=1536x864 ${DIMAGE_TAG}

 

Set Up, Launch, and Connect

  1. Log in to your AWS EC2 account.
  2. Launch a new instance by clicking the Launch Instance button.
  3. Use the AWS marketplace to find an operating system for an Amazon Machine Image*:
    1. Search for CentOS 7.
    2. Select CentOS 7 with HVM. NOTE: This walkthrough is not exclusive to a specific OS image.
  4. Select a CPU. You are recommended to run at least a 16 vCPU CPU configuration. We use the c5.24xlarge in the video walkthrough. At time of publication, this tier was backed by Intel® Xeon® Platinum 8275CL Processor, hyperthreaded with 96 logical CPUs.
    • c5.24xlarge is configured with 192 GB DRAM, but this walkthrough runs on systems with as little as 6 GB. TIP: For reference, a 1 vCPU configuration, such as t2.micro, and minimal memory are not enought to run the Intel OSPRay Studio interactively. Notice that user geometries can use more storage than we use in this walkthrough. Your own geometry may increase DRAM usage requirements. If you want to stage a large workload, make sure to pick a configuration with enough memory.
  5. Make sure that AWS EC2 security group provides access for the range of IPs that include your client. NOTE: Some organizations have limitations for using the 0.0.0.0/0 mask (all public IPs). Seek guidance from your organization for configuring the security group.
  6. For your client, open the following ports in the security group:
    • 22 for SSH
    • 6901 for HTML5 access
    • 5901 for VNC Client access
  7. Launch the instance. Write down an instance IP and save your access key to a .pem file to the client. NOTE: If you use PuTTY on Windows OS, you need to convert the .pem key using the PuTTY PPK conversion program.
  8. Wait for the instance to get ready.
  9. Review the following scripts:
    • build-demo.sh creates a virtual Docker* environment for running Intel OSPRay Studio. The script does the following:
      • Deploys the ConSol/docker-headless-vnc-container from the Docker Hub*
      • Creates a new container to install the Render Kit Linux distribution from YUM
      • Downloads a popular Stanford 3D Scanning repository dragon model.
      • Converts it to a wavefront .obj format using Blender* Python* scripting.
      • Edits system configuration files to launch the Intel OSPRay Studio when the virtual system launches
      • Presets the Intel OSPRay Studio to launch with the dragon geometry.
    • run-demo.sh starts the Docker image that was built in build-demo.sh. Change the following: 
      • The password specified
      • The ports if needed. By default, the server exposes ports 5901 and 6901 with the -p flag. You can set the ports to a different value and remap them for the AWS instance.
      • The virtual desktop resolution. The walkthrough uses a 16:9 aspect ratio resolution. It is less than 1920x1080 (1080p), so most user displays have extra desktop space. Use a higher resolution if your client display uses a higher resolution, for example, 4K UHD 16:9 is 3840x2160. This allows for more detailed rendering.
    • NOTE: The overall script methodology can apply to other system environments outside of AWS EC2.
  10. Deploy your scripts on the image after they are to your preference. For example, to copy scripts with OpenSSH SCP:
    scp -i <path-to-your-keyfile> *.sh centos@<AWS-EC2-instance-IP>:~/.

     

  11. Log in to the instance with your SSH client. For example, to log in using the OpenSSH command line interface (CLI):
    ssh -i <path-to-your-keyfile> centos@<AWS-EC2-instance-IP>:~/.
  12. Run the build-demo.sh script.

  13. Run the run-demo.sh script.

  14. The application runs within the script-generated container. To connect to the container:

    1. Open an HTML5-compatible web browser on your client system.

    2. Navigate to <AWS-EC2-instance-IP>:6901.

  15. You can also forward the port to your local client by launching another SSH session. To forward the port using the OpenSSH client CLI:

    ssh -L6901:localhost:6901 -i <path-to-your-keyfile> centos@<AWS-EC2-instance-IP>

    NOTE: Instructions for forwarding a port depend on your preferred client.

  16. To connect to the demo session on the forwarded port:

    1. Open an HTML5-compatible web browser.

    2. Navigate to: localhost:6901.

  17. You can also connect with a standalone VNC Client (vncviewer) by connecting to <AWS-EC2-instance-IP>:5901. NOTE: If you forward the port 5901 to the localhost, connect to localhost:5901.

  18. Log in to the VNC session using the password you specified in the run-demo.sh script.

  19. Examine the Intel OSPRay Studio application output. You should see the following: 

See the Using the Intel OSPRay Studio and Next Steps sections below.

Troubleshooting

If you have problems connecting to a remote desktop, make sure that the ports are available with your AWS EC2 security group and exposed to your client IP.

Use the Intel OSPRay Studio

As a showcase reference application, you can modify and expand the controls and GUI features. Consider using the controls as a basis to explore the programmatic behavior of the application. Here are key controls for the interactive mode defined in the MainWindow class as of version 0.6.0:

  • UP/DOWN: Move a camera along the Z axis (in or out).
  • ALT+UP/ALT+DOWN: Move the camera along  the Y axis (up or down).
  • LEFT: Move the camera along the X axis.
  • RIGHT: Move the camera along the X axis.
  • W/S: Change the camera elevation.
  • Left Mouse Button + Drag: Rotate the camera around a look-at point.
  • Right Mouse Button + Drag: Move the camera toward or away from the look-at point.
  • ALT+S: Save a frame as a file to a local dirrectory.
  • A/D: Change camera azimuth.
  • ALT+A/ALT+D: Change camera roll.
  • G: Show or hide the UI.
  • Q: Quit the application.
  • P: Print scene a graph to a shell.
  • M: Print material registry to the shell
  • B: Print frame bounds.
  • V: Print camera parameters to the shell.
  • =: Push location for a camera perameter saving.
  • -: Pop location for the camera parameter saving.
  • 0-9: Set a camera snapshot.
  • Hold X, hold Y, hold Z: Keep axis constrained for camera movement.

Summary

Intel OSPRay Studio demonstrates how to construct and use and application based on the Intel® OSPRay API and other Render Kit components.

  • Intel OSPRay Studio incorporates geometry loaders, windowing user interface capability, and more typical facilities of a rendering application. 
  • Through the Intel OSPRay API, the Intel OSPRay Studio demonstrates usage of Intel® Embree for geometric raytracing and the Intel® Open Volume Kernel Library (Intel® Open VKL) for volumes. We did not look at volumes in this tutorial, but there are pregenerated volume scenes available from the application toolbar.
  • Intel OSPRay Studio gets better performance from deep learning inference provided by the Intel® Open Image Denoise. This feature is togglable at runtime.
  • The application can run on multiple nodes via MPI. This was not configured here but is a possibility for a future walkthrough.

You can use a cloud-based platform to understand performance capability, feature capabilitiy, and your best deployment options.

  • Render Kit components are designed to be portable for x86-64 hardware.
  • New Intel hardfware architectures with a performance benefit for the domain are planned to receive a Render Kit implementation.
  • Latest hardware is added to the Intel® DevCloud environment for developer evaluation and exploration.

Next Steps

  • For developers: Inspect the Intel OSPRay Studio sources to understand the application. For a quick start, see the MainWindow class (MainWindow.h/MainWindow.cpp). The class stages assets, manages state, facilitates GUI elements (imgui), and calls to Intel OSPRay via the ospray_sg (“scene graph”) library definitions.
  • Consider a Virtual kiosk backend deployed with this solution. Imagine look-development style experiences influencing customers at a trade show. Manufacturing, architecture, and entertainment asset review are common examples that could deploy this solution.
  • Aside from the wavefront obj format, Intel OSPRay Studio has moved to incorporate .gltf file formats. The application could be augmented to work with other or custom loaders.
  • Consider using the blender application conversion facilities to load more of your geometry. You might need more virtual disk space or DRAM on the AWS EC2 image than was used in this application.
  • Consider comparing performance of different Intel hardware solutions within the cloud compute environment.

References

Notices and Disclaimers

Intel technologies may require enabled hardware, software or service activation.
No product or component can be absolutely secure.
Your costs and results may vary.
© Intel Corporation. Intel, the Intel logo, and other Intel marks are trademarks of Intel Corporation or its subsidiaries. Other names and brands may be claimed as the property of others.

No license (express or implied, by estoppel or otherwise) to any intellectual property rights is granted by this document.
The products described may contain design defects or errors known as errata which may cause the product to deviate from published specifications. Current characterized errata are available on request.
Intel disclaims all express and implied warranties, including without limitation, the implied warranties of merchantability, fitness for a particular purpose, and non-infringement, as well as any warranty arising from course of performance, course of dealing, or usage in trade.

"