Closed merlinzone closed 7 years ago
Please do not Install AMDAPPSDK-3.0 on OpenCL ROCm, when you install rocm-opencl-dev this install the header files you need for development.
The issue is AMDAPPSDK-3.0 install the wrong headers.
All the files you need are in /opt/rocm/opencl/ for compiling and executing your application.
Thanks. but I delete AMDAPPSDK-3.0 and tried compile opencl code with ”-L/opt/rocm/opencl/lib/x86_64 -lOpenCL”, get the same error "Error getting OpenCL Platform Count: OpenCL Error -1001: (caldgemm_opencl.cpp: 498)" clGetPlatformIDs(0, NULL, &num_platforms) -1001 | CL_PLATFORM_NOT_FOUND_KHR | clGetPlatform | No valid ICDs found I think maybe rocm opencl driver issue. I want to install the hpl-gpu https://github.com/davidrohr/caldgemm
Here started guide on ussing OpenCL on ROCm. https://rocm.github.io/QuickStartOCL.html.
Overview ROCm 1.6 introduces big updates to our OpenCL compiler and runtime implementation – built on top of the ROCm software stack! This developer release includes the following: OpenCL 2.0 compatible kernel language support with OpenCL 1.2 compatible runtime OpenCL compiler also has assembler and disassembler support, inline assembly support is now in place. Big improvements in the base compiler as we roll in new optimization for application in new Native LLVM code generator. We made our base compiler intrinsics source code available OCML https://github.com/RadeonOpenCompute/ROCm-Device-Libs/blob/master/doc/OCML.md Source code for the Intrinsic https://github.com/RadeonOpenCompute/ROCm-Device-Libs/tree/master/opencl/src Supports offline ahead of time compilation and in-process/in-memory compilation. Binary Package support for Ubuntu 16.04 and Fedora 24 Quickstart Instructions Here’s a simple workflow to get you quickly up and running with OpenCL on ROCm – Install the ROCm OpenCL implementation (assuming you already have the ‘rocm’ package installed):
sudo apt-get install rocm-opencl-dev For a sample OpenCL application, let’s use a simple vector-add example from the University of Bristol’s very nice “Hands On OpenCL” lectures.
git clone https://github.com/HandsOnOpenCL/Exercises-Solutions.git
cd Exercises-Solutions/Exercises/Exercise02/C
make \ CCFLAGS="-I$OPENCL_ROOT/include/opencl1.2 -O3 -DDEVICE=CL_DEVICE_TYPE_DEFAULT" \ LIBS="-L$OPENCL_ROOT/lib/x86_64 -lOpenCL -lm"
./vadd Not for all your application that supported the AMDGPU SDK for OpenCL to get the Header, rocm-opencl-dev now included the headerfiles.
If your built all your code with the AMDAPPSDK you do not need to download anything else, you can just export envrioment varible to /opt/rocm/opencl Do not install the AMDAPPSDK 3.0 on ROCm OpenCL it designed for old driver which need headers installed. rocm-opencl-dev package does this for you.
Example 1 for AMDAPPSDKROOT
export AMDAPPSDKROOT=/opt/rocm/opencl Example 2 for AMDAPPSDK
export AMDAPPSDK=/opt/rocm/opencl Where is clinfo?
/opt/rocm/opencl/bin/x86_64/clinfo That’s it! Super easy.
Related Resources ROCm Developer website will have more information: http:/rocm.github.io
University of Bristol’s “Hands On OpenCL” course webpage: https://handsonopencl.github.io/
many thanks ubuntu 16.04.2,rocm 1.6,R9 Nano GPU. have apt-get install rocm, rocm-dev,rocm-opencl,rocm-opencl-dev Hands On OpenCL compilation passed. I tried /opt/rocm/opencl/bin/x86_64/clinfo
terminate called after throwing an instance of 'cl::Error' what(): clGetPlatformIDs Aborted (core dumped)
Use sudo clinfo
I have tried HandsOnOpenCL clGetPlatformIDs function, all passed. https://github.com/HandsOnOpenCL/Exercises-Solutions/search?utf8=✓&q=clGetPlatformIDs&type= I add code to caldgemm_opencl.cpp: **#ifndef DEVICE
Then error 1001 disappear, but no gpu opencl device available, only cpu opencl device.
Current CPUs which support PCIe Gen3 + PCIe Atomics are: Intel Xeon E5 v3 or newer CPUs; Intel Xeon E3 v3 or newer CPUs; Intel Core i7 v3, Core i5 v3, Core i3 v3 or newer CPUs (i.e. Haswell family or newer). AMD Ryzen CPUs;
want to build caldgemm opencl version(https://github.com/davidrohr/caldgemm),use /opt/rocm/opencl system:16.04.2 rocm 1.6
vega10 platform: cpu is Xeon(R) CPU E5-2680 v3 recognize gpu but no cpu,No CPU OpenCL device
r9 nano platform: cpu is i5-6400 recognize cpu but no gpu,No available gpu
ROCm 1.6, Ubuntu 16.04.2. compile opencl code with ”-L/opt/rocm/opencl/lib/x86_64 -lOpenCL”, get error "Error getting OpenCL Platform Count: OpenCL Error -1001: (caldgemm_opencl.cpp: 498)"
1001 error code: -1001 | CL_PLATFORM_NOT_FOUND_KHR | clGetPlatform | No valid ICDs found
I have tried compile the code with "/opt/AMDAPPSDK-3.0/lib/x86_64/sdk -lOpenCL", the error is same 1001.
I have passed the opencl sdk test with "/opt/AMDAPPSDK-3.0/lib/x86_64/sdk -lOpenCL"