Announcement

Collapse
No announcement yet.

CUDA vs OpenCL in 2.30

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

  • CUDA vs OpenCL in 2.30

    Hi all,

    I was just wondering if there is any definitive reason to use OpenCL now or CUDA in the new VRay?

    I did some quick benchmarking in a super simple scene. In 1 minute the OpenCL was very slightly faster (1008 paths traced for CUDA vs 1040 for OpenCL) on my GTX 580 on the latest certified drivers.

    One thing I did notice is that on one of the translucent objects I got 'dead' black pixels in the CUDA version that I didn't get in OpenCL. I attached the renders...you can see the black pixels in the CDUA if you look closely. I think it's probably my 'exit color' but I'm surprised there would be a difference in quantity of refractions between the two in the same scene. I also noticed that OpenCL started a little slower and was a little more fragile (vray console would crash occasionally when switching to OpenCL from CUDA or CPU.)

    Click image for larger version

Name:	CUDA1min.jpg
Views:	1
Size:	131.0 KB
ID:	874237
    CUDA

    Click image for larger version

Name:	openCL1min.jpg
Views:	1
Size:	129.3 KB
ID:	874238
    OpenCL

    Anyway, it's not life or death, I know I just thought I'd post my findings in the hopes of starting an informative conversation.

    Dan

  • #2
    Originally posted by danio View Post
    I was just wondering if there is any definitive reason to use OpenCL now or CUDA in the new VRay?
    CUDA starts faster the first time as there is no need to compile the GPU code. Also, it takes an enormous amount of RAM to compile the OpenCL code (> 8 GB, we had to do some horrible hacks to keep this in check). Speedwise, I've been getting mixed results depending on the scene and the particular GPU, but they are typically quite close to each other.

    One thing I did notice is that on one of the translucent objects I got 'dead' black pixels in the CUDA version that I didn't get in OpenCL.
    This might be related to the 3ds Max display gamma setting; try turning that off and use the V-Ray color mapping gamma.

    I also noticed that OpenCL started a little slower and was a little more fragile (vray console would crash occasionally when switching to OpenCL from CUDA or CPU.)
    I've noticed this as well, CUDA tends to be somewhat more stable. Also some textures heavy scenes rendered fine in CUDA whereas they crashed in OpenCL.

    In terms of development, we found that it was easier to debug the CUDA code. CUDA also offers some specific capabilities that we are not using just yet, but which may be important for future development.

    Best regards,
    Vlado
    I only act like I know everything, Rogers.

    Comment


    • #3
      Wow thanks for the quick and full reply. I think I'll stick with CUDA then since ram is always an issue with me (only have 16gb system). Have you noticed any difference in use of VRam?

      Comment


      • #4
        Originally posted by danio View Post
        Wow thanks for the quick and full reply. I think I'll stick with CUDA then since ram is always an issue with me (only have 16gb system). Have you noticed any difference in use of VRam?
        Video RAM is what I meant; I don't think there is any difference in the usage of the main CPU RAM for both engines.

        Best regards,
        Vlado
        I only act like I know everything, Rogers.

        Comment


        • #5
          Is there a reason, why there's no "CPU + CUDA" option, so that actually both are used? Wouldn't that make things even faster?

          Comment


          • #6
            Originally posted by Laserschwert View Post
            Is there a reason, why there's no "CPU + CUDA" option, so that actually both are used? Wouldn't that make things even faster?
            It could probably make things a tad faster, but from our experience, there is not much of a difference and the CPU tends to get in the way.

            Best regards,
            Vlado
            I only act like I know everything, Rogers.

            Comment


            • #7
              With that said, you could install a CPU OpenCL implementation, like Intel OpenCL - in that case, you can run the OpenCL code both on the CPU and the GPU simultaneously. You can use the ocldeviceselect utility to enable the RT engine on the CPU with OpenCL.

              Best regards,
              Vlado
              I only act like I know everything, Rogers.

              Comment


              • #8
                Unfortunately I never got OpenCL to run... Building the trace program crashes after a few hours (!). But right now I'm using RT distributed over the network, so most of the time the CPU mode is enough. I'll play around with CUDA though.

                Comment


                • #9
                  Originally posted by Laserschwert View Post
                  Unfortunately I never got OpenCL to run... Building the trace program crashes after a few hours (!).
                  Yep, it does need a lot of RAM to compile the code.

                  Best regards,
                  Vlado
                  I only act like I know everything, Rogers.

                  Comment


                  • #10
                    Does it mean you'll have to wait several hours for it to compile the first time!??

                    BTW. It seems when using CUDA the GPU load is only around 40-45 %!? Do others have the same problem!?
                    www.bpositive.dk

                    Comment


                    • #11
                      Originally posted by Bpositive View Post
                      It seems when using CUDA the GPU load is only around 40-45 %!? Do others have the same problem!?
                      What are you measuring the GPU load with? If you are looking at the Process Explorer info, it doesn't show correct data. Use EVGA precision instead.

                      Best regards,
                      Vlado
                      I only act like I know everything, Rogers.

                      Comment


                      • #12
                        I'm using TechPowerUp GPU-Z! - I think it's correct as it doesn't seem to bug down the graphics as much as normal... - But perhaps Cuda is better at that!?

                        Regarding the opencl compiler, do I have to wait a long time or is it an error that nothing happens? Thanks
                        www.bpositive.dk

                        Comment


                        • #13
                          Originally posted by Bpositive View Post
                          I'm using TechPowerUp GPU-Z!
                          Never used it; can you try with the EVGA precision tool? All my tests here in different configurations show 99% GPU usage with both OpenCL and CUDA and it seems to be quite real.

                          Regarding the opencl compiler, do I have to wait a long time or is it an error that nothing happens? Thanks
                          You have to wait.

                          Best regards,
                          Vlado
                          I only act like I know everything, Rogers.

                          Comment


                          • #14
                            It's the same, around 40 %....! Something is wrong! Could it be a nvidia driver problem? - I'm using 270.61, what is the latest stable driver?
                            Last edited by Bpositive; 09-05-2012, 06:09 AM.
                            www.bpositive.dk

                            Comment


                            • #15
                              Double-click on one of the graphs at the bottom (GPU clock, Shader clock etc) and a new window with lots of graphs will open, scroll down to the GPU usage graph.

                              Best regards,
                              Vlado
                              I only act like I know everything, Rogers.

                              Comment

                              Working...
                              X