3 Replies Latest reply on Apr 26, 2016 7:07 AM by blueskull

    Ubuntu 16.04 open source driver OpenCL

    blueskull

      Hi,

       

      Has anyone tried the open source driver shipped with Ubuntu 16.04?

      I'm looking for a development platform for OpenCL programs under Linux, and I'm in between of Ubuntu 16.04 and Ubuntu 15.10.

      If any benchmark shows OpenCL in AMPGPU driver is very inferior to fglrx, I may have to go with 15.10.

       

      Hardware information:

      CPU: Xeon E5 2696 V4 22 core 2.2GHz

      RAM: 32GB REG ECC 2400MT/s *2

      GPU: Radeon R9 nano 4GB HBM

       

      Current operating system: Windows 7 64 bit (horrible support to new Intel Haswell-E processors and horrible GCC/LLVM compiler support, that's driving me to Linux).

       

       

       

      Thanks,

      Bo Gao

        • Re: Ubuntu 16.04 open source driver OpenCL
          Meteorhead

          Similar question: how does one install the OSS AMDGPU drivers? Fresh install of Ubuntu 16.04 on a machine with 2*R9 270X. OOB naturally there is no OpenCL drivers installed. I am fairly lost when it comes to identifying the roles of all the OSS elements. Things I find are:

           

          mnagy@radeon:~$ apt-file search /etc/OpenCL/vendors

          beignet-opencl-icd: /etc/OpenCL/vendors/intel-beignet-x86_64-linux-gnu.icd

          mesa-opencl-icd: /etc/OpenCL/vendors/mesa.icd

          nvidia-opencl-icd-304: /etc/OpenCL/vendors/nvidia.icd

          nvidia-opencl-icd-304-updates: /etc/OpenCL/vendors/nvidia.icd

          nvidia-opencl-icd-340: /etc/OpenCL/vendors/nvidia.icd

          nvidia-opencl-icd-361: /etc/OpenCL/vendors/nvidia.icd

           

          Ok, Mesa... I've heard about that. Sounded something like the collective of everything that's related to OSS graphics. Might be what I need. I am sure however I will be needing the AMDGPU driver. Let's check:

           

          mnagy@radeon:~$ apt-cache search amdgpu

          xserver-xorg-video-amdgpu - X.Org X server -- AMDGPU display driver

          libdrm-amdgpu1 - Userspace interface to amdgpu-specific kernel DRM services -- runtime

          libdrm-amdgpu1-dbg - Userspace interface to amdgpu-specific kernel DRM services -- debugging symbols

          xserver-xorg-video-amdgpu-dbg - X.Org X server -- AMDGPU display driver (debugging symbols)

           

          Ok, the history of X and fglrx is too long and too sad. The latest fglrx drivers started to break free from the clutches of X, but still not there yet. I was hoping that AMDGPU is finally nothing, but a kernel module and the user-space bindings. Long story short, how does one install everything needed to get started with an R9 270X and the open-source OpenCL stack?

            • Re: Ubuntu 16.04 open source driver OpenCL
              Meteorhead

              Because the system is looking for a reinstall anyway (I have not yet given up upon Ubuntu 16.04), I have gone ahead and installed the Mesa ICD package, hoping it will drag in anything it needs to work. Well, sort of: (apology for the localized console, I am a patriot in this regard, but you've all seen apt-get messages)

               

              mnagy@radeon:~$ sudo apt-get install mesa-opencl-icd

              [sudo] mnagy jelszava:

              Csomaglisták olvasása... Kész

              Függőségi fa építése

              Állapotinformációk olvasása... Kész

              A következő további csomagok lesznek telepítve:

                libclang-common-3.7-dev libclc-amdgcn libclc-dev libclc-r600 libdrm-amdgpu1 libdrm-nouveau2

                libdrm-radeon1 libllvm3.7 libllvm3.8

              Az alábbi ÚJ csomagok lesznek telepítve:

                libclang-common-3.7-dev libclc-amdgcn libclc-dev libclc-r600 libdrm-amdgpu1 libdrm-nouveau2

                libdrm-radeon1 libllvm3.7 libllvm3.8 mesa-opencl-icd

              0 frissített, 10 újonnan telepített, 0 eltávolítandó és 0 nem frissített.

              Letöltendő adatmennyiség: 40,8 MB.

              A művelet után 183 MB lemezterület kerül felhasználásra.

              Folytatni akarja? [I/n] I

              Letöltés:1 http://hu.archive.ubuntu.com/ubuntu xenial/universe amd64 libllvm3.7 amd64 1:3.7.1-2ubuntu2 [9.329 kB]

              Letöltés:2 http://hu.archive.ubuntu.com/ubuntu xenial/universe amd64 libclang-common-3.7-dev amd64 1:3.7.1-2ubuntu2 [274 kB]

              Letöltés:3 http://hu.archive.ubuntu.com/ubuntu xenial/main amd64 libdrm-amdgpu1 amd64 2.4.67-1 [16,4 kB]

              Letöltés:4 http://hu.archive.ubuntu.com/ubuntu xenial/main amd64 libdrm-nouveau2 amd64 2.4.67-1 [16,3 kB]

              Letöltés:5 http://hu.archive.ubuntu.com/ubuntu xenial/main amd64 libdrm-radeon1 amd64 2.4.67-1 [21,5 kB]

              Letöltés:6 http://hu.archive.ubuntu.com/ubuntu xenial-updates/main amd64 libllvm3.8 amd64 1:3.8-2ubuntu3 [10,3 MB]

              Letöltés:7 http://hu.archive.ubuntu.com/ubuntu xenial/universe amd64 libclc-dev all 0.2.0+git20150813-2 [22,2 kB]

              Letöltés:8 http://hu.archive.ubuntu.com/ubuntu xenial/universe amd64 libclc-r600 all 0.2.0+git20150813-2 [9.352 kB]

              Letöltés:9 http://hu.archive.ubuntu.com/ubuntu xenial/universe amd64 libclc-amdgcn all 0.2.0+git20150813-2 [4.707 kB]

              Letöltés:10 http://hu.archive.ubuntu.com/ubuntu xenial/universe amd64 mesa-opencl-icd amd64 11.2.0-1ubuntu2 [6.773 kB]

              Letöltve 40,8 MB 0mp alatt (42,7 MB/s)

              ...

               

              Seems the OSS stack uses Clang/LLVM to compile kernels with a little help presumably from libclc-dev. It drags in all the user-space bindings to kernel modules, most importantly libdrm-amdgpu1 in my case (I think that's the one I will need, not radeon1 or r600).

               

              Running clinfo shows that the icd file is installed correctly, but no devices are found:

               

              mnagy@radeon:~$ clinfo
              Number of platforms                               1
                Platform Name                                   Clover
                Platform Vendor                                 Mesa
                Platform Version                                OpenCL 1.1 MESA 11.2.0
                Platform Profile                                FULL_PROFILE
                Platform Extensions                             cl_khr_icd
                Platform Extensions function suffix             MESA

                Platform Name                                   Clover
              Number of devices                                 0

              NULL platform behavior
                clGetPlatformInfo(NULL, CL_PLATFORM_NAME, ...)  Clover
                clGetDeviceIDs(NULL, CL_DEVICE_TYPE_ALL, ...)   Clover
                clCreateContext(NULL, ...) [default]            No devices found in platform
                clCreateContextFromType(NULL, CL_DEVICE_TYPE_CPU)  No devices found in platform
                clCreateContextFromType(NULL, CL_DEVICE_TYPE_GPU)  No devices found in platform
                clCreateContextFromType(NULL, CL_DEVICE_TYPE_ACCELERATOR)  No devices found in platform
                clCreateContextFromType(NULL, CL_DEVICE_TYPE_CUSTOM)  No devices found in platform
                clCreateContextFromType(NULL, CL_DEVICE_TYPE_ALL)  No devices found in platform

              ICD loader properties
                ICD loader Name                                 OpenCL ICD Loader
                ICD loader Vendor                               OCL Icd free software
                ICD loader Version                              2.2.8
                ICD loader Profile                              OpenCL 1.2
                      NOTE:   your OpenCL library declares to support OpenCL 1.2,
                              but it seems to support up to OpenCL 2.1 too.

               

              Running lspci shows that the cards are installed:

               

              mnagy@radeon:~$ lspci | grep Radeon

              05:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Curacao XT [Radeon R7 370 / R9 270X/370 OEM]

              05:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Cape Verde/Pitcairn HDMI Audio [Radeon HD 7700/7800 Series]

              06:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Curacao XT [Radeon R7 370 / R9 270X/370 OEM]

              06:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Cape Verde/Pitcairn HDMI Audio [Radeon HD 7700/7800 Series]

               

              Listing out the loaded/related kernel modules does not show amdgpu1, but radeon only.

               

              mnagy@radeon:~$ lsmod

              Module                  Size  Used by

              ...

              amdkfd                122880  1

              amd_iommu_v2           20480  1 amdkfd

              radeon               1511424  1

              i2c_algo_bit           16384  1 radeon

              ttm                    98304  1 radeon

              drm_kms_helper        139264  1 radeon

              ...

               

              What is missing to make things work? What version of OpenCL should we end up getting? (I am aware that the OSS stack lags behind significantly in both features and performance, but I was hoping for at least 1.2, and perhaps later this year catching up to 2.0, should AMD really abandon fglrx in favor of amdgpu. Or does the R9 270X fall outside the scope of amdgpu and is supported by radeon, which means that Ubuntu 16.04 will neither receive fglrx, neither will it receive attention from corporate driver developers?

               

              Sidenote: I would like to ask a moderator to move the topic over to the OpenCL space, as it's topic would suggest that it should've been posted there in the first place.

                • Re: Ubuntu 16.04 open source driver OpenCL
                  blueskull

                  I am able to get it working! Simply install mesa opencl icd, and it works, with a quirk. By default, ldconfig did not create libOpenCL.so soft link to libOpenCL.so.1, so I have to manually soft link it to make ld happy. Besides, everything works just fine.

                  For your problem, Google tells me amdgpu only supports Sea Islands and Volcanic Islands, not Southern Islands, at least not by default. From some other sources it shows amdgpu actually supports Southern Islands, but you need to enable it manually.

                  Also, I noticed clinfo tells me I have only 1GB memory, and 256MB allocatable memory. Is there a way to use all 4GB RAM? I know I can export 2 environment variables to allocate 100% VRAM to OpenCL, and allocate 100% available OpenCL RAM to a single object in fglrx, it there a similar option to set in G3D?

                  Please go ahead to moderate this topic to where it is supposed to be. I can not add a topic in OpcnCL zone, so I posted here (new account).