2 Replies Latest reply on Feb 8, 2012 10:42 PM by pillum

    OpenGL Initialization is very slow

    pillum

      Hello,

       

      I am programming a multi-platform game engine for windows/mac/linux/android/etc.

      and I've found out, that it is taking up to 300ms to initialize OpenGL and the window.

       

      My Testing Systems were Windows 7 x64 and Windows Developer Preview x64.

       

      Especially the shader compiler is not very performant. My profiling results are:

       

      Radeon 6850HD with Catalyst 12.2:

      CreateOGL3Context

      139.64msec for ChoosePixelFormat

      75.9328msec for wglCreateContext

       

      Compiling 4 shader (very simple shader)

      520.112msec

       

      Linking them in a Program

      270.25msec

       

      All in all it was around 950ms

      With program binary loading instead of saving

      it was only 2msec for the whole shader initialization process but still 250ms for creating the program/context/window.

       

      But even with a not so powerful notebook with integrated Intel/Nvidia 425M GPU

      the entire process took only 60ms with shader compiling

      and 40ms with binary loading.

      (I also noticed, that AMD is not checking if the program binary is correct. If it isn't a valid binary, it just segfaults.

      Also AMD binaries are 4x the size of Nvidia Binary. Although Nvidia saves the shader source in ASM and AMD in raw text, still the size should be much smaller.)

       

      Even with all the Context and PixelFormat Stuff!

       

      AMD may have the better hardware, but you need to really improve your drivers.

      You also see the faults of their driver if you want to use Blender with their new and shiny OpenCL Renderer named "Cycles".

      Catalyst is still not able to compile it with all the functions activated for months.

      Neither the CPU nor the GPU compiler can, you only can use simple clay rendering.

      Even my Intel CPU OpenCL compiler can do this...

       

      I hope that the AMD engineer read this topic and improve their driver a lot.

       

      For the others: Is there any way I can circumvent the call to ChoosePixelFormat without knowing the pixelformatid I need to use?

       

      Thank you, for spending time reading the text

        • Re: OpenGL Initialization is very slow
          gsellers

          Hi,

           

          I have to be honest and say that startup times, including ChoosePixelFormat is not an area that we've really spent a lot of time optimizing. We'll take a look and see if there's any obvious problems. We've been actively working on the shader compiler performance, though, and hopefully it's compilation speed should improve over the next little while.

           

          The invalid shader binary issue is one we're aware of and have fixed recently. That fix should show up in a Catalyst release in the next month or so.

           

          I sent the information about Cycles to our OpenCL team - they're going to take a look at it and see if we can't make it run well.

           

          I'm glad you like our hardware. We're working on improving the drivers all the time. I think we're making good progress, but we need help from our users (like you) to make this happen. Thanks for the feedback. I'll post back here if we find any obvious solutions to the problems you've reported.

           

          Cheers,