8 Replies Latest reply on May 15, 2013 6:48 PM by timchist

    Offline OpenCL compilation on Linux

    timchist

      We compile OpenCL code offline and ship applications with precompiled binaries for supported devices. Building is done on a virtual machine that obviously does not have AMD hardware. However, prior to Catalyst 12.10, we managed to install the driver on the virtual machine, and the binaries produced with clBuildProgram in a context created with the CL_CONTEXT_OFFLINE_DEVICES_AMD flag then successfully worked on physical Linux machines with AMD GPUs installed.

       

      However, when we switched to AMD APP SDK 2.8, we decided to upgrade driver as ReadMe.txt that came with the SDK recommended to install Catalyst 12.10 or later. When we try to install 12.10 or 13.4 on a virtual machine, we are getting an error message saying that no supported display adapters are detected and the installation quits.

       

      Is there a way to install components required for offline compilation from a fresh driver on a virtual Linux machine?

        • Re: Offline OpenCL compilation on Linux
          himanshu.gautam

          Thanks for reporting it. I will have to ask a few people, and will do the necessary experiments to confirm the behavior. In case you have a small application that can be used to check this behavior please attach it.

            • Re: Offline OpenCL compilation on Linux
              timchist

              Please see attached sample to article KB115 in your knowledge base.

                • Re: Offline OpenCL compilation on Linux
                  himanshu.gautam

                  hi timchist,

                  Thanks for pointing to the Kb article. Can you let me know what setup you are using on VM?

                  CPU, GPU, SDK version, Operating system (32 or 64 bit?) ?

                    • Re: Offline OpenCL compilation on Linux
                      timchist

                      It's an x64 Linux installation (we are using CentOS 5.3 but it probably does not matter). VMs are configured to use 4 CPU cores and some generic GPU (you don't really have a choice of virtual GPUs and CPUs).

                        • Re: Offline OpenCL compilation on Linux
                          himanshu.gautam

                          APP SDK 2.8 separates the CPU and GPU run-times.

                          The idea was to allow people with no AMD GPU hardware to install and learn OpenCL by installing APP SDK through OpenCL CPU.

                          And serious people with AMD GPU hardware can install Catalyst driver to work with the OpenCL GPU.

                          So, you need to install catalyst driver to compile for GPUs.

                          And, AMD drivers will not install on Virtualized platforms. The AMD GPU is not yet virtualized.

                           

                          You can try using PCIe passthrough mechanism of your Hypervisor to directly expose an AMD GPU to a virtualized OS partition.

                           

                          - Bruhaspati

                            • Re: Offline OpenCL compilation on Linux
                              timchist

                              Dear Himanshu,

                              I think you are missing my point.

                               

                              We try to compile binaries for AMD GPUs offline on a computer without AMD hardware. The applications are of course developed and tested on computers with AMD GPUs installed, but production releases are compiled on an automated build server. This server does not have any GPUs, in fact, it's a virtual machine.

                               

                              We are installing AMD driver (or its components) on the server because unfortunately, as you correctly pointed out, components required to translate AMD IL into GPU-specific binaries are only included in driver, not in APP SDK. We do not need the whole driver to be operational on the VM, but only those libraries responsible for code generation.

                               

                              Prior to Catalyst 12.10, we installed drivers on the VM (even without virtual AMD adapters), and that resulted in successful binary generation, even though the driver itself was not quite used. Starting with Catalyst 12.10, a new script has been added to the installer of the driver which checks the presence of an AMD GPU and terminates installation if no such GPU is found. How can we disable this script?

                               

                              For building binaries for AMD GPUs on Windows, we simply copy aticaldd.dll and aticaldd64.dll from a computer with AMD GPU (and Catalyst driver) installed to the build server VM, and that allows us to successfully build AMD GPU binaries offline. Can we do something similar on Linux? (which files need to be copied?)

                                • Re: Offline OpenCL compilation on Linux
                                  nou

                                  you can find libaticaldd.so in /usr/lib/fglrx so you may try copy whole directory from PC which have driver installed.

                                  • Re: Offline OpenCL compilation on Linux
                                    timchist

                                    Apparently we found a workaround:

                                     

                                    1. Extract the driver files (e. g. "amd-catalyst-13.4-linux-x86.x86_64.run --extract")

                                    2. cd fglrx-install.XXXXXX

                                    3. Edit lokixml.sh: remove or comment out these sections:

                                    <require command="sh detect_gpu.sh">

                                      Your graphics adapter is not supported by this driver. Installation will not proceed.

                                    </require>

                                    4. Run sudo ./ati-installer.sh 13-4 --install

                                     

                                    After that builds produced on the VM work well on machines with AMD GPUs installed.