NVIDIA IndeX API nvidia_logo_transpbg.gif Up
iindex.h
Go to the documentation of this file.
1/******************************************************************************
2 * Copyright 2023 NVIDIA Corporation. All rights reserved.
3 *****************************************************************************/
8
9#ifndef NVIDIA_INDEX_IINDEX_H
10#define NVIDIA_INDEX_IINDEX_H
11
12#include <mi/dice.h>
13
19#include <nv/index/ierror.h>
26#include <nv/index/iviewport.h>
28
29//
30// Define modules for the API documentation.
31// They will be listed in the same order in which they are defined here.
32//
33
54
55// ----------------------------------------------------------------------------------
56
66
67// ----------------------------------------------------------------------------------
68
85
114
141
142// ----------------------------------------------------------------------------------
143
149
155
161
162// ----------------------------------------------------------------------------------
163
171
180
187
196
202
208
217
218// ----------------------------------------------------------------------------------
219
225
226// ----------------------------------------------------------------------------------
227
233
239
245
251
252// ----------------------------------------------------------------------------------
253
268
276
286
296
303
304// ----------------------------------------------------------------------------------
305
311
312// ----------------------------------------------------------------------------------
313
321
322// ----------------------------------------------------------------------------------
323
329
330// ----------------------------------------------------------------------------------
331
337
338// ----------------------------------------------------------------------------------
339
345
346
348namespace nv
349{
350
353//
354namespace index
355{
356
362//
364 public mi::base::Interface_declare<0x84fcac5c,0x25d1,0x4456,0x88,0x22,0xe4,0x92,0xec,0xee,0xea,0x1a>
365{
366public:
374 virtual bool set_service_mode(const char* service_mode) = 0;
375
382 virtual mi::Uint32 get_number_of_GPUs() const = 0;
383
389 virtual mi::Uint32 get_number_of_hosts() const = 0;
390
397 virtual mi::Uint32 get_number_of_rendering_hosts() const = 0;
398
405 virtual mi::Uint32 get_number_of_compositing_hosts() const = 0;
406
415 virtual mi::Uint32 get_host_index(mi::Uint32 index) const = 0;
416
424 virtual mi::Uint32 get_local_host_id() const = 0;
425
434 virtual const char* get_host_name(mi::Uint32 host_id) const = 0;
435
446 virtual bool set_sub_cluster_id(mi::Uint32 sub_cluster_id) = 0;
447
457 mi::Uint32 min_sub_cluster_size,
458 mi::Uint32 max_nr_of_sub_clusters) = 0;
459
465 virtual void register_callback(ICluster_change_callback* callback) = 0;
466};
467
473 public mi::base::Interface_declare<0x8ba1e5c7,0xaeb9,0x45ee,0xbb,0xf1,0xd6,0x25,0x91,0x70,0xce,0xaa>
474{
475public:
502 virtual mi::neuraylib::Tag_struct create_session(
503 mi::neuraylib::IDice_transaction* dice_transaction,
504 const char* session_name = 0) = 0;
505
522 virtual mi::neuraylib::Tag_struct get_session(
523 mi::neuraylib::IDice_transaction* dice_transaction,
524 const char* session_name = 0) = 0;
525
536 virtual void set_affinity_information(IAffinity_information* affinity_information) = 0;
537
547 virtual void update(
548 mi::neuraylib::Tag_struct session_tag,
549 mi::neuraylib::IDice_transaction* dice_transaction) = 0;
550
555 virtual void set_clock(IClock_pulse_generator* clock_pulse_generator) = 0;
556
561 virtual IClock_pulse_generator* get_clock() const = 0;
562};
563
564typedef mi::Uint64 IFrame_identifier;
565
573 public mi::base::Interface_declare<0xdbe8f991, 0xccbf, 0x4445, 0xad, 0x4d, 0x77, 0xf3, 0xd, 0x67, 0xcc, 0xff>
574{
575public:
586
596 virtual IError_set* get_error_set() const = 0;
597
604 virtual IFrame_identifier get_frame_id() const = 0;
605};
606
614 public mi::base::Interface_declare<0x9524bb73,0x4392,0x477b,0x9a,0x0f,0x5d,0xd6,0x10,0x32,0xc3,0x85>
615{
616public:
620 virtual mi::Size size() const = 0;
621
626 virtual nv::index::IFrame_results* get(mi::Size index) const = 0;
627};
628
642 public mi::base::Interface_declare<0xa686de09,0x6605,0x46ae,0xa0,0x9a,0xd2,0x8c,0x8b,0xcc,0xf1,0x92>
643{
644public:
650 virtual void set_frame_identifier(const IFrame_identifier& frame_id) = 0;
651
665 mi::Uint32 host_id,
666 mi::Uint32 device_id,
667 mi::Size memory_allocation_size,
668 mi::Size memory_available,
669 mi::Size memory_freed_up) = 0;
670
681 mi::Uint32 host_id,
682 mi::Uint32 device_id) = 0;
683
692 IBalancing_operations* balancing_ops) = 0;
693};
694
700 public mi::base::Interface_declare<0x788ee4b1,0xa0eb,0x47e5,0x91,0xf0,0x92,0x0a,0x30,0xfa,0xad,0x11>
701{
702public:
707 virtual const mi::math::Vector_struct<mi::Uint32, 2>& get_resolution() const = 0;
708};
709
715 public mi::base::Interface_declare<0xae97ca4b,0xe8c5,0x4c5b,0xa7,0xe6,0xd6,0x10,0xfd,0xad,0xcf,0xe1, nv::index::IIndex_canvas_creation_properties>
716{
717public:
722 virtual mi::Sint32 get_cuda_device_id() const = 0;
723};
724
730class Index_cuda_canvas_creation_properties : public mi::base::Interface_implement<nv::index::IIndex_cuda_canvas_creation_properties>
731{
732public:
747 mi::Sint32 cuda_device_id,
748 const mi::math::Vector_struct<mi::Uint32, 2>& resolution)
749 : m_cuda_device_id(cuda_device_id),
750 m_resolution(resolution) {}
751
754 virtual mi::Sint32 get_cuda_device_id() const { return m_cuda_device_id; }
757 virtual const mi::math::Vector_struct<mi::Uint32, 2>& get_resolution() const { return m_resolution; }
758
759private:
760 mi::Sint32 m_cuda_device_id;
761 mi::math::Vector_struct<mi::Uint32, 2> m_resolution;
762};
763
770 public mi::base::Interface_declare<0x435617a4,0x589b,0x47d9,0x99,0x17,0x05,0x82,0x7d,0x1d,0xfc,0x3e>
771{
772public:
775 {
778 };
779
800 IIndex_canvas_creation_properties* properties) const = 0;
801
833 mi::neuraylib::Tag_struct session_tag,
834 IIndex_canvas* canvas,
835 mi::neuraylib::IDice_transaction* dice_transaction,
836 IProgress_callback* progress = 0,
837 IFrame_info_callbacks* frame_info = 0,
838 bool composite_immediately = true,
839 IApplication_depth_buffer* application_depth_buffer = 0) = 0;
840
869 mi::neuraylib::Tag_struct session_tag,
870 IIndex_canvas* canvas,
871 IViewport_list* viewport_list) = 0;
872
901 mi::neuraylib::Tag_struct session_tag,
902 ICanvas_viewport_list* canvas_viewport_list) = 0;
903
912 virtual bool cancel_rendering(const IFrame_identifier& frame_id) = 0;
913};
914
915
923class IIndex :
924 public mi::base::Interface_declare<0x3beb46c0,0xb77d,0x4c90,0xbc,0xc3,0x1d,0xb1,0xa5,0xd5,0xb8,0xd5>
925{
926public:
942 virtual mi::Sint32 authenticate(
943 const char* vendor_key,
944 mi::Sint32 vendor_key_length,
945 const char* secret_key,
946 mi::Sint32 secret_key_length,
947 const char* flexnet_license_path = 0,
948 mi::Sint32 flexnet_license_path_length = 0) = 0;
949
951 //
962 virtual mi::Uint32 start(
963 bool is_dice_start_block = true) = 0;
964
972 virtual mi::Sint32 shutdown() = 0;
973
989 virtual mi::base::IInterface* get_api_component(const mi::base::Uuid& interface_id) const = 0;
990
1003 template<class T>
1005 {
1006 mi::base::IInterface* ptr_iinterface = get_api_component(typename T::IID());
1007 if (!ptr_iinterface)
1008 {
1009 return 0;
1010 }
1011 T* ptr_T = static_cast<T*>(ptr_iinterface->get_interface(typename T::IID()));
1012 ptr_iinterface->release();
1013 return ptr_T;
1014 }
1015
1025
1044 mi::base::Uuid class_id,
1045 mi::neuraylib::IUser_class_factory* factory) const = 0;
1046
1063 template <class T>
1065 {
1066 mi::base::Handle<mi::neuraylib::IUser_class_factory> factory(
1067 new mi::neuraylib::User_class_factory<T>());
1068 return register_serializable_class(typename T::IID(), factory.get());
1069 }
1070
1076 virtual const char* get_product_name() const = 0;
1077
1084 virtual const char* get_version() const = 0;
1085
1092 virtual const char* get_revision() const = 0;
1093
1098 virtual const char* get_nvidia_driver_version() const = 0;
1099
1104 virtual mi::Sint32 get_cuda_runtime_version() const = 0;
1105
1110 virtual const char* get_dice_version() const = 0;
1111
1117 virtual mi::base::ILogger* get_built_in_logger() const = 0;
1118
1124 virtual mi::base::ILogger* get_forwarding_logger() const = 0;
1125
1131 virtual mi::neuraylib::INeuray* get_dice_interface() = 0;
1132};
1133
1149 public mi::base::Interface_declare<0x48c60a29,0x6c27,0x4d2c,0x86,0x90,0xfa,0x47,0x17,0xc2,0xa7,0xd8>
1150{
1151public:
1153 virtual void clear() = 0;
1154
1159 virtual void add_library_search_path(const char* directory) = 0;
1160
1167 virtual void add_library_search_origin(const char* path = 0) = 0;
1168
1173 virtual void add_library_search_default() = 0;
1174};
1175
1176} // namespace index
1177
1178} // namespace nv
1179
1180extern "C"
1181{
1197MI_DLL_EXPORT
1199
1221MI_DLL_EXPORT
1222mi::base::IInterface* nv_factory(const mi::base::Uuid& iid, void* arg);
1223
1224} // extern "C"
1225
1226namespace nv {
1227namespace index {
1228
1237template <class T>
1238T* nv_factory(void* symbol, void* arg = 0)
1239{
1240 if (!symbol)
1241 {
1242 return 0;
1243 }
1244
1245 typedef mi::base::IInterface* IIndex_factory(const mi::base::Uuid& iid, void* arg);
1246 IIndex_factory* factory = reinterpret_cast<IIndex_factory*>(symbol);
1247 mi::base::Handle<mi::base::IInterface> iinterface(factory(typename T::IID(), arg));
1248 if (iinterface)
1249 {
1250 return iinterface->get_interface<T>();
1251 }
1252 else
1253 {
1254 return 0;
1255 }
1256}
1257
1258} // namespace index
1259} // namespace nv
1260
1261#endif // NVIDIA_INDEX_IINDEX_H
Application-side control of data distribution to cluster machines and GPUs.
Definition: iaffinity_information.h:41
Depth buffer provided by an application, enabling NVIDIA IndeX to do depth-correct compositing with a...
Definition: iapplication_depth_buffer.h:29
This class serves as a collection of all workload balancing operations that occurred and the NVIDIA I...
Definition: ibalancing_operations.h:63
Defines a list of canvases with associated viewports.
Definition: iviewport.h:204
The interface class IClock_pulse_generator generates the time for playing animations.
Definition: itime_mapping.h:31
The interface class allows implementing user-defined callbacks issued whenever the cluster topology h...
Definition: icluster_change_callback.h:26
Configuration of the NVIDIA IndeX cluster environment.
Definition: iindex.h:365
virtual mi::Uint32 get_number_of_compositing_hosts() const =0
Get number of nodes in the cluster used for distributed, parallel compositing only.
virtual bool set_sub_cluster_id(mi::Uint32 sub_cluster_id)=0
A sub-cluster represents a collections of machines.
virtual mi::Uint32 get_number_of_rendering_hosts() const =0
Get number of nodes in the cluster used for distributed, parallel rendering only.
virtual mi::Uint32 get_number_of_GPUs() const =0
Get number of GPUs in the cluster environment that can be used for cluster-wide rendering and computi...
virtual void register_callback(ICluster_change_callback *callback)=0
Register a callback that allows notifying the application if the cluster topology has changed.
virtual bool set_automatic_subclustering(mi::Uint32 min_sub_cluster_size, mi::Uint32 max_nr_of_sub_clusters)=0
Enable automatic subclustering of machines in the entire cluster using DiCE.
virtual mi::Uint32 get_number_of_hosts() const =0
Get number of nodes in the cluster used for distributed, parallel rendering and computing.
virtual mi::Uint32 get_host_index(mi::Uint32 index) const =0
Get cluster node id for the given node.
virtual bool set_service_mode(const char *service_mode)=0
Set the service mode of the present cluster machine.
virtual const char * get_host_name(mi::Uint32 host_id) const =0
Get hostname for the given host id.
virtual mi::Uint32 get_local_host_id() const =0
Get the cluster node id of the local node that the viewer runs on.
This class serves as a collection of runtime errors potentially generated during the execution of dis...
Definition: ierror.h:168
The frame info callbacks receive details related to the frame to be rendered.
Definition: iindex.h:643
virtual void set_frame_identifier(const IFrame_identifier &frame_id)=0
Callback to receive the frame identifier that can be used to cancel the rendering of a frame.
virtual void report_workload_balancing_operations(IBalancing_operations *balancing_ops)=0
Callback to receive notification about internal workload balancing operations that occurred and NVIDI...
virtual void report_dynamic_memory_eviction(mi::Uint32 host_id, mi::Uint32 device_id, mi::Size memory_allocation_size, mi::Size memory_available, mi::Size memory_freed_up)=0
Callback to receive notifications about a dynamic memory allocation event during NVIDIA IndeX runtime...
virtual void report_device_memory_reset(mi::Uint32 host_id, mi::Uint32 device_id)=0
Callback to receive notifications about a GPU-device reset event during NVIDIA IndeX runtime.
List of rendering results for multi-view rendering.
Definition: iindex.h:615
virtual nv::index::IFrame_results * get(mi::Size index) const =0
Returns the frame result at the given position.
virtual mi::Size size() const =0
Returns the number of frame results in the list.
The frame results store information gathered during the rendering process.
Definition: iindex.h:574
virtual IPerformance_values * get_performance_values() const =0
Returns an instance of the performance values interface IPerformance_values containing detailed perfo...
virtual IError_set * get_error_set() const =0
Returns an instance of the error set interface IError_set containing information about the success or...
virtual IFrame_identifier get_frame_id() const =0
The frame id uniquely identifies the rendered frame.
Interface class for creating NVIDIA IndeX built-in canvases such as a CUDA memory canvas.
Definition: iindex.h:701
virtual const mi::math::Vector_struct< mi::Uint32, 2 > & get_resolution() const =0
Get the resolution that a built-in canvas shall be initialized with.
Enables rendering to a user-defined canvas.
Definition: iindex_canvas.h:32
Interface class for creating NVIDIA IndeX built-in a CUDA memory canvas.
Definition: iindex.h:716
virtual mi::Sint32 get_cuda_device_id() const =0
The CUDA device by which the CUDA memory canvas shall be managed.
Optional configuration for how the NVIDIA IndeX library loads its dependeny shared libraries,...
Definition: iindex.h:1150
virtual void add_library_search_default()=0
Adds the system's standard library search mechanism to the library search list.
virtual void add_library_search_origin(const char *path=0)=0
Adds a path relative to the location of the NVIDIA IndeX shared library file to the library search li...
virtual void add_library_search_path(const char *directory)=0
Adds a directory to the library search list.
virtual void clear()=0
Resets the loader configuration to the defaults.
Enables the rendering of a user-defined session/scene.
Definition: iindex.h:771
virtual IIndex_canvas * create_canvas(IIndex_canvas_creation_properties *properties) const =0
Creates a built-in IIndex_canvas instance.
Index_builtin_canvas_type
Internal built-in canvas types for external use in an application.
Definition: iindex.h:775
@ IDX_CANVAS_CUDA_MEMORY
A canvas that allocates the framebuffer in CUDA memory.
Definition: iindex.h:776
@ IDX_CANVAS_MAIN_MEMORY
A canvas that allocates the framebuffer in main memory.
Definition: iindex.h:777
virtual IFrame_results * render(mi::neuraylib::Tag_struct session_tag, IIndex_canvas *canvas, mi::neuraylib::IDice_transaction *dice_transaction, IProgress_callback *progress=0, IFrame_info_callbacks *frame_info=0, bool composite_immediately=true, IApplication_depth_buffer *application_depth_buffer=0)=0
Renders a frame of the scene and writes the resulting image tiles into the user-defined or a built-in...
virtual IFrame_results_list * render(mi::neuraylib::Tag_struct session_tag, IIndex_canvas *canvas, IViewport_list *viewport_list)=0
Renders a frame of the scene and writes the resulting image tiles into the user-defined or a built-in...
virtual IFrame_results_list * render(mi::neuraylib::Tag_struct session_tag, ICanvas_viewport_list *canvas_viewport_list)=0
Renders a frame of the scene and writes the resulting image tiles into multiple user-defined IIndex_c...
virtual bool cancel_rendering(const IFrame_identifier &frame_id)=0
Cancel the rendering of a frame.
API component for creating the user session in the NVIDIA IndeX library.
Definition: iindex.h:474
virtual void set_affinity_information(IAffinity_information *affinity_information)=0
Sets the user-defined affinity information required to match the spatial data distribution between an...
virtual mi::neuraylib::Tag_struct create_session(mi::neuraylib::IDice_transaction *dice_transaction, const char *session_name=0)=0
Creates an instance that represents the ISession.
virtual void set_clock(IClock_pulse_generator *clock_pulse_generator)=0
A custom clock generates time ticks for time-dependent data visualizations.
virtual void update(mi::neuraylib::Tag_struct session_tag, mi::neuraylib::IDice_transaction *dice_transaction)=0
Update the NVIDIA IndeX library session.
virtual IClock_pulse_generator * get_clock() const =0
A custom clock generates time ticks for time-dependent data visualizations.
virtual mi::neuraylib::Tag_struct get_session(mi::neuraylib::IDice_transaction *dice_transaction, const char *session_name=0)=0
Returns a previously created ISession instance.
Interface to represent the entry point to the NVIDIA IndeX library and its functionality.
Definition: iindex.h:925
T * get_api_component() const
Retrieve an instance of an API component from the IndeX library.
Definition: iindex.h:1004
virtual mi::Uint32 start(bool is_dice_start_block=true)=0
Starts the operation of the IndeX library.
virtual const char * get_product_name() const =0
The NVIDIA IndeX library name or product name.
virtual mi::Sint32 get_cuda_runtime_version() const =0
Returns the CUDA runtime version number.
virtual mi::base::ILogger * get_forwarding_logger() const =0
Get the IndeX library's forwarding logger.
virtual mi::Sint32 shutdown()=0
Shut down the IndeX library.
virtual mi::neuraylib::INeuray * get_dice_interface()=0
The DiCE interface is available for further use.
virtual const char * get_dice_version() const =0
Returns the product version of the DiCE library.
virtual mi::Sint32 authenticate(const char *vendor_key, mi::Sint32 vendor_key_length, const char *secret_key, mi::Sint32 secret_key_length, const char *flexnet_license_path=0, mi::Sint32 flexnet_license_path_length=0)=0
Authenticates the NVIDIA IndeX library.
virtual IIndex_rendering * create_rendering_interface() const =0
An instance of the rendering interface IIndex_rendering allows rendering a scene to a user-defined ca...
virtual mi::base::ILogger * get_built_in_logger() const =0
Get the IndeX library's built-in logger.
virtual bool register_serializable_class(mi::base::Uuid class_id, mi::neuraylib::IUser_class_factory *factory) const =0
Registers a serializable class with DiCE and NVIDIA IndeX.
virtual const char * get_version() const =0
The product version of the NVIDIA IndeX library.
virtual mi::base::IInterface * get_api_component(const mi::base::Uuid &interface_id) const =0
Retrieve an instance of an API component from the NVIDIA IndeX or DiCE library.
virtual const char * get_nvidia_driver_version() const =0
Returns the NVIDIA driver version string.
virtual const char * get_revision() const =0
The NVIDIA IndeX revision number indicates the build.
bool register_serializable_class() const
Registers a serializable class with DiCE and NVIDIA IndeX.
Definition: iindex.h:1064
Interface class to query overall system performance values and statistics.
Definition: iperformance_values.h:62
User-defined progress callback for querying the progress of the distributed rendering or computing ta...
Definition: iprogress_callback.h:36
Defines a list of viewports that will be rendered onto a canvas.
Definition: iviewport.h:134
Implements the properties required by NVIDIA IndeX for creating a CUDA canvas.
Definition: iindex.h:731
virtual const mi::math::Vector_struct< mi::Uint32, 2 > & get_resolution() const
A canvas has a given resolution.
Definition: iindex.h:757
virtual mi::Sint32 get_cuda_device_id() const
A CUDA device hosts the canvas contents in the CUDA buffer.
Definition: iindex.h:754
Index_cuda_canvas_creation_properties(mi::Sint32 cuda_device_id, const mi::math::Vector_struct< mi::Uint32, 2 > &resolution)
Create an instance that delivers all properties required for creating a CUDA canvas.
Definition: iindex.h:746
mi::base::IInterface * nv_factory(const mi::base::Uuid &iid, void *arg)
Unique public access point to the NVIDIA IndeX library.
nv::index::IIndex * nv_index_factory()
This factory function is the only public access point to all algorithms and data structures in the NV...
T * nv_factory(void *symbol, void *arg=0)
Convenience function to ease the use of nv_factory().
Definition: iindex.h:1238
Defines the affinity of spatial areas to machines/GPUs in the cluster.
Depth buffer provided by the application.
Workload balancing operations.
Cluster-change callbacks.
Interfaces for exposing the data distribution scheme.
Interfaces for error feedback from the NVIDIA IndeX library runtime.
API for recording and reading tracing events.
User-defined rendering canvas.
The scene query API of the NVIDIA IndeX library.
Interface for accessing the monitored performance values.
Interface for implementing progress callbacks.
Results exposed by the NVIDIA IndeX library when querying a scene's contents.
Base class representing clock pulses and time mapping vor time varying data.
Multi-view functionality.
mi::Uint64 IFrame_identifier
A frame's unique identifier.
Definition: iindex.h:564
Common namespace for all NVIDIA APIs.
Definition: iindex.h:349