The error states:
error: can't enable all OpenCL extensions or unrecognized OpenCL extension
#pragma OPENCL EXTENSION cl_khr_fp64 : enable
System configuration:
Windows 7 on 64 bit
Notebook with ATI Mobility Radeon HD 5400 series
Visual Studio 2010
Drivers installed:
AMD-APP-SDK-v2.8-Windows-64
amd_catalyst_13.5_mobility_beta3
How can i solve this problem because i need to use double type in the kernel?
The directive is declared in the first kernel line.
Your GPU doesn't support double precision. This is why the OpenCL runtime is reporting it cannot enable the cl_khr_fp64 extension. If you really need double precision, try using the CPU as an OpenCL device instead and run your kernel on that.
Related
I am new in these waters. After installing aarch64 arch on several arm boards. Decided to try android x86 and then android arm.
However in documentations it says it supports nvidia through nouvaeu driver I have rtx 3060 and NV170 is not supported in nouvaeu I get it. However it should support RX 6500 XT with or without vulkan supports. That I dont get. When I boot with virtual VGA as primary and rx 6500 XT as secondary I see AMD GPU in listed in lspci output however cant make modprobe to load gpu drivers. What am I missing ? Both happens in blissOS'es and Android_X86's latest versions.
Did you make them work, should quadruple check everything ? (vga rom, binary drivers etc)
I have only tried compiling kernels using pyopencl, but I can only seem to be able to use OpenCl C. Looking at clinfo, I only see support for CLC listed, heres some truncated output from my pc:
Platform Name AMD Accelerated Parallel Processing
Platform Vendor Advanced Micro Devices, Inc.
Platform Version OpenCL 2.1 AMD-APP (3423.0)
Platform Profile FULL_PROFILE
Platform Extensions cl_khr_icd cl_amd_event_callback
Platform Extensions function suffix AMD
Platform Host timer resolution 1ns
Platform Name AMD Accelerated Parallel Processing
Number of devices 1
Device Name gfx1031
Device Vendor Advanced Micro Devices, Inc.
Device Vendor ID 0x1002
Device Version OpenCL 2.0
Driver Version 3423.0 (HSA1.1,LC)
Device OpenCL C Version OpenCL C 2.0
Device Type GPU
Device Board Name (AMD) AMD Radeon RX 6700 XT
Device PCI-e ID (AMD) 0x73df
Device Topology (AMD) PCI-E, 0000:2f:00.0
Device Profile FULL_PROFILE
Device Available Yes
Compiler Available Yes
Linker Available Yes
Max compute units 20
I am using a rocm driver compiled from the AUR, I tried to also install the mesa driver alongside but could not do so (perhaps I need to uninstall the other, but I dread having to recompile it if mesa fails).
My laptop (intel hd graphics) seems to support OpenCL 3.0 but also only lists CLC support. What am I missing, is this not implemented yet? I saw something somewhere about "offline compilation" and maybe using a "clc++" option with clang but can someone elaborate?
C++ for OpenCL can be used in two ways:
Online compilation
If OpenCL device supports cl_ext_cxx_for_opencl, it is possible to compile a program written using the C++ for OpenCL kernel language in runtime. Applications may pass -cl-std=CLC++ to clCompileProgram and clBuildProgram for programs created using clCreateProgramFromSource to request the program be built as C++ for OpenCL.
Offline compilation
If OpenCL device allows to create the program with SPIR-V, then it is possible to compile C++ for OpenCL source into intermediate LLVM IR:
clang -c -cl-std=clc++ -target spir64 -O3 -emit-llvm -o test.ll test.clcpp
Next, LLVM IR can be translated into SPIR-V using llvm-spirv:
llvm-spirv test.ll -o test.spv
Finally, OpenCL program can be created using clCreateProgramWithIL call:
std::ifstream il_file("test.spv", std::ios::binary);
std::vector<char> il_buffer;
std::copy(std::istreambuf_iterator<char>(il_file),
std::istreambuf_iterator<char>(),
std::back_inserter(il_buffer));
cl_program program =
clCreateProgramWithIL(context, il_buffer.data(), il_buffer.size(), &ret);
For PyOpenCL:
with open('test.spv', 'rb') as il_file:
il_buffer = bytes(il_file.read())
prg = cl.Program(ctx, il_buffer)
To check that OpenCL device supports SPIR-V modules, you need to use CL_DEVICE_IL_VERSION query in OpenCL 2.1 or newer and the CL_DEVICE_ILS_WITH_VERSION query in OpenCL 3.0 or newer.
For additional information about offline compilation please see Offline Compilation of OpenCL Kernels into SPIR-V Using Open Source Tooling article.
I am going to compile a chunk of codes which needs OpenCL 1.2. As I understood, nVIDIA has released OpenCL 1.2 driver. I have installed the latest CUDA Toolkit which is version 7.0. But when I compiled then code, I got errors like:
Error 9 error LNK2001: unresolved external symbol clReleaseDevice C:\Users\???\Downloads\FireRaysSDK-1.0\FireRaysSDK-1.0\App\CLW64.lib(CLWParallelPrimitives.obj) App
Error 7 error LNK2001: unresolved external symbol clRetainDevice C:\Users\???\Downloads\FireRaysSDK-1.0\FireRaysSDK-1.0\App\CLW64.lib(CLWContext.obj) App
After that I download the header files from khronos website for OpenCL 1.2. Now, it compiles but I am getting unresolved external link to these functions as their implementation is not in OpenCL.lib.
Is there any OpenCL.lib that I can use to compile OpenCL 1.2 codes? Is there any way to get their implementation from DLL files? Because as I know nvidia has added the opencl 1.2 support to its driver.
You are correct that NVIDIA now provide OpenCL 1.2 support in their latest drivers, but the CUDA 7.0 SDK was released sometime before these drivers were shipped, and so may not contain OpenCL 1.2 headers or libraries. I've just checked the CUDA 7.5 Release Candidate and it appears to ship with the OpenCL 1.2 library that you need.
You can link against any OpenCL 1.2 library, and it should work with NVIDA's drivers. You should just be able to install an SDK from AMD or Intel, or just download and build the OpenCL 1.2 Installable Client Driver (ICD) Loader directly from Khronos.
I have installed intel opencl sdk in windows 8. All the files are located as they have to according to user guide but whenever I am trying to compile any code it is showing error that Cl/cl.h not found. Also, the user manual says that application needs to be linked to the libraries , but that option is nowhere to be found in the IDE.
This is the error I am getting at console
Setting target instruction set architecture to: Default (Advanced Vector Extension (AVX))
OpenCL Intel CPU device was found!
Device name: Intel(R) Core(TM) i5-3210M CPU # 2.50GHz
Device version: OpenCL 1.2 (Build 82248)
Device vendor: Intel(R) Corporation
Device profile: FULL_PROFILE
Compilation started
1:2:9: fatal error: 'CL/cl.h' file not found
Compilation failed
Build failed!
Any help would be welcomed...Thanks
I guess you have not configured your visual studio for OpenCL.
Check whether INTELOCLSDKROOT is got added in environment variable if not add it or else
configure visual studio to find header file and openCL library files.
Configuring visual studio ->
CL Header file
Properties -> All Configurations -> Configuration Properties-> C/C++ -> General -> Additional Include Directories -> SPECIFY_THE_PATH_OF_CL_INCLUDE_DIRECTORY
Linking CL Library
Properties -> All Configurations -> Configuration Properties-> C/C++ -> Linker -> General -> Additional Dependencies ->SPECIFY_THE_PATH_OF_CL_LIBRARY_BASED_ON_64/32_BIT_MACHINE
in linker -> input -> add OpenCL.lib
you will need to install the OpenCL runtime, it is another file other than the SDK file
This is OpenCL runtime 64-bit link
I get the error CL_DEVICE_NOT_AVAILABLE when running this sample code. However, unlike in that question, my CPU, the Intel Core 2 Duo E8500 CPU, appears to be supported. I've made sure to link against the Intel version of the OpenCL libraries, since I also have the Nvidia libraries installed. Why is this error occurring?
The Intel OpenCL SDK 2013 required SSE 4.2. From what I can tell (here) the Intel Core 2 Duo E8500 CPU only has SSE 4.1
"CL_DEVICE_NOT_AVAILABLE" is the error you get when you try to create an OpenCL device on an unsupported CPU.
The good news for you is that the Intel OpenCL SDK 2012 works on SSE 4.1; you should uninstall the 2013 SDK and use the 2012 SDK instead (or get a newer CPU).
"CL_DEVICE_NOT_AVAILABLE" has nothing to do with the SDK. It's due to the OpenCL device driver which is part of the video card device driver.
It's common to confuse the SDK and the OpenCL device driver. You develop the host code with the SDK but the kernel is compiled and run through the device driver. I often develop with the Intel SDK but I run my kernels on the CPU using the Intel video driver or the AMD Radeon drivers and on the GPU using the Nvidia video drivers (GTX590). I have all three video drivers installed in Windows. You don't have to have an AMD video card to instal the Radeon drivers.
So in your case you can use the AMD drivers to run your kernel on the CPU. They are much less restrictive than Intel's.
On windows I get faster results running my Kernel on my Sandy Bridge CPU using the Intel OpenCL drivers than AMD. However, on Linux the AMD driver runs my kernel faster on my Intel CPU than the Intel driver does.
I encountered this error while creating a tutorial on how to install hashcat on Ubuntu 18.04; I've included the instructions below for Installing OpenCL™ Runtimes for Intel® Processors - Option A (Recommended)- feel free to review my full gist on GitHub. Hope that helps!
Installing OpenCL™ Runtimes for Intel® Processors
Installing OpenCL™ Runtimes for Intel® Processors - Option A (Recommended)
Check your CPU system processor architecture by running sudo lscpu to identify the class of CPU e.g. "Intel (R) Core (TM) i7-7700 CPU # 3.60Ghz"- alternatively, you can go to Settings > Details which will also reveal the CPU-family (e.g. Intel (R) HD Graphics 630 (Kaby Lake GT2)).
Go to the Intel Developer Zone and scroll down to the corresponding download link for your system; assuming you're running Ubuntu 18.04 and have a Intel Core-class CPU, scroll down to "Linux* OS Ubuntu* 16.04.x (deb)" and click on the Github link for 18.46.11837 Runtimes to access the runtime-packages to download.
There should be instructions within the aforementioned Github repo- or you can proceed with the following in the next steps.
cd ~/Desktop
mkdir neo
cd neo
sudo wget https://github.com/intel/compute-runtime/releases/download/18.46.11837/intel-gmmlib_18.4.0.348_amd64.deb
wget https://github.com/intel/compute-runtime/releases/download/18.46.11837/intel-igc-core_18.44.1060_amd64.deb
wget https://github.com/intel/compute-runtime/releases/download/18.46.11837/intel-igc-opencl_18.44.1060_amd64.deb
wget https://github.com/intel/compute-runtime/releases/download/18.46.11837/intel-opencl_18.46.11837_amd64.deb
Install the packages by running sudo dpkg -i *.deb.
Restart the system by running sudo reboot.
Installing OpenCL™ Runtimes for Intel® Processors - Option B
Go to Intel OpenCL Runtimes website and scroll down to the bottom of the page to Download Intel CPU Runtime for OpenCL Applications 18.1 for LINUX OS (64-bit only).
After downloading the OpenCL Runtimes for Intel Processors, cd ~/Downloads
Run sudo tar -xzf l_opencl_p_18.1.0.013.tgz to unpack the tgz file- please note, the OpenCL file version may update since the time as of this gist (ie as of this gist, the version is 18.1.0.013.)
cd l_opencl_p_18.1.0.013
Run sudo ./install.sh
A welcome screen is prompted- hold-down the "Enter" key until able to input select "2" for "I do NOT consent to the collection of my Information"
Hit "1"
Hit "1"
Hit "Enter" and then restart the computer.
If any additional Intel OpenCL errors are encountered after testing hashcat, go to section 'Installing OpenCL™ Runtimes for Intel® Processors - B'- if not, proceed with section "Testing Hashcat"