当前位置:   article > 正文

Install OpenCL for Intel CPU+GPU and AMD 5900x CPU on Ubuntu 20.04_ubuntu20.04 intel-cpu-opencl-runtime

ubuntu20.04 intel-cpu-opencl-runtime

POCL 1.7 Website

http://portablecl.org/docs/html/install.html#clang-llvm-notes
https://github.com/pocl/pocl/blob/master/doc/sphinx/source/install.rst

OpenCL API Headers

Install OpenCL runtime for Intel GPU on Ubuntu 20.04

NEO in Linux
NEO is available for installation on Ubuntu* 20.04:

sudo apt install intel-opencl-icd  #Install NEO OpenCL runtime for Intel GPU
sudo apt install opencl-headers  #Install OpenCL API Headers
sudo apt install ocl-icd-opencl-dev #To generate libOpenCL.so 
sudo apt install clinfo
  • 1
  • 2
  • 3
  • 4

Setup

Install LLVM-10 and Clang-10

sudo apt install cmake cmake-gui git llvm-10 llvm-10-dev llvm-10-examples  llvm-10-runtime llvm-10-tools lldb-10 liblldb-10-dev liblldb-10 libclang1-10 libclang-cpp10-dev libclang-cpp10 libclang-common-10-dev libclang-10-dev clangd-10  clang-tools-10   clang-format-10 clang-10-doc clang-10-examples
sudo apt install clang-10 libclang-10-dev libllvm-10-ocaml-dev libclang-cpp10 libclang-cpp10-dev
sudo apt install -y libclang-cpp10-dev libclang-cpp10  llvm-10-dev
sudo apt install -y build-essential ocl-icd-libopencl1 pkg-config ninja-build ocl-icd-libopencl1 ocl-icd-dev ocl-icd-opencl-dev libhwloc-dev zlib1g zlib1g-dev clinfo dialog apt-utils libxml2-dev
  • 1
  • 2
  • 3
  • 4


POCL 1.7 Website
http://portablecl.org/docs/html/install.html#clang-llvm-notes
https://github.com/pocl/pocl/blob/master/doc/sphinx/source/install.rst

Setup
Install LLVM-10 and Clang-10
sudo apt install cmake cmake-gui git llvm-10 llvm-10-dev llvm-10-examples llvm-10-runtime llvm-10-tools lldb-10 liblldb-10-dev liblldb-10 libclang1-10 libclang-cpp10-dev libclang-cpp10 libclang-common-10-dev libclang-10-dev clangd-10 clang-tools-10 clang-format-10 clang-10-doc clang-10-examples
sudo apt install clang-10 libclang-10-dev libllvm-10-ocaml-dev libclang-cpp10 libclang-cpp10-dev
sudo apt install -y libclang-cpp10-dev libclang-cpp10 llvm-10-dev
sudo apt install -y build-essential ocl-icd-libopencl1 pkg-config ninja-build ocl-icd-libopencl1 ocl-icd-dev ocl-icd-opencl-dev libhwloc-dev zlib1g zlib1g-dev clinfo dialog apt-utils libxml2-dev

Install LLVM-12 and Clang-12

Troubles

  • #如果clinfo未找到某OpenCL platform or OpenCL devices,则需将相应的OpenCL platform/device的*.icd文件复制到/etc/OpenCL/vendors目录下,即可执行下列步骤
    sudo mkdir -pv /etc/OpenCL/vendors/
    sudo cp /usr/local/etc/OpenCL/vendors/pocl.icd /etc/OpenCL/vendors/
# To the issue "Number of platforms   0", you should do the following configuration
# Manual configuration: Create a file /etc/OpenCL/vendors/VC4CL.icd with a single line containing the absolute path to the VC4CL library (/usr/local/lib/libVC4CL.so).
执行vi .bashrc,弹出profile文本文件,在最后加入下面的代码
export LD_PRELOAD=/usr/local/lib/libVC4CL.so
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
source .bashrc
clinfo


- OpenCL reported version different between `Device Version` and `Device OpenCL C Version`
NVIDIA has recently announced OpenCL 3.0 support for their graphics cards. I have installed clinfo tool that displays all information regarding OpenCL platforms and devices. When I run it, it dislpays:
```bash
Number of devices                                 1
  Device Name                                     NVIDIA GeForce GTX 1080 Ti
  Device Vendor ID                                0x10de
  Device Version                                  OpenCL 3.0 CUDA
  Driver Version                                  470.57.02
  Device OpenCL C Version                         OpenCL C 1.2 
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18

What is the difference between Device version & Device OpenCL C version? Will I be able to run OpenCL 3.0 code on my card or it just still support OpenCL 1.2 specs?
A: According to the clGetDeviceInfo specification:
CL_DEVICE_OPENCL_C_VERSION is the highest OpenCL C language version that the compiler supports for this device.
CL_DEVICE_VERSION is the OpenCL version supported by the device.
So even though your 1080 Ti supports OpenCL 3.0, you can only compile OpenCL 1.2 code. Note that OpenCL 3.0 basically is identical to OpenCL 1.2 but with better support for optional OpenCL 2.x features. With the lates driver Nvidia has added a few new OpenCL 2.x features, but still has no full 2.x support.

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小小林熬夜学编程/article/detail/386606
推荐阅读
相关标签
  

闽ICP备14008679号