1 Reply Latest reply on Sep 7, 2015 12:45 PM by nirv_knox

    AMD Radeon OpenCL: wrong detection of memory size


      Some application (Darktable or LuxMark) detect only 512 Mb of video ram insted of 1 Gb.

      I have AMD Radeon HD5850 with 1 Gb of video RAM and use Debian 8 (64 bit , Jessie/stable  branch) with Catalyst 15.7 installed:


      $ dpkg -l | grep fglrx

      fglrx-atieventsd                  1:15.7-1          amd64

      fglrx-control                        1:15.7-1          amd64

      fglrx-driver                          1:15.7-1          amd64

      fglrx-modules-dkms            1:15.7-1          amd64

      glx-alternative-fglrx                  0.5.1          amd64

      libfglrx:amd64                     1:15.7-1          amd64

      libfglrx:i386                         1:15.7-1              i386

      libfglrx-amdxvba1:amd64   1:15.7-1          amd64

      libfglrx-amdxvba1:i386       1:15.7-1              i386

      libgl1-fglrx-glx:amd64         1:15.7-1          amd64

      libgl1-fglrx-glx:i386             1:15.7-1               i386

      Also I installed opencl packages and AMD-APP_SDK-2.9-1 (in /opt):


      $ dpkg -l | grep opencl

      amd-libopencl1:amd64          1:15.7-1          amd64

      amd-libopencl1:i386               1:15.7-1             i386

      amd-opencl-icd:amd64          1:15.7-1          amd64

      OpenCL benchamark LuxMark (LuxBall) works but show in the "Hardware Devices" section (OpenCL -> GPUs and Accelerators -> Cypress) -> "Max. Global Memory" parametr equal "524288 Kbytes" instead of ~"1 Gbytes"


      Also on the Darktabe official site was mentioned in March 2012:

      With current Radeon cards users have observed a different issue. Those cards will often only report to have less available memory than they physically own; typically 512MB out of 1GB.

      clinfo output:

      $ clinfo


      Platform Version:                    OpenCL 1.2 AMD-APP (1445.5)


      Platform Extensions:               cl_khr_icd cl_amd_event_callback cl_amd_offline_devices cl_amd_hsa


      Max memory allocation:          134217728


      Global memory size:               536870912



      So the problem described above is still present with current OpenCL driver.

      Is there the way to make OpenCL to see all video memory?

        • Re: AMD Radeon OpenCL: wrong detection of memory size


          export GPU_MAX_HEAP_SIZE="any value from 1 to 100"

          Use the above command to set the environment variable GPU_MAX_HEAP_SIZE. The value is the percentage of device memory that you want donate to OpenCL.

          export GPU_MAX_ALLOC_PERCENT="any value from 1 to 100"

          The above command sets the environment variable to allocate memory beyond the restricted 25% by default. However, the above commands may work or may not work, depending upon the environment variables supported by your hardware.


          If the above two doesn't work, then use

          :~$ strings /usr/lib/libamdocl64.so | grep GPU

          This command displays a list of variables supported by your GPU. You can tweak them around and find out which variable changes what. However, these changes may break the norms of optimization and this could result in poorer performance. Its provided for experimentation.