Coder Social home page Coder Social logo

intel / beignet Goto Github PK

View Code? Open in Web Editor NEW
94.0 10.0 40.0 8.39 MB

Beignet is an open source implementation of the OpenCL specification - a generic compute oriented API. Here is Beignet Source Code Mirror in github- This is a publish-only repository and all pull requests are ignored. Please follow https://wiki.freedesktop.org/www/Software/Beignet/ for any of your improvements

License: GNU Lesser General Public License v2.1

Makefile 0.52% C++ 56.87% CMake 1.26% Shell 0.87% C 39.01% Python 1.15% LLVM 0.33%

beignet's Introduction

DISCONTINUATION OF PROJECT

This project will no longer be maintained by Intel.

Intel has ceased development and contributions including, but not limited to, maintenance, bug fixes, new releases, or updates, to this project.

Intel no longer accepts patches to this project.

If you have an ongoing need to use this project, are interested in independently developing it, or would like to maintain patches for the open source software community, please create your own fork of this project.

Contact: [email protected] Beignet

Beignet is an open source implementation of the OpenCL specification - a generic compute oriented API. This code base contains the code to run OpenCL programs on Intel GPUs which basically defines and implements the OpenCL host functions required to initialize the device, create the command queues, the kernels and the programs and run them on the GPU. The code base also contains the compiler part of the stack which is included in backend/. For more specific information about the compiler, please refer to backend/README.md

News

[[Beignet project news|Beignet/NEWS]]

Prerequisite

The project depends on the following external libraries:

  • libdrm libraries (libdrm and libdrm_intel)
  • Various LLVM components
  • If run with X server, beignet needs XLib, Xfixes and Xext installed. Otherwise, no X11 dependency.

And if you want to work with the standard ICD libOpenCL.so, then you need two more packages (the following package name is for Ubuntu):

  • ocl-icd-dev
  • ocl-icd-libopencl1

If you don't want to enable ICD, or your system doesn't have ICD OpenCL support, you must explicitly disable ICD support by running cmake with option -DOCLICD_COMPAT=0 then you can still link to the beignet OpenCL library. You can find the beignet/libcl.so in your system's library installation directories.

Note that the compiler depends on LLVM (Low-Level Virtual Machine project), and the project normally supports the 3 latest LLVM released versions. Right now, the code has been compiled with LLVM 3.6, 3.7 and 3.8. With older version LLVM from 3.3, build still support, but no full tests cover.

A simple command to install all the above dependencies for ubuntu or debian is:

sudo apt-get install cmake pkg-config python ocl-icd-dev libegl1-mesa-dev ocl-icd-opencl-dev libdrm-dev libxfixes-dev libxext-dev llvm-3.6-dev clang-3.6 libclang-3.6-dev libtinfo-dev libedit-dev zlib1g-dev

http://llvm.org/releases/

The recommended LLVM/CLANG version is 3.6 and/or 3.7

Based on our test result, LLVM 3.6 and 3.7 has the best pass rate on all the test suites. Compared to LLVM 3.6 and 3.7, if you used LLVM 3.8, you should pay attention to float immediate. For example, if you use 1.0 in the kernel, LLVM 3.6 will treat it as 1.0f, a single float, because the project doesn't support double float. but LLVM 3.8 will treat it as 1.0, a double float, at the last it may cause error. So we recommend using 1.0f instead of 1.0 if you don't need double float.

For LLVM 3.4 and 3.5, Beignet still support them, but it may be limited to support the build and major functions.

How to build and install

The project uses CMake with three profiles:

  1. Debug (-g)
  2. RelWithDebInfo (-g with optimizations)
  3. Release (only optimizations)

Basically, from the root directory of the project

> mkdir build

> cd build

> cmake ../ # to configure

Please be noted that the code was compiled on GCC 4.6, GCC 4.7 and GCC 4.8 and CLANG 3.5 and ICC 14.0.3. Since the code uses really recent C++11 features, you may expect problems with older compilers. The default compiler should be GCC, and if you want to choose compiler manually, you need to configure it as below:

> cmake -DCOMPILER=[GCC|CLANG|ICC] ../

CMake will check the dependencies and will complain if it does not find them.

> make

The cmake will build the backend firstly. Please refer to: [[OpenCL Gen Backend|Beignet/Backend]] to get more dependencies.

Once built, the run-time produces a shared object libcl.so which basically directly implements the OpenCL API.

> make utest

A set of tests are also produced. They may be found in utests/.

Simply invoke:

> make install

It installs the following six files to the beignet/ directory relatively to your library installation directory.

  • libcl.so
  • libgbeinterp.so
  • libgbe.so
  • ocl_stdlib.h, ocl_stdlib.h.pch
  • beignet.bc

It installs the OCL icd vendor files to /etc/OpenCL/vendors, if the system support ICD.

  • intel-beignet.icd

> make package

It packages the driver binaries, you may copy&install the package to another machine with similar system.

How to run

After building and installing Beignet, you may need to check whether it works on your platform. Beignet also produces various tests to ensure the compiler and the run-time consistency. This small test framework uses a simple c++ registration system to register all the unit tests.

You need to call setenv.sh in the utests/ directory to set some environment variables firstly as below:

> . setenv.sh

Then in utests/:

> ./utest_run

will run all the unit tests one after the others

> ./utest_run some_unit_test

will only run some_unit_test test.

On all supported target platform, the pass rate should be 100%. If it is not, you may need to refer the "Known Issues" section. Please be noted, the . setenv.sh is only required to run unit test cases. For all other OpenCL applications, don't execute that command.

Normally, beignet needs to run under X server environment as normal user. If there isn't X server, beignet provides two alternative to run:

  • Run as root without X.
  • Enable the drm render nodes by passing drm.rnodes=1 to the kernel boot args, then you can run beignet with non-root and without X.

Supported Targets

  • 3rd Generation Intel Core Processors "Ivybridge".
  • 3rd Generation Intel Atom Processors "BayTrail".
  • 4th Generation Intel Core Processors "Haswell", need kernel patch if your linux kernel older than 4.2, see the "Known Issues" section.
  • 5th Generation Intel Core Processors "Broadwell".
  • 5th Generation Intel Atom Processors "Braswell".
  • 6th Generation Intel Core Processors "Skylake" and "Kabylake".
  • 5th Generation Intel Atom Processors "Broxten" or "Apollolake".

OpenCL 2.0

From release v1.3.0, beignet supports OpenCL 2.0 on Skylake and later hardware. This requires LLVM/Clang 3.9 or later, libdrm 2.4.66 or later and x86_64 linux. As required by the OpenCL specification, kernels are compiled as OpenCL C 1.2 by default; to use 2.0 they must explicitly request it with the -cl-std=CL2.0 build option. As OpenCL 2.0 is likely to be slower than 1.2, we recommend that this is used only where needed. (This is because 2.0 uses more registers and has lots of int64 operations, and some of the 2.0 features (pipes and especially device queues) are implemented in software so do not provide any performance gain.) Beignet will continue to improve OpenCL 2.0 performance.

Known Issues

  • GPU hang issues. To check whether GPU hang, you could execute dmesg and check whether it has the following message:

    [17909.175965] [drm:i915_hangcheck_hung] *ERROR* Hangcheck timer elapsed...

    If it does, there was a GPU hang. Usually, this means something wrong in the kernel, as it indicates the OCL kernel hasn't finished for about 6 seconds or even more. If you think the OCL kernel does need to run that long and have confidence with the kernel, you could disable the linux kernel driver's hang check feature to fix this hang issue. Just invoke the following command on Ubuntu system:

    # echo -n 0 > /sys/module/i915/parameters/enable_hangcheck

    But this command is a little bit dangerous, as if your kernel really hangs, then the GPU will lock up forever until a reboot.

  • "Beignet: self-test failed" and almost all unit tests fail. Linux 3.15 and 3.16 (commits f0a346b to c9224fa) enable the register whitelist by default but miss some registers needed for Beignet.

    This can be fixed by upgrading Linux, or by disabling the whitelist:

    # echo 0 > /sys/module/i915/parameters/enable_cmd_parser

  • "Beignet: self-test failed" and 15-30 unit tests fail on 4th Generation (Haswell) hardware. On Haswell, shared local memory (__local) does not work at all on Linux <= 4.0, and requires the i915.enable_ppgtt=2 boot parameter on Linux 4.1.

    This is fixed in Linux 4.2; older versions can be fixed with this patch.

    If you do not need __local, you can override the self-test with

    export OCL_IGNORE_SELF_TEST=1

    but using __local after this may silently give wrong results.

  • Precision issue. Currently Gen does not provide native support of high precision math functions required by OpenCL. We provide a software version to achieve high precision, which you can turn off through

    # export OCL_STRICT_CONFORMANCE=0.

    This loses some precision but gains performance.

  • cl_khr_gl_sharing. This extension is partially implemented(the most commonly used part), and we will implement other parts based on requirement.

Project repository

Right now, we host our project on fdo at: http://cgit.freedesktop.org/beignet/.
And the Intel 01.org: https://01.org/beignet

The team

Beignet project was created by Ben Segovia. Since 2013, Now Intel China OTC graphics team continue to work on this project. The official contact for this project is:
Zou Nanhai ([email protected]).

Maintainers from Intel:

  • Gong, Zhigang
  • Yang, Rong

Developers from Intel:

  • Song, Ruiling
  • He, Junyan
  • Luo, Xionghu
  • Wen, Chuanbo
  • Guo, Yejun
  • Pan, Xiuli

Debian Maintainer:

  • Rebecca Palmer

Fedora Maintainer:

  • Igor Gnatenko

If I missed any other package maintainers, please feel free to contact the mail list.

How to contribute

You are always welcome to contribute to this project, just need to subscribe to the beignet mail list and send patches to it for review. The official mail list is as below: http://lists.freedesktop.org/mailman/listinfo/beignet
The official bugzilla is at: https://bugs.freedesktop.org/enter_bug.cgi?product=Beignet
You are welcome to submit beignet bug. Please be noted, please specify the exact platform information, such as BYT/IVB/HSW/BDW, and GT1/GT2/GT3. You can easily get this information by running the beignet's unit test.

Documents for OpenCL application developers

  • [[Cross compile (yocto)|Beignet/howto/cross-compiler-howto]]
  • [[Work with old system without c++11|Beignet/howto/oldgcc-howto]]
  • [[Kernel Optimization Guide|Beignet/optimization-guide]]
  • [[Libva Buffer Sharing|Beignet/howto/libva-buffer-sharing-howto]]
  • [[V4l2 Buffer Sharing|Beignet/howto/v4l2-buffer-sharing-howto]]
  • [[OpenGL Buffer Sharing|Beignet/howto/gl-buffer-sharing-howto]]
  • [[Video Motion Estimation|Beignet/howto/video-motion-estimation-howto]]
  • [[Stand Alone Unit Test|Beignet/howto/stand-alone-utest-howto]]
  • [[Android build|Beignet/howto/android-build-howto]]

The wiki URL is as below: http://www.freedesktop.org/wiki/Software/Beignet/

beignet's People

Contributors

abrahm avatar anbe42 avatar anyc avatar bsegovia avatar chuanbo-weng avatar daglem avatar elkrejzi avatar fbq avatar fhvwy avatar gongzg avatar guoyejun avatar gyrosgeier avatar hejunyan avatar ignatenkobrain avatar jvesely avatar keith-packard avatar kwm81 avatar midhunkodiyath avatar mmeng1 avatar oblomov avatar randerwang avatar rebecca-palmer avatar rossburton avatar ruiling-song avatar wangyan42164 avatar xionghul avatar yorickz avatar ysun avatar zhenyw avatar zounanhai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

beignet's Issues

Beignet 1.3.2-7 is missing cl_khr_gl_sharing extension

We've updated from Ubuntu 18.04 to Ubuntu 20.04 which triggered beignet to update its package to 1.3.2-7. Software using the cl_khr_gl_sharing feature now fails to run and the cl_khr_gl_sharing extension is not listed in the supported extensions.

We manually replaced the package with version 1.3.2-6 and it works fine with that version.

clCreateFromGLBuffer not implemented

I tried to run the "OpenCL Simple OpenGL Interop" code sample from the NVidia Developer site.

After some minor porting, it worked perfectly - without having the GL_INTEROP macro defined.

If said macro is defined, and CL-GL buffer sharing is actually used, I get this error:

error: Not implemented
cl_gl: <...>/beignet/src/cl_mem_gl.c:47: cl_mem_new_gl_buffer: Assertion `0' failed.
Aborted (core dumped)

I use Beignet 1.3.2, LLVM 5.0, Mesa 17.4.0, Fedora 27, Linux 4.14.14.

Compilation fails with LLVM5

I am trying to build beignet Arch package with LLVM5 and I see following compilation issues:

/build/beignet/src/Beignet-1.3.1-Source/build/backend/src/libocl/src/ocl_image.cl:271:45: error: use of type '__write_only image3d_t' requires cl_khr_3d_image_writes extension to be enabled
GEN_VALIDATE_ARRAY_INDEX(float4, write_only image3d_t)
                                            ^
/build/beignet/src/Beignet-1.3.1-Source/build/backend/src/libocl/src/ocl_image.cl:272:43: error: use of type '__write_only image3d_t' requires cl_khr_3d_image_writes extension to be enabled
GEN_VALIDATE_ARRAY_INDEX(int4, write_only image3d_t)
                                          ^
/build/beignet/src/Beignet-1.3.1-Source/build/backend/src/libocl/src/ocl_image.cl:273:45: error: use of type '__write_only image3d_t' requires cl_khr_3d_image_writes extension to be enabled
GEN_VALIDATE_ARRAY_INDEX(float3, write_only image3d_t)
                                            ^
/build/beignet/src/Beignet-1.3.1-Source/build/backend/src/libocl/src/ocl_image.cl:274:43: error: use of type '__write_only image3d_t' requires cl_khr_3d_image_writes extension to be enabled
GEN_VALIDATE_ARRAY_INDEX(int3, write_only image3d_t)
                                          ^
/build/beignet/src/Beignet-1.3.1-Source/build/backend/src/libocl/src/ocl_image.cl:541:17: error: use of type '__write_only image3d_t' requires cl_khr_3d_image_writes extension to be enabled
DECL_IMAGE_TYPE(image3d_t, 4)
                ^
/build/beignet/src/Beignet-1.3.1-Source/build/backend/src/libocl/src/ocl_image.cl:541:17: error: use of type '__write_only image3d_t' requires cl_khr_3d_image_writes extension to be enabled
/build/beignet/src/Beignet-1.3.1-Source/build/backend/src/libocl/src/ocl_image.cl:541:17: error: use of type '__write_only image3d_t' requires cl_khr_3d_image_writes extension to be enabled
/build/beignet/src/Beignet-1.3.1-Source/build/backend/src/libocl/src/ocl_image.cl:542:17: error: use of type '__write_only image3d_t' requires cl_khr_3d_image_writes extension to be enabled
DECL_IMAGE_TYPE(image3d_t, 3)
                ^
/build/beignet/src/Beignet-1.3.1-Source/build/backend/src/libocl/src/ocl_image.cl:542:17: error: use of type '__write_only image3d_t' requires cl_khr_3d_image_writes extension to be enabled
/build/beignet/src/Beignet-1.3.1-Source/build/backend/src/libocl/src/ocl_image.cl:542:17: error: use of type '__write_only image3d_t' requires cl_khr_3d_image_writes extension to be enabled
/build/beignet/src/Beignet-1.3.1-Source/build/backend/src/libocl/src/ocl_image.cl:709:35: error: use of type '__write_only image3d_t' requires cl_khr_3d_image_writes extension to be enabled
DECL_IMAGE_INFO_COMMON(write_only image3d_t)
                                  ^
/build/beignet/src/Beignet-1.3.1-Source/build/backend/src/libocl/src/ocl_image.cl:709:35: error: use of type '__write_only image3d_t' requires cl_khr_3d_image_writes extension to be enabled
/build/beignet/src/Beignet-1.3.1-Source/build/backend/src/libocl/src/ocl_image.cl:709:35: error: use of type '__write_only image3d_t' requires cl_khr_3d_image_writes extension to be enabled
/build/beignet/src/Beignet-1.3.1-Source/build/backend/src/libocl/src/ocl_image.cl:771:46: error: use of type '__write_only image3d_t' requires cl_khr_3d_image_writes extension to be enabled
OVERLOADABLE int get_image_height(write_only image3d_t image)
                                             ^
/build/beignet/src/Beignet-1.3.1-Source/build/backend/src/libocl/src/ocl_image.cl:775:45: error: use of type '__write_only image3d_t' requires cl_khr_3d_image_writes extension to be enabled
OVERLOADABLE int get_image_depth(write_only image3d_t image)
                                            ^
/build/beignet/src/Beignet-1.3.1-Source/build/backend/src/libocl/src/ocl_image.cl:779:44: error: use of type '__write_only image3d_t' requires cl_khr_3d_image_writes extension to be enabled
OVERLOADABLE int4 get_image_dim(write_only image3d_t image)

Trying to compile on Arch Linux with no luck...

I keep hitting an error:
/usr/bin/ld: CMakeFiles/gbeinterp.dir/gbe_bin_interpreter.cpp.o:(.data.rel+0x0): undefined reference to `llvm::DisableABIBreakingChecks'
collect2: error: ld returned 1 exit status
make[2]: *** [backend/src/CMakeFiles/gbeinterp.dir/build.make:84: backend/src/libgbeinterp.so] Error 1
make[1]: *** [CMakeFiles/Makefile2:148: backend/src/CMakeFiles/gbeinterp.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

CMake error: CLANG_LIB set to NOTFOUND

I'm building with:

cmake ../ -DOCLICD_COMPAT=0 -DCOMPILER=CLANG -DCLANG_LIB=/usr/lib/llvm-3.8/lib/

And I'm getting:

CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
CLANG_LIB

I initially tried without the -DCLANG_LIB... on the cmake commandline and got the same error.

(Platform is Ubuntu 16.04)

beignet tests fail with haswell

Using beignet from git as of today, the tests fail as per below, the screen blanks and the cpu hangs.

Using linux-4.8.17 64-bit, llvm-4.0.1 and mesa-17.2.0 - is this a haswell issue?

./utest_run
platform number 1
platform_profile "FULL_PROFILE"
platform_name "Intel Gen OCL Driver"
platform_vendor "Intel"
platform_version "OpenCL 2.0 beignet 1.4 (git-afd050f)"
platform_extensions "cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store cl_khr_3d_image_writes cl_khr_image2d_from_buffer cl_khr_depth_images cl_khr_spir cl_khr_icd cl_intel_accelerator cl_intel_subgroups cl_intel_subgroups_short cl_intel_media_block_io cl_intel_planar_yuv cl_khr_gl_sharing"
device_profile "FULL_PROFILE"
device_name "Intel(R) HD Graphics Haswell Ultrabook GT2 Mobile"
device_vendor "Intel"
device_version "OpenCL 1.2 beignet 1.4 (git-afd050f)"
device_extensions "cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_byte_addressable_store cl_khr_3d_image_writes cl_khr_image2d_from_buffer cl_khr_depth_images cl_khr_spir cl_khr_icd cl_intel_accelerator cl_intel_subgroups cl_intel_subgroups_short cl_intel_media_block_io cl_intel_planar_yuv cl_khr_gl_sharing"
device_opencl_c_version "OpenCL C 1.2 beignet 1.4 (git-afd050f)"
27 image formats are supported
...
[all test pass prior to here]
compiler_abs_diff_ushort4() [SUCCESS]
compiler_abs_diff_ushort8() [FAILED]
Error: !memcmp(actual, expected, sizeof(T)*N)
at file /usr/src/beignet/utests/compiler_abs_diff.cpp, function check_result, line 139
compiler_abs_diff_ushort16() [FAILED]
Error: !memcmp(actual, expected, sizeof(T)N)
at file /usr/src/beignet/utests/compiler_abs_diff.cpp, function check_result, line 139
compiler_fill_image()drm_intel_gem_bo_context_exec() failed: Input/output error
[FAILED]
Error: ((uint32_t
)buf_data[0])[j * w + i] == 0x78563412
at file /usr/src/beignet/utests/compiler_fill_image.cpp, function compiler_fill_image, line 40
compiler_fill_large_image()drm_intel_gem_bo_context_exec() failed: Input/output error
drm_intel_gem_bo_context_exec() failed: Input/output error
[FAILED]
Error: error calling clEnqueueReadImage with error CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST

at file /usr/src/beignet/utests/compiler_fill_large_image.cpp, function compiler_fill_large_image, line 40
compiler_fill_large_image_1()drm_intel_gem_bo_context_exec() failed: Input/output error
drm_intel_gem_bo_context_exec() failed: Input/output error
[FAILED]
Error: error calling clEnqueueReadImage with error CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST

at file /usr/src/beignet/utests/compiler_fill_large_image.cpp, function compiler_fill_large_image_1, line 95
compiler_fill_large_image_2()drm_intel_gem_bo_context_exec() failed: Input/output error
drm_intel_gem_bo_context_exec() failed: Input/output error
[FAILED]
Error: error calling clEnqueueReadImage with error CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST

at file /usr/src/beignet/utests/compiler_fill_large_image.cpp, function compiler_fill_large_image_2, line 151
compiler_fill_large_image_3()drm_intel_gem_bo_context_exec() failed: Input/output error
drm_intel_gem_bo_context_exec() failed: Input/output error
[FAILED]
Error: error calling clEnqueueReadImage with error CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST

at file /usr/src/beignet/utests/compiler_fill_large_image.cpp, function compiler_fill_large_image_3, line 201
compiler_fill_large_image_4()drm_intel_gem_bo_context_exec() failed: Input/output error
drm_intel_gem_bo_context_exec() failed: Input/output error
[FAILED]
Error: error calling clEnqueueReadImage with error CL_EXEC_STATUS_ERROR_FOR_EVENTS_IN_WAIT_LIST

at file /usr/src/beignet/utests/compiler_fill_large_image.cpp, function compiler_fill_large_image_4, line 249
compiler_fill_large_image_5()

Call to `min` is ambiguous (compiler error)

Problematic kernel code

min((size_t) 1, (unsigned long)2);

CL_PROGRAM_BUILD_LOG

stringInput.cl:168:30: error: call to 'min' is ambiguous
/usr/lib/beignet/include/ocl_integer.h:207:1: note: candidate function
/usr/lib/beignet/include/ocl_integer.h:202:19: note: expanded from macro 'DECL_MIN_MAX_CLAMP'
/usr/lib/beignet/include/ocl_integer.h:211:1: note: candidate function
/usr/lib/beignet/include/ocl_integer.h:202:19: note: expanded from macro 'DECL_MIN_MAX_CLAMP'
/usr/lib/beignet/include/ocl_integer.h:855:21: note: candidate function
/usr/lib/beignet/include/ocl_integer.h:856:21: note: candidate function
/usr/lib/beignet/include/ocl_integer.h:857:21: note: candidate function
/usr/lib/beignet/include/ocl_integer.h:858:21: note: candidate function
/usr/lib/beignet/include/ocl_integer.h:859:22: note: candidate function
/usr/lib/beignet/include/ocl_common.h:28:20: note: candidate function
/usr/lib/beignet/include/ocl_common.h:41:19: note: candidate function
/usr/lib/beignet/include/ocl_common.h:132:21: note: candidate function
... <snip>
/usr/lib/beignet/include/ocl_integer.h:852:20: note: candidate function
/usr/lib/beignet/include/ocl_integer.h:853:20: note: candidate function
/usr/lib/beignet/include/ocl_integer.h:854:21: note: candidate function
stringInput.cl:270:23: warning: incompatible pointer types passing 'const uint32_t *' (aka 'const unsigned int *') to parameter of type 'const uint8_t *' (aka 'const unsigned char *')
stringInput.cl:161:68: note: passing argument to parameter 'message' here

Even if error: call to 'min' is ambiguous is fair warning, that is a ridiculous error message.

The error is isolated to beignet, does not happen on the intel-opencl-runtime or Cuda OpenCL implementations.

CMake Error: CLANG_LIB set to NOTFOUND

linked by target "gbe" in directory /home/griffirk/Desktop/beignet/backend/src
$ clang --version
clang version 11.1.0
Target: x86_64-generic-linux
Thread model: posix
InstalledDir: /usr/bin

Clear linux 35740

After trying to install prerequisits : E: Unable to locate package

I run sudo apt-get install cmake pkg-config python ocl-icd-dev libegl1-mesa-dev ocl-icd-opencl-dev libdrm-dev libxfixes-dev libxext-dev llvm-3.6-dev clang-3.6 libclang-3.6-dev libtinfo-dev libedit-dev zlib1g-dev

Output :

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'librust-clang-sys-0+clang-3-6-dev' for regex 'clang-3.6'
Note, selecting 'librust-clang-sys-0.27.0+gte-clang-3-6-dev' for regex 'clang-3.6'
Note, selecting 'librust-clang-sys-0.27+gte-clang-3-6-dev' for regex 'clang-3.6'
Note, selecting 'librust-clang-sys-0+gte-clang-3-6-dev' for regex 'clang-3.6'
Note, selecting 'librust-clang-sys+clang-3-6-dev' for regex 'clang-3.6'
Note, selecting 'librust-clang-sys-0.27.0+clang-3-6-dev' for regex 'clang-3.6'
Note, selecting 'librust-clang-sys-0.27+clang-3-6-dev' for regex 'clang-3.6'
Note, selecting 'librust-clang-sys+gte-clang-3-6-dev' for regex 'clang-3.6'
Note, selecting 'librust-clang-sys-dev' instead of 'librust-clang-sys+gte-clang-3-6-dev'
Note, selecting 'librust-clang-sys-dev' instead of 'librust-clang-sys+clang-3-6-dev'
Note, selecting 'librust-clang-sys-dev' instead of 'librust-clang-sys-0+clang-3-6-dev'
Note, selecting 'librust-clang-sys-dev' instead of 'librust-clang-sys-0+gte-clang-3-6-dev'
Note, selecting 'librust-clang-sys-dev' instead of 'librust-clang-sys-0.27+clang-3-6-dev'
Note, selecting 'librust-clang-sys-dev' instead of 'librust-clang-sys-0.27+gte-clang-3-6-dev'
Note, selecting 'librust-clang-sys-dev' instead of 'librust-clang-sys-0.27.0+clang-3-6-dev'
Note, selecting 'librust-clang-sys-dev' instead of 'librust-clang-sys-0.27.0+gte-clang-3-6-dev'
E: Unable to locate package llvm-3.6-dev
E: Couldn't find any package by glob 'llvm-3.6-dev'
E: Couldn't find any package by regex 'llvm-3.6-dev'
E: Unable to locate package libclang-3.6-dev
E: Couldn't find any package by glob 'libclang-3.6-dev'
E: Couldn't find any package by regex 'libclang-3.6-dev'

Beignet - unable to find good values for local_work_size[i] 16.04 Server

Dear Support,

System (Server edition - [cat lsb_release]):

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04 LTS"

PC: Intel® NUC Kit NUC5i3RYH Product Specifications

While following this guide Introduction to Intel® RealSense™ SDK for Linux: Getting Started I have encountered the following error when running:

/usr/bin/rs_or_tutorial_2_gui

error:

Beignet: "unable to find good values for local_work_size[i], please provide local_work_size[] explicitly, you can find good values with trial-and-error method."

Could you kindly provide me with some assistance?

Beignet: self-test failed: (3, 7, 5) + (5, 7, 3) returned (6, 7, 5) on Linux 4.9.92 with a i7-8550U

EDIT: Filled issue on their Gitlab: https://gitlab.freedesktop.org/beignet/beignet/issues/80

When running Davinci Resolve on Manjaro Linux with Kernel 4.9.92-1 on my new Dell XPS 13 9370 with the Intel i7-8550U w/620 graphics, I get the following issue:

Intel i7-8550U
Intel UHD Graphics 620
Dell XPS 13 9370
Linux 4.9.92-1
Beignet 1.3.2-2
Davinci Resolve 14.3-1

~ > resolve
ActCCMessage Already in Table: Code= 2282, Mode=  0, Level=  0, CmdKey= 8, Option= 0
ActCCMessage Already in Table: Code= c005, Mode= 13, Level=  1, CmdKey= -1, Option= 0
ActCCMessage Already in Table: Code= c006, Mode= 13, Level=  1, CmdKey= -1, Option= 0
ActCCMessage Already in Table: Code= c007, Mode= 13, Level=  1, CmdKey= -1, Option= 0
log4cxx: No appender could be found for logger (UI).
log4cxx: Please initialize the log4cxx system properly.
QSocketNotifier: Can only be used with threads started with QThread
New connection received.
Beignet: self-test failed: (3, 7, 5) + (5, 7, 3) returned (6, 7, 5)
See README.md or http://www.freedesktop.org/wiki/Software/Beignet/
Beignet: disabling non-working device
Connection is closed.
14.3 (#014)
Main thread starts: EF7A4000
resolve: AppConfig.cpp:159: void AppConfig::LoadAllSiteInfo(): Assertion `m_SiteEnabledIdx > 0' failed.
Aborted (core dumped)

A test is clearly failing, which is disabling the openCL device, and causing the application to crash. If I add the self test ignore I get:

export OCL_IGNORE_SELF_TEST=1

~ > resolve
ActCCMessage Already in Table: Code= 2282, Mode=  0, Level=  0, CmdKey= 8, Option= 0
ActCCMessage Already in Table: Code= c005, Mode= 13, Level=  1, CmdKey= -1, Option= 0
ActCCMessage Already in Table: Code= c006, Mode= 13, Level=  1, CmdKey= -1, Option= 0
ActCCMessage Already in Table: Code= c007, Mode= 13, Level=  1, CmdKey= -1, Option= 0
log4cxx: No appender could be found for logger (UI).
log4cxx: Please initialize the log4cxx system properly.
QSocketNotifier: Can only be used with threads started with QThread
New connection received.
Beignet: self-test failed: (3, 7, 5) + (5, 7, 3) returned (6, 7, 5)
See README.md or http://www.freedesktop.org/wiki/Software/Beignet/
Beignet: Warning - overriding self-test failure
Beignet: Warning - overriding self-test failure
Connection is closed.
14.3 (#014)
Main thread starts: A6255000
resolve: AppConfig.cpp:159: void AppConfig::LoadAllSiteInfo(): Assertion `m_SiteEnabledIdx > 0' failed.
Aborted (core dumped)

Happy to help test any fixes, I believe this is an issue with Beignet, not Resolve, but if you think that isn't the case I can try and log an issue with them too.

Thanks

Bug Report

Hello Developer,

My name is Enas and I am a Ph.D. student. My research focuses on static code analysis. I was looking for open-source software to collect some static code analysis tool warnings. I checked your source code, and I ran one of static code analysis tools over the source code. A number of warnings were generated; some of them may represent true defects in the source code and some may represent false reports, where the tool shows a defect but in reality there is none.

I need your help by going through the warnings and checking if any of them represent a true defect in your source code. To do that, kindly find the attached file, which contains the warnings.

Your response and help are highly appreciated.

Thanks,
Enas

CC-Warnings.xlsx

OpenCL1.2 on Minnowboard Max

Hello,

I'm using a Minnowboard Max and want to install OpenCL1.2 on the board for GPU. I installed Beignet like described in your document but clinfo shows me this

image

But buy using the GPU there occurs the error
Segmentation fault (core dumped)

Some more Details:
Platform: Minnowboard Max
CPU: Intel Atom E3825 w/ GPU HD Graphics
OS: Ubuntu 16.04
Linux Kernel Version: 4.4

Someone knows how to solve this?

Thanks

Corrupted cl_mem after soak-test map/unmap from different threads on CL_MEM_ALLOC_HOST_PTR

Hi,
I'm developing camera software which gets cam frames in a thread and copies the data into a cl_mem mapped (created with CL_MEM_ALLOC_HOST_PTR).

If I soak test the code, after 2-5 hours, the cl_mem becomes corrupt and doesn't appear to read/write properly anymore. There are no errors generated and kernels appear to run fine - just the cl_mem contents are corrupted.

When I create the cl_mem without CL_MEM_ALLOC_HOST_PTR, there aren’t any issues - the soak test successfully ran indefinately. But this disables zero-copy increasing the latency.

From what I've researched, could there be a cache coherence issue/bug present?

We are using Beignet 1.3.2 - the issue also occurs in 1.3.1.
We can’t try the NEO Compute Runtime at this time as we are utilising the cl_gl sharing feature supported in Beignet to visualise the camera feed - when its supported in NEO we will try that.

Target machine is: Ubuntu 18.04 - Intel NUC i7DNBE

cmake ../ error

  clang-3.7: error: unknown argument: '-ftree-loop-distribute-patterns'
    clang-3.7: error: unknown argument: '-fno-semantic-interposition'
    clang-3.7: error: unknown argument: '-mrelax-cmpxchg-loop'
    clang-3.7: warning: -Wl,-z,now: 'linker' input unused
    clang-3.7: warning: -Wl,-z,relro: 'linker' input unused
    clang-3.7: warning: -Wl,-sort-common: 'linker' input unused
    clang-3.7: warning: -Wl,--enable-new-dtags: 'linker' input unused

llvm 3.7 is the commended version why is this

assertion: Not implemented: function bool gbe::Scalarize::scalarizeInsert(llvm::InsertElementInst*), line 838

NOT_IMPLEMENTED; //gla::UnsupportedFunctionality("Variably referenced vector components");

Compilation of the following kernel raises assertion 'Not implemented':

kernel void A(global float4* a) {
    a[0][get_global_id(0)] = 0;
}
ASSERTION FAILED: Not implemented
at file /build/beignet-Bevceu/beignet-1.3.2/backend/src/llvm/llvm_scalarize.cpp, function bool gbe::Scalarize::scalarizeInsert(llvm::InsertElementInst*), line 838

https://gitlab.freedesktop.org/beignet/beignet/issues/43

in-order command execution bug

Following OPENCV test code outputs "fail" every few seconds based on GPU usage. It is using clEnqueueNDRangeKernel internally.

#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>

#include <iostream>
#include <unistd.h>

using namespace cv;
using namespace std;

int main( int argc, char** argv ) {    
    UMat uimage = cv::UMat::zeros(640,640, CV_8U);
   
    while(1) {
        UMat uimage_res, uimage_canny;
        Mat image;
        
        uimage_canny = cv::UMat(uimage.rows,uimage.cols, CV_8U,255);
        Canny(uimage, uimage_canny, 20,50, 3);
       
        resize(uimage_canny,uimage_res, Size(500,500));        
        uimage_res.copyTo(image);
        
        if(image.at<uchar>(0,0) != 0) cout << "fail" << endl;
    }    
    
    return 0;
}

I have tested following debian packages:
1.3.0 OK
1.3.1 OK
1.3.2 FAIL

And last 3 commits:
e1b2419 OK
ab45f14 FAIL
fc5f430 FAIL

Looks like it has something to do with out of order execution which was added in last two commits because when I change:
https://github.com/intel/beignet/blob/master/src/cl_api_kernel.c#L226
to:

cl_bool allow_immediate_submit = false;

It is running fine. But that does not explain why release 1.3.2 is failing too.

Because compute-runtime is still quite far away for debian it would be nice if you can take a look on that. Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.