Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • VTK VTK
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 737
    • Issues 737
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 209
    • Merge requests 209
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • VTK
  • VTKVTK
  • Issues
  • #15372

Closed
Open
Created Mar 10, 2015 by Kitware Robot@kwrobotOwner

vtkGPUVolumeRayCastMapper getting GPUInfo is slow

This issue was created automatically from an original Mantis Issue. Further discussion may take place here.


Change below only gets the max video memory once -

vtkGPUVolumeRayCastMapper::vtkGPUVolumeRayCastMapper() { this->AutoAdjustSampleDistances = 1; this->ImageSampleDistance = 1.0; this->MinimumImageSampleDistance = 1.0; this->MaximumImageSampleDistance = 10.0; this->SampleDistance = 1.0; this->SmallVolumeRender = 0; this->BigTimeToDraw = 0.0; this->SmallTimeToDraw = 0.0; this->FinalColorWindow = 1.0; this->FinalColorLevel = 0.5; this->GeneratingCanonicalView = 0; this->CanonicalViewImageData = NULL;

this->MaskInput = NULL; this->MaskBlendFactor = 1.0f; this->MaskType = vtkGPUVolumeRayCastMapper::LabelMapMaskType;

this->AMRMode=0; this->ClippedCroppingRegionPlanes[0]=VTK_DOUBLE_MAX; this->ClippedCroppingRegionPlanes[1]=VTK_DOUBLE_MIN; this->ClippedCroppingRegionPlanes[2]=VTK_DOUBLE_MAX; this->ClippedCroppingRegionPlanes[3]=VTK_DOUBLE_MIN; this->ClippedCroppingRegionPlanes[4]=VTK_DOUBLE_MAX; this->ClippedCroppingRegionPlanes[5]=VTK_DOUBLE_MIN;

// :ADSK: JNH, force abs on memory sizes, only calculate once static vtkIdType maxMemoryInBytes = 0 ; if ( maxMemoryInBytes == 0 ) { vtkGPUInfoList *l=vtkGPUInfoList::New(); l->Probe(); if(l->GetNumberOfGPUs()>0) { vtkGPUInfo *info=l->GetGPUInfo(0); maxMemoryInBytes=info->GetDedicatedVideoMemory();

      if( maxMemoryInBytes < 0 )
          maxMemoryInBytes *= -1 ;
	  if(maxMemoryInBytes == 0)
	  {
		  maxMemoryInBytes=info->GetDedicatedSystemMemory();
	  }
      
      if( maxMemoryInBytes < 0 )
          maxMemoryInBytes *= -1 ;
  }
  l->Delete();

  if (maxMemoryInBytes == 0)
  {
	  char* env = getenv("VTK_MAX_GPU_MEMORY_MB");
	  if (env)
	  {
		  maxMemoryInBytes = atoi(env) * 1024 * 1024;
	  }
  }

  if (maxMemoryInBytes < 0)
	  maxMemoryInBytes *= -1;

  if (maxMemoryInBytes == 0)
  {
	  // :ADSK: use some default value: 1Gb, is reasonable in 2014!
	  maxMemoryInBytes = 1024 * 1024 * 1024;
  }

}

this->MaxMemoryInBytes = maxMemoryInBytes ; this->MaxMemoryFraction = 0.75;

this->ReportProgress=true;

this->TransformedInput = NULL; this->LastInput = NULL; }

Assignee
Assign to
Time tracking