This project combines NVIGI and Epic Games' Unreal Engine 5.6 (https://www.unrealengine.com/) to create a sample app demonstrating an NVIGI AI integration.
IMPORTANT: For important changes and bug fixes included in the current release, please see the release notes at the end of this document BEFORE use.
The NVIDIA NVIGI (In-Game Inference) Unreal Engine Sample is a minimalistic code sample that is designed to show how one might integrate such AI features as chatbots (GPT/LLM) into an Unreal Engine application. The sample is exclusively provided in source form (C++ and Unreal Blueprint) with no binary executables included.
- Hardware:
- Windows development system with an NVIDIA RTX 30x0/A6000 series or (preferably) 4080/4090 or RTX 5080/5090 with a minimum of 8GB and recommendation of 12GB VRAM. Note that some plugins only support 40x0 and above (e.g. the TensorRT-LLM plugin), and will not be available on 30x0. Currently SDK supports only x64 CPUs.
- Software:
- NVIDIA RTX driver
- r551.78 or newer required for functionality
- For maximum performance, an r555.85 or newer driver is recommended
- MS Visual Studio 2022 (2019 may be compatible, untested)
- cmake (3.27.1 tested) installed in the command prompt path
- Windows SDK including DirectX SDK. Ensure that FXC.exe (https://learn.microsoft.com/en-us/windows/win32/direct3dtools/fxc) is in your PATH.
- NVIDIA RTX driver
In addition to the hardware and software requirements listed above, this code sample has two additional dependencies:
- A local installation of the Unreal Engine 5.6.x.
- The most convenient method of procuring this is through the Epic Games Launcher; please visit their download page (https://www.unrealengine.com/en-US/download) and follow their instructions.
- A ZIP file with the NVIGI SDK pack.
- You can obtain this ZIP file at https://developer.nvidia.com/rtx/in-game-inferencing.
- As of this current release, the supported version of IGI is 1.6.1 (
nvigi_pack_1_6_1.7z).
Please follow these steps:
- Clone this repository to a local directory (which will be referred to as
<SAMPLE_ROOT>) - In Windows Explorer, open
<SAMPLE_ROOT>\IGI_UE_Sample\Plugins\IGI\ThirdParty, create a folder namednvigi_pack, and extract the NVIGI SDK pack (.7z) into that folder.- Please notice the file named
copy_nvigi_pack_here.txtin that folder as a cue for this location. - After extraction, the layout should be
<SAMPLE_ROOT>\IGI_UE_Sample\Plugins\IGI\ThirdParty\nvigi_pack\with top-level items such asbin,include, anddata(and the rest of the SDK tree). - Download the
Nemotron Mini 4Bmodel using thedownload.batfile located in\nvigi_pack\data\nvigi.models\nvigi.plugin.gpt.ggml\{8E31808B-C182-4016-9ED8-64804FF5B40D}.
- Please notice the file named
- In Windows Explorer, go into
<SAMPLE_ROOT>\IGI_UE_Sample\and right-click the file namedIGI_UE_Sample.uproject. Select the "Generate Visual Studio project files" option in the right-click menu.- After the process is complete, a new Visual Studio solution file named
IGI_UE_Sample.slnshould appear.
- After the process is complete, a new Visual Studio solution file named
- Double-click the
IGI_UE_Sample.slnfile in order to open the code sample in Visual Studio. - Make sure the
Development Editorbuild configuration is selected. - Make sure the
IGI_UE_Sampleproject is selected as the startup project. - Press
F7to compile the entire solution.
In Visual Studio, simply press F5 to start the Unreal Editor. In addition to opening the project, the Unreal map named MainLevel will open.
From there, you can use the Editor to either:
- Immediately start gameplay (within the viewport or a PIE window), or
- Package the game, and then start it through the executable.
- In the Unreal Editor, click the Play button.
- Use WASD to move and the mouse to look around. Walk up to the mannequin and stand next to the red button.
- Press Space to activate the prompt interface; an input text box will appear.
- Type your prompt into the text box and press Enter to submit it.
- After a few seconds, the bot will wave its hand and the response will appear in a speech bubble above it (as shown in the screenshot above).
You may repeat steps 3 - 5 to issue additional prompts. If running a packaged executable, press Alt+F4 to exit the sample.
Note: The second button in the scene has no effect, and the wall of face images is decorative only. Both can be ignored.
This sample's Visual Studio C++ project is organized into two parts:
- An application-level Unreal Engine plugin with a single module, which contains the entirety of the NVIGI SDK integration.
- The module includes a C++ Blueprint class that provides a single asynchronous entry point for taking a prompt string, running inference and returning an output string.
- The build C# script for this module also details how to add all the DLLs and dependencies from the NVIGI SDK pack so that they are available both during gameplay and project packaging.
- A minimalistic executable application that drives the sample.
This sample's Unreal Engine Blueprint code is organized into the following:
IGI_GPT_Plugin- an actor Blueprint (underContent/PluginActors) placed in theBooth_LLMscene folder. It drives the LLM interaction by calling theSend text to GPT (Async)node with a system prompt and the player's input, then forwards the response to the speech bubble.BP_SpeechBubbleandWidget_SpeechBubble- a Blueprint actor and its paired UMG widget (both underContent/Assets/SpeechBubble) that display the LLM's reply in a speech bubble above the mannequin in theBooth_LLMscene folder.BP_Button(Content/Assets/Button) - the interactive button (Button_LLMinstance in the scene) the player approaches to trigger the prompt interface.BP_Text_Input_HUD(Content/Assets/TextInputHUD) - the HUD Blueprint that creates and displays a text-input widget when the player activates the prompt (Space), and passes the typed text toIGI_GPT_Plugin.MainGame(Content/MainGame) - the Game Mode Blueprint, set as the project default, which registersBP_Text_Input_HUDas the active HUD.
As explained at the beginning of this README, this sample is meant to be minimalistic, monolithic and brief. Further, it only shows usage of a single NVIGI feature (GPT chatbot). A more proper, modular and extensible integration should consider the following suggestions (or combinations thereof):
- Organizing the individual IGI plugins and their respective integrations into their own separate Unreal modules (or even into their own separate Unreal plugins).
- Organizing the IGI binary DLL files into their own specific directories (please refer to the
nvigi::Preferences::utf8PathToDependenciesfield innvigi.h). - Checking whether IGI plugins have been loaded and are available through
nvigi::PluginAndSystemInformationinnvigi_types.h.
For a more comprehensive code sample that not only shows NVIGI SDK integration (including usage of multiple NVIGI features) but that is closer to a shippable product, please refer to the ACE Unreal Engine plugin that is part of the NVIDIA ACE suite (https://developer.nvidia.com/ace).
- NVIGI 1.6.1 update
- Tested against Unreal Engine 5.6 and NVIGI SDK pack
nvigi_pack_1_6_1. - The 1.6.x SDK splits the binaries into per-configuration subfolders, so the plugin paths now point to
nvigi_pack/bin/x64/Release(unsigned/development binaries) instead of the flatnvigi_pack/bin/x64. The signedProductionbinaries are also available undernvigi_pack/bin/x64/Production.
- Tested against Unreal Engine 5.6 and NVIGI SDK pack
- NVIGI 1.5 update
- Tested against Unreal Engine 5.6.1 and NVIGI SDK pack
nvigi_pack_1_5_0.zip - Updated plugin paths to match the flattened 1.5 SDK layout (
nvigi_pack/bin/x64,nvigi_pack/include,nvigi_pack/data/nvigi.models). - The
nvigi.plugin.gpt.onnxgenai.dmlknown issue from 1.1 no longer applies: that plugin is not part of the 1.5 pack.
- Tested against Unreal Engine 5.6.1 and NVIGI SDK pack
- Initial release
- Tested against Unreal Engine 5.5.2 and NVIGI SDK pack
nvigi_pack_1_1_0.zip - KNOWN ISSUE: the
nvigi.plugin.gpt.onnxgenai.dmlNVIGI plugin currently crashes the application (Unreal Editor or packaged game). This will be fixed in future updates to this sample. A work-around is to simply rename the DLL file for that plugin (<SAMPLE_ROOT>\IGI_UE_Sample\Plugins\IGI\ThirdParty\nvigi_pack\plugins\sdk\bin\x64\nvigi.plugin.gpt.onnxgenai.dml.dll).
- Tested against Unreal Engine 5.5.2 and NVIGI SDK pack
