Announcement

Collapse
No announcement yet.

High CPU usage with C# and WPF and multiple volumes on scene

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • High CPU usage with C# and WPF and multiple volumes on scene

    Hi,
    We have application written in C# and using Windows Forms for user interface. Currently I am working on implementing new user interface using WPF. While Windows Forms application works perfectly fine, I experience strange issue with WPF one. Application works fine until I load second volume to the scene. After loading second volume, application starts using about 100% of CPU and about 50-60% of GPU, and becomes unresponsive. If I start IvTune before loading second volume, I can remove or deactivate this volume. If I do this, application comes back to normal operation. I've also noticed two things. First thing is that if I load few copies of the same volume data, application works fine. Second thing is that if I use IvTune to remove volume, applications starts responding only if I remove bigger one (physical dimensions), no matter which one was loaded first. I use RenderAreaExaminer with WPF. I've also tried to use Windows Forms control under WPF, but I've got the same results. Do you have any idea what can cause this issue?

    Best regards,
    Peter

  • #2
    Hi,
    Sorry, I don't recognize that problem. We can try some experiments, but we'll need a little more info:
    • What version of Open Inventor?
    • Approximately what are the dimensions and data type of the volumes? (trying to get an idea of memory required)
    • How much memory is available on your GPU?
    • When you load the second volume, is it independent of the first volume?
      Or is it combined with the first volume using SoVolumeGroup, SoMultidataSeparator, etc.
    Regards,
    Mike

    Comment


    • #3
      Hi,
      Thank you for your response. I use Open Inventor 9.8.0 .NET Visual2015 x64. In attached video I've used two volumes:
      1. 512x512x35 (spacing 0.857422 0.857422 7.5)
      2. 512x512x361 (spacing 0.793 0.793 0.800049)
      Both volumes were 16-bits. I've tested it on two PCs, one with GTX950M 4GB, and second with Quadro P2000 5GB. On both computers I've got the same results. I've done some more tests and I've realised that high CPU usage is somehow related with camera position. I can find position when both volumes are visible and CPU usage is low, and on the other hand, position when only one volume is visible and CPU usage is high. I attach screen from scene graph with loaded volumes, and here is the video that shows the problem: https://youtu.be/siZGILi6yFM

      Regards,
      Peter
      Attached Files

      Comment


      • #4
        Originally posted by psperka View Post
        Hi,
        Thank you for your response. I use Open Inventor 9.8.0 .NET Visual2015 x64. In attached video I've used two volumes:
        Hi Peter,
        Thanks for detailed information. The video was very helpful. But...
        So far we are not able to reproduce the problem.

        I attach a simple C#/WPF test program that loads two volumes under an SoVolumeGroup node (actually the same volume twice, but effectively two volumes as far as VolumeViz is concerned). There is a bool in the test program that controls whether the two volumes overlap in 3D space. This is because SoVolumeGroup is smart enough to detect when the volumes do NOT overlap and do normal volume rendering. When the volumes actually overlap, SoVolumeGroup forces a special case to handle blending voxels that overlap. I tested with OIV 9.9, but I don't expect any significant difference from 9.8.

        WpfTestTwoVolumes.zip

        If you are able to reproduce the problem using this simple test case (with some modification if necessary), then we can investigate further. Hopefully you will see something significant about the scene graph structure that is different in your application compared to the test program.
        Best regards,
        Mike
        Attached Files
        Last edited by mikeheck; April 13th, 2019, 12:46 AM.

        Comment


        • #5
          Hi,
          I've finally resolved the issue. The problem was caused by this line:
          Code:
          SoPreferences.SetValue("LDM_USE_IN_MEM_COMPRESSION", "0");
          After removing it, application works fine.

          Best regards,
          Peter

          Comment


          • #6
            Originally posted by psperka View Post
            Hi,
            I've finally resolved the issue. The problem was caused by this line:
            Code:
            SoPreferences.SetValue("LDM_USE_IN_MEM_COMPRESSION", "0");
            After removing it, application works fine.
            Hi Peter,
            Well... I can't explain that, but it's good news. :-)
            Thank you very much for letting us know!
            Regards,
            Mike

            Comment

            Working...
            X