7 Replies Latest reply on Aug 30, 2010 6:11 AM by timchist

    OpenCL kernel offline compilation on a machine without ATI card

    timchist

      I installed ATI Stream SDK 2.2 on a computer without ATI cards and tried to run clbinary.zip sample accessible from this article: http://developer.amd.com/support/KnowledgeBase/Lists/KnowledgeBase/DispForm.aspx?ID=115.

      The sample did produce files for all the ATI cards as expected, however, only the ELF generated for CPU contained .text section. Binary files generated for GPUs didn't have .text and .rodata sections (they contained .amdil section however).

      On a computer with ATI 4850 and Catalyst driver, the sample produced binaries with .text and .rodata sections for all the devices.

      So the question is, is it required to have the Catalyst driver (and consequently, an ATI OpenCL-enabled GPU) installed in order to get binaries with ISA for OpenCL kernels via ATI StreamSDK 2.2 offline-compilation mechanism? Or having StreamSDK is enough to get binaries and I'm just doing something wrong?

        • OpenCL kernel offline compilation on a machine without ATI card
          nou

          frm IL to ISA code is task for CAL compiler which is part of catalyst driver. IMHO yes catalyst driver is needed to get whole binary kernel.

            • OpenCL kernel offline compilation on a machine without ATI card
              timchist

              Thanks, nou. Don't you agree that this almost kills the whole idea of the offline compilation, since IL->ISA is the most time consuming part of it? In addition, for CUDA we don't have to use a computer with an NVIDIA card to get a CUBIN -- nvcc works on any computer, while we do need a computer with an ATI GPU to get binaries for ATI GPUs.

                • OpenCL kernel offline compilation on a machine without ATI card
                  Illusio

                  The idea of offline compilation is pretty bad to begin with.

                  When you're basically certain that there is a compiler available on the target platform - why on earth would you not compile during installation instead of creating a binary installer package that would become out of date every time a hardware vendor released new hardware?

                  It sounds like a support nightmare to me, as well as a nightmare for your customers if they wanted to upgrade their hardware after you stopped supporting your application. It's way more practical to run a code obfuscator on the OpenCL source you ship with your applications if you're worried about your intellectual property.

                  I view offline compilation as a return to the days where applications would ship with built-in printer drivers. It's just not a good solution. OpenCL at the source level however, is a truly modern solution offering both standard access to vector computation resources and a rich feature set.

                   

                    • OpenCL kernel offline compilation on a machine without ATI card
                      nou

                      i agree with illusio. i see binary kernels just like cache for normal source code krenel.

                      and so you can generate binary krenels on machine with ATI card. you need at least few card to test your software don't you agree?

                      • OpenCL kernel offline compilation on a machine without ATI card
                        timchist

                         

                        Originally posted by: Illusio The idea of offline compilation is pretty bad to begin with.

                         

                        When you're basically certain that there is a compiler available on the target platform - why on earth would you not compile during installation instead of creating a binary installer package that would become out of date every time a hardware vendor released new hardware?



                        Intellectual property protection issues. We don't want our source code included in the installation package. Obfuscator-based solutions are not as good as replacing the source with compiled binary.

                         

                        Originally posted by: nouand so you can generate binary krenels on machine with ATI card. you need at least few card to test your software don't you agree?


                        We have several computers in the team. We develop on one of them (and this machine has an ATI card), while we use centralized build server, which doesn't have any GPUs.

                        In fact AMD encourages using such an approach, see here: http://developer.amd.com/support/KnowledgeBase/Lists/KnowledgeBase/DispForm.aspx?ID=115.

                         

                        OpenCL™ defines both an online compilation design flow as well as an offline compilation design flow. Online compilation involves passing the OpenCL™ C kernels to the OpenCL™ runtime at runtime. For ISVs and other developers concerned about making the source code of their OpenCL™ C kernels available to the end user, offline compilation is the preferred deployment method.


                          • OpenCL kernel offline compilation on a machine without ATI card
                            cjang

                            > Obfuscator-based solutions are not as good as replacing the source with compiled binary.

                            The source code could be encrypted or otherwise assembled at run-time (which also makes sense if you are doing JIT/AOT compilation). It could even be distributed lazily or unlocked with a key at run-time from a service. Nothing needs to be in cleartext. If you look at this way, even compiled binaries do not seem that secure. Many developers who post on these forums are very comfortable with ISA. I think that compiled binaries, following standard binary formats and instruction set, wouldn't actually buy that much more security. We all share the same toolchains so can work backwards and find the cleartext source that compiles to the ciphertext binaries. (I admit that I have not tried this personally so it may be much harder than it seems.)