Quantcast
Channel: Intel® Software - OpenCL*
Viewing all 1182 articles
Browse latest View live

Run security_barrier_camera_demo error

$
0
0

Hi:

I use security_barrier_camera_demo to RUN 

has some error below 

My version is latest version  "l_openvino_toolkit_p_2019.1.144"

 

Edwin :~/inference_engine_samples_build/intel64/Release$ ./security_barrier_camera_demo -i /opt/intel/openvino/deployment_tools/demo/car_1.bmp -m /opt/intel/openvino/intel_models/
[ INFO ] InferenceEngine: 
    API version ............ 1.6
    Build .................. custom_releases/2019/R1.1_28dfbfdd28954c4dfd2f94403dd8dfc1f411038b
[ INFO ] Parsing input parameters
[ INFO ] Capturing video streams from the video files or loading images
[ INFO ] Files were added: 1
[ INFO ]     /opt/intel/openvino/deployment_tools/demo/car_1.bmp
[ INFO ] Number of input image files: 1
[ INFO ] Number of input video files: 0
[ INFO ] Number of input channels: 1
[ INFO ] Display resolution: 1920x1080
[ INFO ] Vehicle Attribs detection DISABLED
[ INFO ] License Plate Recognition detection DISABLED
[ INFO ] Loading plugin CPU

    API version ............ 1.6
    Build .................. 23780
    Description ....... MKLDNNPlugin
[ INFO ] Loading network files for VehicleDetection
[ ERROR ] Error loading xmlfile: /opt/intel/openvino/intel_models/, File was not found at line: 1 pos: 0

How should I do??

Thank you!
 


OpenCL CPU Drivers Bug

$
0
0

Hello,

Overview:
I am running a SYCL kernel where I render/raytrace ~500 sphere objects on a 1200x800 image framebuffer size, so work items = 1200 * 800 and work group size = 8 * 8.
This runs perfectly on my iGPU (HD Graphics 530). However, when I tried to run it on the CPU (Core i7-6700K), I get an **internal compiler error**.

Note #1: I am not trying to access memory in constant address space since I've had an issue with this on intel CPUs before (possibly due to large sizes).

Note #2: Interestingly enough, I am successful when I run the kernel with a lot less spheres thrown in the computation.

Flow of the program compilation and execution:

source -> codeplay's compute++ -> spir -> raytracer -> intel opencl driver -> crash

The crash is caused when running the program on intel cpu caused by the intel opencl runtimes.
I have also tested on a mobile i7 8550U CPU, where the program crashes as well, but runs fine on the SoC's iGPU (HD Graphics 620). Basically, the same behaviour and output.

Output from the compiler:

Stack dump:
0. Running pass 'Intel OpenCL Vectorizer' on module 'main'.
1. Running pass 'Intel OpenCL VectorizerCore' on function ''
2. Running pass 'PacketizeFunction' on function ''
Segmentation fault (core dumped)

And more specific:

**Internal compiler error** Cannot select: 0x28f5920: v8f32 = vselect 0x296c260, 0x2968288, 0x28f6278
  0x296c260: v8f32,ch = CopyFromReg 0x1255fc8, Register:v8f32 %700
    0x296c0c0: v8f32 = Register %700
  0x2968288: v8f32 = bitcast 0x28f5b90
    0x28f5b90: v8i32 = BUILD_VECTOR Constant:i32<0>, Constant:i32<0>, Constant:i32<0>, Constant:i32<0>, Constant:i32<0>, Constant:i32<0>, Constant:i32<0>, Constant:i32<0>
      0x296dc00: i32 = Constant<0>
      0x296dc00: i32 = Constant<0>
      0x296dc00: i32 = Constant<0>
      0x296dc00: i32 = Constant<0>
      0x296dc00: i32 = Constant<0>
      0x296dc00: i32 = Constant<0>
      0x296dc00: i32 = Constant<0>
      0x296dc00: i32 = Constant<0>
  0x28f6278: v8f32,ch = CopyFromReg 0x1255fc8, Register:v8f32 %874
    0x29332a0: v8f32 = Register %874
In function: SYCL_class_kernels__render_kernel_1200__800__10__488_
Please report the issue on Intel OpenCL forum
https://software.intel.com/en-us/forums/opencl for assistance.
 Stack dump:
0.  Running pass 'Function Pass Manager' on module 'main'.
1.  Running pass 'X86 DAG->DAG Instruction Selection' on function ''

And a backtrace from gdb:

Thread 1 "sycl-rayt" received signal SIGSEGV, Segmentation fault.
0x00007ffee2775308 in llvm::VectorType::get(llvm::Type*, unsigned int) ()
   from /opt/intel/system_studio_2019/opencl_compilers_and_libraries_18.1.0.013/linux/compiler/lib/intel64_lin/libOclCpuBackEnd.so
(gdb) bt
#0  0x00007ffee2775308 in llvm::VectorType::get(llvm::Type*, unsigned int) ()
   from /opt/intel/system_studio_2019/opencl_compilers_and_libraries_18.1.0.013/linux/compiler/lib/intel64_lin/libOclCpuBackEnd.so
#1  0x00007ffee25aa3f5 in intel::PacketizeFunction::createDummyVectorVal (this=this@entry=0xe86930,
    origValue=origValue@entry=0x1c3d848, vectorVal=vectorVal@entry=0x7fffffff6d40)
    at /netbatch/donb41412_00/runDir/93/20180921_000000/llvm/projects/opencl/backend/vectorizer/Packetizer/PacketizerInstData.cpp:368
#2  0x00007ffee25ab22e in intel::PacketizeFunction::obtainVectorizedValue (this=this@entry=0xe86930,
    retValue=retValue@entry=0x7fffffff6d40, origValue=0x1c3d848, origInst=origInst@entry=0x1d190e8)
    at /netbatch/donb41412_00/runDir/93/20180921_000000/llvm/projects/opencl/backend/vectorizer/Packetizer/PacketizerInstData.cpp:144
#3  0x00007ffee25a2f5c in intel::PacketizeFunction::packetizeInstruction (this=this@entry=0xe86930,
    SI=0x1d190e8)
    at /netbatch/donb41412_00/runDir/93/20180921_000000/llvm/projects/opencl/backend/vectorizer/Packetizer/Packetizer.cpp:2659
#4  0x00007ffee25a6691 in intel::PacketizeFunction::dispatchInstructionToPacketize (
    this=this@entry=0xe86930, I=0x1d190e8)
    at /netbatch/donb41412_00/runDir/93/20180921_000000/llvm/projects/opencl/backend/vectorizer/Packetizer/Packetizer.cpp:695
#5  0x00007ffee25a751c in intel::PacketizeFunction::runOnFunction (this=0xe86930, F=...)
    at /netbatch/donb41412_00/runDir/93/20180921_000000/llvm/projects/opencl/backend/vectorizer/Packetizer/Packetizer.cpp:234
#6  0x00007ffee274cf83 in llvm::FPPassManager::runOnFunction(llvm::Function&) ()
   from /opt/intel/system_studio_2019/opencl_compilers_and_libraries_18.1.0.013/linux/compiler/lib/intel64_lin/libOclCpuBackEnd.so
#7  0x00007ffee274d07e in llvm::legacy::FunctionPassManagerImpl::run(llvm::Function&) ()
   from /opt/intel/system_studio_2019/opencl_compilers_and_libraries_18.1.0.013/linux/compiler/lib/intel64_lin/libOclCpuBackEnd.so
#8  0x00007ffee274d4e1 in llvm::legacy::FunctionPassManager::run(llvm::Function&) ()
   from /opt/intel/system_studio_2019/opencl_compilers_and_libraries_18.1.0.013/linux/compiler/lib/intel64_lin/libOclCpuBackEnd.so
#9  0x00007ffee2584ff0 in intel::VectorizerCore::runOnFunction (this=0x1ad9100, F=...)
    at /netbatch/donb41412_00/runDir/93/20180921_000000/llvm/projects/opencl/backend/vectorizer/Utils/VectorizerCore.cpp:347
#10 0x00007ffee274cf83 in llvm::FPPassManager::runOnFunction(llvm::Function&) ()
   from /opt/intel/system_studio_2019/opencl_compilers_and_libraries_18.1.0.013/linux/compiler/lib/intel64_lin/libOclCpuBackEnd.so
#11 0x00007ffee274d07e in llvm::legacy::FunctionPassManagerImpl::run(llvm::Function&) ()
   from /opt/intel/system_studio_2019/opencl_compilers_and_libraries_18.1.0.013/linux/compiler/lib/intel64_lin/libOclCpuBackEnd.so
#12 0x00007ffee274d4e1 in llvm::legacy::FunctionPassManager::run(llvm::Function&) ()
   from /opt/intel/system_studio_2019/opencl_compilers_and_libraries_18.1.0.013/linux/compiler/lib/intel64_lin/libOclCpuBackEnd.so
#13 0x00007ffee2580fae in intel::Vectorizer::runOnModule (this=0x1b7e4b0, M=...)
    at /netbatch/donb41412_00/runDir/93/20180921_000000/llvm/projects/opencl/backend/vectorizer/VolcanoWrapper/Main.cpp:148
#14 0x00007ffee274d92e in llvm::legacy::PassManagerImpl::run(llvm::Module&) ()
   from /opt/intel/system_studio_2019/opencl_compilers_and_libraries_18.1.0.013/linux/compiler/lib/intel64_lin/libOclCpuBackEnd.so
#15 0x00007ffee252cc4c in Intel::OpenCL::DeviceBackend::Optimizer::Optimize (
    this=this@entry=0x7fffffff9ac0)
    at /netbatch/donb41412_00/runDir/93/20180921_000000/llvm/projects/opencl/backend/optimizer/Optimizer.cpp:794
#16 0x00007ffee250be44 in Intel::OpenCL::DeviceBackend::Compiler::BuildProgram (
    this=this@entry=0x11148b8, pModule=pModule@entry=0x1ac87e0, pResult=pResult@entry=0x7fffffff9e20)
    at /netbatch/donb41412_00/runDir/93/20180921_000000/llvm/projects/opencl/backend/ocl_cpu_backend/Compiler.cpp:424

...

Core i7-6700K OpenCL support details:

OpenCL (Intel's OpenCL SDK):
 CL_DEVICE_VERSION                      : OpenCL 2.1
 CL_DRIVER_VERSION                      : 18.1.0.0920
 IL_VERSION                                     : SPIR-V_1.0
 SPIR_VERSION                                 : 1.2

SYCL (Codeplay's ComputeCpp):
  CL_DEVICE_NAME                          : Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
  CL_DEVICE_VENDOR                      : Intel(R) Corporation
  CL_DRIVER_VERSION                     : 18.1.0.0920
  CL_DEVICE_TYPE                            : CL_DEVICE_TYPE_CPU

ComputeCpp compiler flags:

compute++ flags - -O2;-mllvm;-inline-threshold=1000;-intelspirmetadata;-sycl-target;spir64

I also wanna say that using the same compiler, with the same cmake script.
I am inclined to think it is a bug, therefore reporting it as such and would like to know if there is a workaround to this.
If any additional information is required, please let me know.

Many thanks in advance!

Kind regards,
Georgi

gtpinrun fails with error "unsupported driver version 'intel-open'"

$
0
0

Hi there,

I want to use gtpin tool to profile my OpenCL program on HD 500 GPU. When I ran "gtpinrun latency -opencl -- my_program.exe", I got the following error:

 

GTPin ERROR !!
OCL_PROGRAM_BINARY::Read(): Unsupported driver version "intel-open"

at: /tmp_proj/gtpin/workspace/nightly-master/build-centos72-opencl/GTPin/Src/gtpin/ocl.cpp:462 Read
GTPIN WARNING: GTPin didn't find any kernels... Exiting without doing anything.

I have successfully installed Media SDK and vtune tool on my platform, with kernel version 4.14.20-mss-pv5 on ubuntu 16.04. Could you tell me how to fix it? Thanks.

Intel® SDK for OpenCL™ Applications 2017 R2

$
0
0

installer says I need it.  blog says you have it.  despite persistent, prolonged effort have been completely unable to find an actual download link

 

where -exactly- does one find "Intel® SDK for OpenCL™ Applications 2017 R2"

 

Getting Started with Application Development Using Intel® System Studio 2019 for Windows* OS host and Windows OS target

$
0
0

On a separate Windows 10 computer, I am trying to follow the Getting Started instructions:

  1. Copy the contents of the <install_dir>\samples_2019\hello_world\ directory to a writable directory on your system.Note that the default <install_dir> for the samples is [Program Files (x86)]\IntelSWTools\.

The folder "samples_2019":does not exist anywhere on my computer after installation.

Please advise.

Run pedestrian_tracker_demo error

$
0
0

Hi:
I run pedestrian_tracker_demo error
has some error below 
My version is latest version  "l_openvino_toolkit_p_2019.1.144"

$ ./pedestrian_tracker_demo -i /home/asrock/inference_engine_samples_build/intel64/persion-detection-retail-0013/PexelVideos1338590.mp4 -m_det /home/asrock/inference_engine_samples_build/intel64/persion-detection-retail-0013/person-detection-retail-0013.xml -d_det CPU -m_reid /home/asrock/inference_engine_samples_build/intel64/person-reidentification-retail-0031/person-reidentification-retail-0031.xml -d_reid CPU
InferenceEngine: 
    API version ............ 1.6
    Build .................. custom_releases/2019/R1.1_28dfbfdd28954c4dfd2f94403dd8dfc1f411038b
[ INFO ] Parsing input parameters
Loading plugin CPU

    API version ............ 1.6
    Build .................. 23780
    Description ....... MKLDNNPlugin
Segmentation fault (core dumped)

How should I do??
Thank you!
 

 

Run human_pose_estimation_demo use GPU error

$
0
0

I run human_pose_estimation_demo use GPU
has some error below 
My version is latest version  "l_openvino_toolkit_p_2019.1.144"

./human_pose_estimation_demo -i /dev/video0 -m /home/asrock/inference_engine_samples_build/intel64/human-pose-estimation-0001/human-pose-estimation-0001.xml -d GPU
InferenceEngine: 
    API version ............ 1.6
    Build .................. custom_releases/2019/R1.1_28dfbfdd28954c4dfd2f94403dd8dfc1f411038b
[ INFO ] Parsing input parameters
[ ERROR ] Cannot find plugin to use :Tried load plugin : clDNNPlugin,  error: Plugin clDNNPlugin cannot be loaded: cannot load plugin: clDNNPlugin from : Cannot load library 'libclDNNPlugin.so': libOpenCL.so.1: cannot open shared object file: No such file or directory, skipping

How should I do??
Thank you!
 

 

[ ERROR ] Demo supports topologies only with 1 input

$
0
0

When I run instance-segmentation-security-0049.xml  model

environment : ubuntu16.04

has some error below

$ ./segmentation_demo -i /home/asrock/inference_engine_samples_build/intel64/road_1.jpg -m /home/asrock/inference_engine_samples_build/intel64/instance-segmentation-security-0049/instance-segmentation-security-0049.xml -d CPU
[ INFO ] InferenceEngine: 
    API version ............ 1.6
    Build .................. custom_releases/2019/R1.1_28dfbfdd28954c4dfd2f94403dd8dfc1f411038b
[ INFO ] Parsing input parameters
[ INFO ] Files were added: 1
[ INFO ]     /home/asrock/inference_engine_samples_build/intel64/road_1.jpg
[ INFO ] Loading plugin

    API version ............ 1.6
    Build .................. 23780
    Description ....... MKLDNNPlugin
[ INFO ] Loading network files
[ INFO ] Preparing input blobs
[ ERROR ] Demo supports topologies only with 1 input


CL Device is only available when 'sudo' is used

OpenCL for Intel ATOM X5 E3930 GPU

$
0
0

Hi,

I'm using Centos 7.3 linux on ATOM X5 E3930 processor. From what I've read, it seems that the Atom X5 E3900 line of processor is not currently supported by the OpenCL SDK or the OpenCL runtimes drivers for doing work on the GPU under Linux (Only CPU supported).

Is that correct? And if so, is there a future release that may add support?

Thanks.

Yair

 

 

OpenCL samples CPU CL_INVALID_PLATFORM

$
0
0

I get the error CL_INVALID_PLATFORM if I try to run the official samples with the CPU (both my iGPU and discrete GPU work fine with those). The CPU in question is i5 7300HQ. It should support OpenCL 2.1 even, so I assume that it has something to do with the OpenCL runtime. I have installed the recommended Inte SDK for OpenCL applications. Should I have installed the CPU runtime additionally? However it refuses to install in the presence of the graphics one.

On an unrelated note, the VS integration of OpenCL somehow managed to break VS, so I had to disable it. I am unsure whether that's a known bug, but VS kept restarting until I disabled the integrated features coming with the OpenCL SDK.

ioc64 on ubuntu with NEO

$
0
0

Hello,

I want to build a simple OpenCL Kernel with ioc64 on Ubuntu 19.04. I installed the Intel OpenCL SDK and compiled the latest NEO driver with its dependencies. I can execute OpenCL Programs without any Issues. If I want to build the Assembly with:

/opt/intel/system_studio_2019/opencl-sdk/bin/ioc64 -device=gpu -input=program.cl -asm=program_clmain.gen

I get the following Output:

No command specified, using 'build' as default
Platform name: Intel(R) OpenCL HD Graphics
Device name: Intel(R) Gen9 HD Graphics NEO
Device version: OpenCL 2.1 NEO
Device vendor: Intel(R) Corporation
Device profile: FULL_PROFILE

clmain info:
    Maximum work-group size: 256
    Compiler work-group size: (0, 0, 0)
    Local memory size: 0
    Preferred multiple of work-group size: 32
    Minimum amount of private memory: 0
    Amount of spill memory used by the kernel: 0

Failed to generate ASM code: the GFX driver doesn't support disassembly code display
Build succeeded!

But the Build has not succeeded. There is no program_clmain.gen. Do I need special driver extensions to use ioc64?

install GPU ERROR

$
0
0

environment : ubuntu 16.04 

version : "l_openvino_toolkit_p_2019.1.144"

CPU : N4200

I try to install GPU but have some error as below

./install_NEO_OCL_driver.sh
Intel OpenCL graphics driver installer
Looking for previously installed user-mode driver...
dpkg-query: no packages found matching intel-opencl
dpkg-query: no packages found matching intel-ocloc
dpkg-query: no packages found matching intel-gmmlib
dpkg-query: no packages found matching intel-igc-core
dpkg-query: no packages found matching intel-igc-opencl
Installing prerequisites...
apt-get -y update
Get:1 http://security.ubuntu.com/ubuntu xenial-security InRelease [109 kB]   
Hit:2 http://us.archive.ubuntu.com/ubuntu xenial InRelease                     
Get:3 http://us.archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]    
Get:4 http://us.archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]  
Fetched 325 kB in 2s (145 kB/s)   
Reading package lists... Done
apt-get -y install libnuma1 ocl-icd-libopencl1
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libnuma1 is already the newest version (2.0.11-1ubuntu1.1).
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 kde-telepathy-minimal : Depends: kde-config-telepathy-accounts (>= 15.04.0) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
ERROR: failed to run apt-get -y install libnuma1 ocl-icd-libopencl1
Problem (or disk space)?
                sudo -E ./install_NEO_OCL_driver.sh
2. Verify that you have enough disk space, and run the script again.

 

Intel Opencl SDK serial number problem

$
0
0

Hello.

I'm trying to install the Intel OpenCK SDK for applications via command line. I set the parameter ACTIVATION_TYPE=serial_number and ACTIVATION_SERIAL_NUMBER to the serial number I received. However, I get this error:

Activation rights do not allow this software to be installed. This could be due
to expired subscription, incompatible serial number, or unavailable Intel(R)
Software License Manager.
--------------------------------------------------------------------------------

 

The serial number I'm using is active, according to my serial number management panel and I typed it properly (I copy-pasted it). Any ideas on how to solve this?

 

OpenCL 18.1 CPU Runtime Sha1

$
0
0

Hello,

I'm in the process of setting up the OpenCL 18.1 CPU Runtime on Linux. However, I noticed that the SHA1 of the file I downloaded form the Intel registration center (FileName l_opencl_p_18.1.0.015.tgz, Build Date May 07 2019) has a SHA1 of 5f2fa6e6bc400ca04219679f89ec289f17e94e5d.

This is in contrast to the OpenCL Runtime page at https://software.intel.com/en-us/articles/opencl-drivers which reports the SHA1 should be 31509737eecf1657fe766318307c7a8f7f676beb.

I suspect that the webpage was simply not updated after a new build, but would it be possible to confirm what the correct SHA1 should be?

Many Thanks.


Some issue about zero copy.

$
0
0

Hello, I have some doubt about the zerocopy function.

Suppose the code is something like below:

What I want to do is to zerocopy a pre-aligned memory M and transfer to a opencl function OpenCL_Foo,  and after the calculation save the result to M.

Do I still get access to M(with the right calculation result from opencl function) even after the OpenCL_Foo ends?

#or do I need to memcopy it?

Thank you in advance for you kindly help.

 

////////////////////////////////////////////
void OpenCL_Foo(float*array_as_output,int SIZE, float*array_as_output_cpy)
{//Some opencl process
...

//set the parameter array as output buffer of some calculation.
cl_mem	buffer_out = clCreateBuffer(ctx, CL_MEM_WRITE | CL_MEM_USE_HOST_PTR,SIZE * sizeof(cl_float), array_as_output, &err);
...

//is this part below necessay? or can I just access array_as_output outside this function?
/*
void* ptr1 = clEnqueueMapBuffer(queue, buffer_out , CL_TRUE, CL_MAP_READ, 0, SIZE*sizeof(float), 0, NULL, NULL, NULL);
memcpy(array_as_output_cpy,ptr1,SIZE*sizeof(float));
err=clEnqueueUnmapMemObject(queue,buffer_out , ptr1, 0, NULL, NULL);
*/


}// end of OpenCL_Foo

////////////////////////////////////////////
int main()
{
int SIZE = 1024;

float*array_as_output;
float*array_as_output_cpy;

posix_memalign((void**)&array_as_output,4096,SIZE * sizeof (cl_float));
posix_memalign((void**)&array_as_output_cpy,4096,SIZE * sizeof (cl_float));

OpenCL_Foo(array_as_output,SIZE,array_as_output_cpy);

...
}//end of main

 

Code builder : when i enable API debug, then can't find intel platform.

$
0
0

Today ,when I prepare to debug the kernel using code builder tool, I enable the API debug . 

As  a  result , the clGetPlatformIDs API don't found the Intel platform, but it can found the Nvidia platform.

Because I mainly use the Intel platform , so please give me a hand .

 

Thanks a lot.

 

PC: Intel i7-8700, UHD 630,

VS2017, opencl sdk 2017.

Many install issues - why so complicated?

$
0
0

I've been trying to get your software set up on two machines. No success on either, didn’t expect a simple SDK install to take two days. 

One is a 2 chip xeon server and the other a laptop with a latest gen i9. Many different issues (does anyone test this stuff before the release it?)

On the laptop visual studio integration does not work. I’ve tried uninstalling and installing a few times now. Rebuilt VS etc. etc. same issue:

Get the error on startup that intelcommonpkg did not load correctly

Ativaty log says: “SetSite failed for package [IntelCommonPkg]Source: 'Intel.CommonTools' Description: Could not load file or assembly 'Intel.Misc.Utilities, Version=19.0.16.0, Culture=neutral, PublicKeyToken=5caa3becd8c4c9ee' or one of its dependencies”

After Installing the opencl driver on both machines it’s not recognized by the SDK install, laptop says for me to manually install, followed your crazy regedit, copy DLL manual instructions and still not recognizing driver on install…. How to fix this?

Was looking to port CUDA code to OpenCL but this is starting to look like a bad idea.

 

OpenCL Tools for Visual Studio

$
0
0

I use Visual Studio 2019 and Intel System Studio 2019 Update4 on windows 10. 
My machine has Intel Core i7-6700K CPU, Intel® HD Graphics 530 and AMD discrete graphics card
(AMD FirePro W7100). 
My display is connected to AMD discrete card, it is therefore possible to debug OpenCL kernel with only one machine.
I have few questions:
Does Intel OpenCL™ Tools for Visual Studio work with Visual Studio 2019?
Does GPU Kernel Debugger on Microsoft Windows* OS work with Visual Studio 2019?
Actually I need recommendations for debugging OpenCL kernel on Windows 10 OS. ( for Intel and AMD) 
Please Advice,
Thanks,
Micha

OpenCL.lib is missing

$
0
0

Good evening,

 

I'm new to the forum and the hole OpenCL development. i installed the intel sdk intelFPGA_lite v 18.1. I'm using VS 2019.

it gave me this error :

 // ConsoleApplication3.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#define CL_USE_DEPRECATED_OPENCL_1_2_APIS
#include <stdlib.h>
#include <stdio.h>
#include "CL/opencl.h"
#define QTE_DONNEES 60
int main(int argc, const char* argv[])
{
	// Variables pour la Plateforme de travail
	cl_platform_id  plateformeID;
	cl_uint qtePlateformes;
	cl_int  codeErreur;



	// Variables pour les périphériques contenant des unités de calcul
	cl_device_id    TOUS_peripheriqueID;
	cl_uint TOUS_qtePeripheriques;


	// Variables pour les contextes de travail
	cl_context  contexte;
	cl_context_properties   proprietes[3];


	// Variable pour les files d'exécution des commandes
	cl_command_queue    file_execution;

	// Variable pour la fonction à paralléliser
	cl_program  programme;

	const char* maFonctionAuCarre = {
		"__kernel void auCarre(__global int *input, __global int *output)\n""{\n""int id = get_global_id(0);\n""output[id] = input[id] * input[id];""}\n"
	};
	// Variable pour le noyau qui exécutera
	// le programme contenant la fonction parallèle.
	cl_kernel   noyau;

	// Variables qui contiendront les données.
	int* inputData;
	int* outputData;
	cl_mem  input_buffer;
	cl_mem  output_buffer;

	// Initialisation des variables de données
	inputData = (int*)malloc(QTE_DONNEES * sizeof(int));
	outputData = (int*)malloc(QTE_DONNEES * sizeof(int));
	for (int i = 0; i < QTE_DONNEES; i++) {
		inputData[i] = i;
		outputData[i] = 0;
	}
	// --------------------------------------------------------------------
	// ----------------- Fin de la section des variables ------------------
	// --------------------------------------------------------------------// Création de la plateforme de travail
	codeErreur = clGetPlatformIDs(1, &plateformeID, &qtePlateformes);
	// Rechercher les PÉRIPHÉRIQUES dans le système, tout type confondu.
	codeErreur = clGetDeviceIDs(plateformeID,
		CL_DEVICE_TYPE_ALL,
		1,
		&TOUS_peripheriqueID,
		&TOUS_qtePeripheriques);
	// Création du contexte de travail
	proprietes[0] = (cl_context_properties)CL_CONTEXT_PLATFORM;
	proprietes[1] = (cl_context_properties)plateformeID;
	proprietes[2] = 0;
	contexte = clCreateContext(proprietes,
		TOUS_qtePeripheriques,
		&TOUS_peripheriqueID,
		NULL,
		NULL,
		&codeErreur);
	// Création de la file d'exécution pour le CPU
	file_execution = clCreateCommandQueue(contexte,
		TOUS_peripheriqueID,
		0,
		&codeErreur);
	// Construire le programme avec la fonction auCarre pour le CPU
	programme = clCreateProgramWithSource(contexte,
		1,
		(const char**)& maFonctionAuCarre,
		NULL,
		&codeErreur);

	// Compilation du programme
	codeErreur = clBuildProgram(programme,
		TOUS_qtePeripheriques,
		&TOUS_peripheriqueID,
		NULL,
		NULL,
		NULL);
	if (codeErreur != CL_SUCCESS) {
		// Si erreur de compilation, alors... Affichage du LOG de compilation
		char logErreurs[4096];
		size_t longueur_Log;
		clGetProgramBuildInfo(programme,
			TOUS_peripheriqueID,
			CL_PROGRAM_BUILD_LOG,
			sizeof(logErreurs),
			logErreurs,
			&longueur_Log);
		printf("\n[IMPRESSION DU JOURNAL DE COMPILATION]\n\n");
		printf("%s\n\n", logErreurs);
		printf("[FIN DU JOURNAL]\n\n"); return 1;
	}
	// Association des variables de données avec le tampon d'échange

	input_buffer = clCreateBuffer(contexte,
		CL_MEM_READ_ONLY | CL_MEM_COPY_HOST_PTR,
		sizeof(int) * QTE_DONNEES,
		inputData,
		&codeErreur);
	output_buffer = clCreateBuffer(contexte,
		CL_MEM_WRITE_ONLY | CL_MEM_COPY_HOST_PTR,
		sizeof(int) * QTE_DONNEES,
		outputData,
		&codeErreur);
	// Construire le noyau
	noyau = clCreateKernel(programme, "auCarre", &codeErreur);
	// Associer les tampons d'échanges avec
	// les arguments des fonctions à paralléliser
	codeErreur = clSetKernelArg(noyau,
		0,
		sizeof(input_buffer),
		&input_buffer);
	codeErreur = clSetKernelArg(noyau,
		1,
		sizeof(output_buffer),
		&output_buffer);
	// Mettre le noyau dans la file d'execution
	size_t dimensions_globales[] = { QTE_DONNEES, 0, 0 };
	codeErreur = clEnqueueNDRangeKernel(file_execution,
		noyau,
		1,
		NULL,
		dimensions_globales,
		NULL,
		0,
		NULL,
		NULL);

	// Récupération des résultats dans le tampon
	clEnqueueReadBuffer(file_execution,
		output_buffer,
		CL_TRUE,
		0,
		sizeof(int) * QTE_DONNEES,
		outputData,
		0,
		NULL,
		NULL);// Affichage des résultats
	printf("\n\n\n>>>>> Affichage des resultats <<<<<");
	printf("\n\nContenu de la variable --inputData--\n");
	for (int i = 0; i < QTE_DONNEES; i++) {
		printf("%d; ", inputData[i]);
	}
	printf("\n\nContenu de la variable --outputData--\n");
	printf("Fonction --auCarre--\n");
	for (int i = 0; i < QTE_DONNEES; i++) {
		printf("%d; ", outputData[i]);
	}
	// Libération des ressources
	free(inputData);
	free(outputData);
	clReleaseMemObject(input_buffer);
	clReleaseMemObject(output_buffer);
	clReleaseProgram(programme);
	clReleaseKernel(noyau);
	clReleaseCommandQueue(file_execution);
	clReleaseContext(contexte);
	return 0;
}



 

Error    LNK1104    cannot open file 'OpenCl.lib'  

Viewing all 1182 articles
Browse latest View live


Latest Images