NVIDIA GameWorks Graphics Samples Setup Guide
This guide will help you with the setup of your host machine in order to properly build and run the the NVIDIA GameWorks Graphics sample applications for Vulkan and OpenGL.
Please ensure your system meets the Graphics Samples Prerequisites before proceeding further.
Installing and Building on Windows Host
This section will walk you through the setup of the Vulkan and OpenGL samples on a Windows development PC, for Android and Windows build targets.
Targeting Windows PC
- Unzip the samples pack to a directory on the Windows Host PC. We will call this directory
SAMPLES_ROOT
. - If you haven't already done so, download and install the LunarG Vulkan SDK. Ensure that the installer has set
VK_SDK_PATH
to the path to the SDK, and restart any Visual Studio instances. See the Prerequisites guide for recommended min SDK version. - Launch Visual Studio 2013 or 2015.
- Open the all-samples project file:
{SAMPLES_ROOT}/samples/build/vs201[3,5]All/AllSamples.sln
. - Build the solution as release or debug.
- The resulting apps will be placed in
{SAMPLES_ROOT}/samples/bin/vs201[3,5][x86,x64]/
.
Targeting Android Device
- Unzip the samples pack to a directory on the Windows Host PC. We will call this directory
SAMPLES_ROOT
. - If you haven't already done so, download and install the CodeWorks for Android installer for Windows. Be sure to include NVIDIA Nsight Tegra, Visual Studio Edition as an installed component.
- Launch Visual Studio 2013 or 2015.
- Open the all-samples project file:
{SAMPLES_ROOT}/samples/build/vs201[3,5]All/AllSamples.sln
. - Build the solution as release or debug.
- The resulting app APKs will be placed in
{SAMPLES_ROOT}/samples/bin/Tegra-Android/
.
Common Android Build Errors
An error similar to:
BUILD FAILED
C:\NVPACK\android-sdk-windows\tools\ant\build.xml:542: Unable to resolve project target 'android-14'Can be solved as follows:
- Run
{NVPACK}/android-sdk-windows/SDKManager.exe
- Click deselect all.
- Find Android 4.0 (API14).
- Check SDK Platform.
- Click Install packages.
- Follow the steps to accept the license and install the package
- Run
The error:
[dx] Could not create the Java virtual machine.
[dx] Error occurred during initialization of VM
[dx] Could not reserve enough space for object heapCan be fixed as follows:
- Edit
{NVPACK}\android-sdk-windows\build-tools\{each version}\dx.bat
. - Find the line:
set defaultMx=-Xmx1024M
And change the 1024 to 512, like:set defaultMx=-Xmx512M
. - Save and exit.
- Restart Visual Studio.
- Rebuild.
- Edit
Installing and Building on/for Linux x86_64 Host/Target
This section will walk you through the setup of the OpenGL and Vulkan samples on a Linux development PC.
- Install the Linux build/target pre-requisites by running:
sudo apt-get install g++ xorg-dev libglu1-mesa-dev make
- If using Ubuntu 12.04 LTS, building the Vulkan samples requires g++ 4.8:
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50
sudo apt-get install g++-4.8
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50
- Ensure that the environment variable
VK_SDK_PATH
is exported and points to the LunarG SDK root. See the Prerequisites guide for recommended min SDK version. - Ensure that the
LD_LIBRARY_PATH
variable includes the LunarG SDK's loader path:$VK_SDK_PATH/x86_64/lib
. - Pull the samples pack to a directory on the Linux Host PC. We will call this directory
SAMPLES_ROOT
. - Open a terminal window to
{SAMPLES_ROOT}/samples/build/linux64
. - Run
make
. - The resulting apps will be placed in
{SAMPLES_ROOT}/samples/bin/linux64/
. Note that as per the Prerequisites guide, the system must have working OpenGL drivers for the samples to run. - Individual samples may be built via
make build_[sample]_[debug, release]
Installing and Building on Linux x86_64 Host for Android Target
This section will walk you through the setup of the OpenGL and Vulkan samples on a Linux development PC to run on an Android device.
- Install the Linux build/target pre-requisites by running:
sudo apt-get install g++ xorg-dev libglu1-mesa-dev make
Full CodeWorks for Android 1r4 for Linux x64 tools install. Note that means that NDK r11/r12 are not yet supported. CodeWorks 1r4 supports r10e.
- If using Ubuntu 12.04 LTS, building the Vulkan samples requires g++ 4.8:
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-4.8
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.8 50
sudo apt-get install g++-4.8
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-4.8 50
- Pull the samples pack to a directory on the Linux Host PC. We will call this directory
SAMPLES_ROOT
. - Open a terminal window to
{SAMPLES_ROOT}/samples/build/makeandroid
. - Run
make
. - The resulting apps will be placed in each sample's
{SAMPLES_ROOT}/samples/[sampletype]/[samplename]/bin/
. - Individual samples may be built via
make build_[sample]_[debug, release]
Installing and Building for Tegra Ubuntu (Jetson TX1)
The samples can be compiled locally on the device, or cross-compiled from an x86_64 Ubuntu desktop.
- Pull the samples pack to a directory on the Ubuntu desktop or Jetson TX1. We will call this directory
SAMPLES_ROOT
. - Install the Linux target pre-requisites onto the build host:
sudo apt-get update
(this is critical, or else the next line will do nothing)
sudo apt-get install g++ xorg-dev libglu1-mesa-dev make
- If cross-compiling from an x86_64 Ubuntu desktop, install the cross-compiler onto the build host:
sudo apt-get install g++-aarch64-linux-gnu gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu
- On the build host, open a terminal window to
{SAMPLES_ROOT}/samples/build/linux-aarch64
, depending on the host PC. - Run
make
. - The resulting apps will be placed in
{SAMPLES_ROOT}/samples/bin/linux-aarch64/
- Individual samples may be built via
make build_[sample]_[debug, release]
- If the vulkan loader is not pre-installed on the target platform (Jetson TX1), it can be downloaded from the NVIDIA Embedded Developer Site. Also, the samples pack contains a pre-built loader. It can be installed by adding the path:
{SAMPLES_ROOT}/extensions/externals/lib/linux-aarch64
tiLD_LIBRARY_PATH
variable.