SoLDMGlobalResourceParameters Class |
Global resource parameters of VolumeViz.
Namespace: OIV.LDM
The SoLDMGlobalResourceParameters type exposes the following members.
Name | Description | |
---|---|---|
Equals | Determines whether the specified Object is equal to the current Object. (Inherited from Object.) | |
GetDefaultMaxMainMem | Returns the default maximum system (CPU) memory in MB. | |
GetDefaultMaxTexMem | Returns the default maximum GPU memory in MB. | |
GetHashCode |
Overrides GetHashCode().
(Inherited from SoNetBase.) | |
GetIgnoreFullyTransparentTiles | Returns the IgnoreFullyTransparentTiles flag. | |
GetLoadNotificationRate | Returns the load notification rate. | |
GetMax2DTexMemory | Get the maximum number of 2D textures allowed to be loaded. | |
GetMaxMainMemory | Returns the maximum main memory in MB for all the VolumeViz data sets. | |
GetMaxTexMemory | Returns the maximum texture memory in MB for all the VolumeViz data sets. | |
GetMoveLowResolution | Obsolete. Returns the move low resolution flag. | |
GetNumIO | Returns the current number of loading threads. | |
GetScreenResolutionCulling | Returns the screen resolution culling state. | |
GetSliceEqualResolution | Returns the slice equal resolution flag. | |
GetTex2LoadRate | Returns the maximum number of 2D textures allowed to be loaded into texture memory per frame for all the VolumeViz data sets. | |
GetTex3LoadRate | Returns the maximum number of tiles (3D textures) allowed to be downloaded into texture (GPU) memory per frame for all the VolumeViz data sets. | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
GetViewCulling | Returns the view culling flag. | |
GetViewpointRefinement | Returns the viewpoint refinement flag. | |
GetVisualFeedbackParam | Returns the state of the specified visual feedback parameter. | |
SetIgnoreFullyTransparentTiles | Sets the IgnoreFullyTransparentTiles flag. | |
SetLoadNotificationRate | Sets the load notification rate (number of tiles). | |
SetMax2DTexMemory | Sets the maximum 2D texture GPU memory in MB allowed to be loaded for all VolumeViz data sets. | |
SetMaxMainMemory | Sets the maximum main (CPU) memory, in MB, to use for all VolumeViz data sets. | |
SetMaxTexMemory | Sets the maximum texture (GPU) memory, in MB, for all VolumeViz data sets. | |
SetMonitoringCB | Sets a monitoring delegate. | |
SetMoveLowResolution | Obsolete. Sets the low resolution when moving flag. | |
SetNumIO | Sets how many simultaneous tile loading threads to use if multi I/O mode is on (it is on when LDM mode is on). | |
SetScreenResolutionCulling | Sets the screen resolution culling flag. | |
SetSliceEqualResolution(Boolean) | Calls SetSliceEqualResolution(state, true). | |
SetSliceEqualResolution(Boolean, Boolean) | Sets the slice equal resolution flag. | |
SetTex2LoadRate | Sets the maximum number of 2D textures allowed to be downloaded into texture (GPU) memory per frame (render traversal) for all the VolumeViz data sets. | |
SetTex3LoadRate | Sets the maximum number of 3D textures allowed to be downloaded into texture (GPU) memory, per frame (render traversal), for all VolumeViz data sets. | |
SetViewCulling(Boolean) | Calls SetViewCulling(state, true). | |
SetViewCulling(Boolean, Boolean) | Sets the view culling flag. | |
SetViewpointRefinement | Sets the viewpoint refinement flag. | |
SetVisualFeedbackParam | Sets the specified visual feedback parameter to true or false. | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
LoadCallback | Sets a delegateto be called with the tile loading state. |
This class defines functions for controlling global resource parameters of VolumeViz.
These parameters can have a significant impact on resource usage (primarily memory) data loading and rendering performance.
**Memory management**
This class allows the application to specify how much CPU and GPU memory VolumeViz can use to load data and textures. By default the main memory and texture memory limits are set to a percentage of the total available system and GPU memory (see the OIV.LDM.SoLDMGlobalResourceParameters.SetMaxMainMemory(System.Int32), OIV.LDM.SoLDMGlobalResourceParameters.SetMaxTexMemory(System.Int32) and OIV.LDM.SoLDMGlobalResourceParameters.SetMax2DTexMemory(System.UInt64) methods). Applications can use the OIV.Inventor.Devices.SoCpuDevice and OIV.Inventor.Devices.SoGLDevice classes to query the total and available memory on the CPU and GPU. How VolumeViz uses CPU memory depends on the data source (tiled or not tiled), and the selected tile cache policy (see the field OIV.LDM.Nodes.SoLDMResourceParameters.tileCachePolicy).
**Tiles:** VolumeViz uses a data manager called LDM to manage volume data. LDM manages volume data in chunks called "tiles". If the volume size is larger than the tile size, then there are two classes of tile: full-resolution tiles that contain actual data values and low-resolution tiles that contain sub-sampled data values. The application may have native data that is already tiled or the data may be pre-processed to create tiles and store them in the LDM file format. In an LDM format file the tiles may optionally be compressed to save disk space and memory, but in this case, the tiles must be expanded before sending to the GPU. If the data is not tiled, for example disk formats like DICOM and SEGY or an in-memory volume, then tiles must be created in memory at runtime.
**Tile size:** Note that the default tile size is small and generally you will get better performance with non-tiled data by explicitly setting a larger tile size (see the ldmResourceParameters field and OIV.LDM.Nodes.SoLDMResourceParameters.tileDimension). If the volume data fits in CPU and GPU memories, the tile size may be set to the volume dimension to mimic non-tiled volume data behavior (i.e., without multi-resolution).
**Caches:** VolumeViz allocates a significant amount of memory on the CPU to store tile data and on the GPU to process the rendering. The chosen amounts of memory are a trade off between efficient data loading and rendering performance. If the volume is larger than the available or allowed memory, the *most important* tiles are kept in memory. The importance is determined by various heuristics set in this class and in OIV.LDM.Nodes.SoLDMResourceParameters.
**First level CPU tile cache** (controlled by *max main memory*) VolumeViz uses this amount of CPU memory as a first level cache for LDM data tiles. The main memory limit is set in megabytes using the OIV.LDM.SoLDMGlobalResourceParameters.SetMaxMainMemory(System.Int32) method. If the data set is small enough to fit in system memory, then you should generally set the memory limit high enough to allow this. If the data set is larger than system memory, then set the memory limit as high as possible without impacting the application's other needs for memory. For example, if the tile size is 64 and each voxel is a float value, then each tile requires approximately 1 MB of system memory. However the CPU memory footprint can be reduced for compressed tiles (stored compressed) depending on the selected OIV.LDM.Nodes.SoLDMResourceParameters.tileCachePolicy.
When there are multiple data sets, by default each data set receives OIV.LDM.SoLDMGlobalResourceParameters.GetMaxMainMemory() divided by the number of datasets. Each time a new data set is created the per-dataset value is recomputed and some memory is taken away from existing data sets. **Note:** This default way to allocate memory (when handling multiple data sets) is not optimal if the data sets have significantly different sizes. For example, the memory required for a height field is normally much less than for a volume. In this case the application can explicitly allocate memory to each data set using the field OIV.LDM.Nodes.SoLDMResourceParameters.maxMainMemory associated with the data set (see the OIV.LDM.Nodes.SoDataSet.ldmResourceParameters field).
**Second level CPU tile cache** VolumeViz also uses a second cache of tiles in CPU memory that is used when some tiles must be created or uncompressed on the fly. This second level cache is normally used when a tile must be sent to the GPU but it is not used when the OIV.LDM.Nodes.SoLDMResourceParameters.tileCachePolicy is ALL. This cache has a short life cycle thus the tiles might only be temporarily stored in this cache.
**Warning:** This second cache is separate from the first level CPU cache and its footprint is not included in the limit specified by maxMainMemory (neither OIV.LDM.SoLDMGlobalResourceParameters.SetMaxMainMemory(System.Int32) nor OIV.LDM.Nodes.SoLDMResourceParameters.maxMainMemory). Even if the variable OIV_BUFFER_OBJECT_CACHE_SIZE is deprecated, it can be set as a workaround. It defines the maximum number of tiles that can be stored in the second level cache.
**GPU Tile Cache** (controlled by *max texture memory*) VolumeViz uses this amount of GPU memory to cache LDM data tiles on the GPU. The texture memory limit is set in megabytes using the OIV.LDM.SoLDMGlobalResourceParameters.SetMaxTexMemory(System.Int32) method for for 3D tiles and by the OIV.LDM.SoLDMGlobalResourceParameters.SetMax2DTexMemory(System.UInt64) method for the 2D tiles. You can set these values separately for each data set using OIV.LDM.Nodes.SoLDMResourceParameters.
**Warning:** Some systems integrate GPU memory with CPU memory. In this case, if you allocate 4GB of CPU memory *and* 4GB of GPU memory, the system may see a total of 8GB private memory used by the process, leading to out-of-memory errors or swapping issues. If you face such issues, you should ensure that the max CPU memory + max GPU memory is less than the total available CPU memory for your machine.