Announcement
Collapse
No announcement yet.
Trying Intel OpenCL On Linux For Video Encoding
Collapse
X
-
Originally posted by gongzg View PostCould you run the utest_run correctly?
What I'm getting segfaults with are programs like this:
Code:#include <stdio.h> #include <stdlib.h> #include <CL/cl.h> int main() { int i, j; char* info; size_t infoSize; cl_uint platformCount; cl_platform_id *platforms; const char* attributeNames[5] = { "Name", "Vendor", "Version", "Profile", "Extensions" }; const cl_platform_info attributeTypes[5] = { CL_PLATFORM_NAME, CL_PLATFORM_VENDOR, CL_PLATFORM_VERSION, CL_PLATFORM_PROFILE, CL_PLATFORM_EXTENSIONS }; const int attributeCount = sizeof(attributeNames) / sizeof(char*); clGetPlatformIDs(5, NULL, &platformCount); platforms = (cl_platform_id*) malloc(sizeof(cl_platform_id) * platformCount); clGetPlatformIDs(platformCount, platforms, NULL); for (i = 0; i < platformCount; i++) { printf("\n %d. Platform \n", i+1); for (j = 0; j < attributeCount; j++) { clGetPlatformInfo(platforms[i], attributeTypes[j], 0, NULL, &infoSize); info = (char*) malloc(infoSize); clGetPlatformInfo(platforms[i], attributeTypes[j], infoSize, info, NULL); printf(" %d.%d %-11s: %s\n", i+1, j+1, attributeNames[j], info); free(info); } printf("\n"); } free(platforms); return 0; }
Comment
-
It doesn't look like a kernel issue. I'm guessing it may be caused by incorrect environment variables.
Could you try to run this case in a new terminal window? And please make sure there is no any OCL* env
variables set.
Originally posted by ChrisXY View PostHm, yes, they work.
What I'm getting segfaults with are programs like this:
Code:#include <stdio.h> #include <stdlib.h> #include <CL/cl.h> int main() { int i, j; char* info; size_t infoSize; cl_uint platformCount; cl_platform_id *platforms; const char* attributeNames[5] = { "Name", "Vendor", "Version", "Profile", "Extensions" }; const cl_platform_info attributeTypes[5] = { CL_PLATFORM_NAME, CL_PLATFORM_VENDOR, CL_PLATFORM_VERSION, CL_PLATFORM_PROFILE, CL_PLATFORM_EXTENSIONS }; const int attributeCount = sizeof(attributeNames) / sizeof(char*); clGetPlatformIDs(5, NULL, &platformCount); platforms = (cl_platform_id*) malloc(sizeof(cl_platform_id) * platformCount); clGetPlatformIDs(platformCount, platforms, NULL); for (i = 0; i < platformCount; i++) { printf("\n %d. Platform \n", i+1); for (j = 0; j < attributeCount; j++) { clGetPlatformInfo(platforms[i], attributeTypes[j], 0, NULL, &infoSize); info = (char*) malloc(infoSize); clGetPlatformInfo(platforms[i], attributeTypes[j], infoSize, info, NULL); printf(" %d.%d %-11s: %s\n", i+1, j+1, attributeNames[j], info); free(info); } printf("\n"); } free(platforms); return 0; }
Comment
-
I'm not aware of any environment variable that could influence beignet. Certainly none that start with OCL... are set.
But that made me try this:
./ocl simply segfaults when dlopen libgbe.so
I saw that it returns before that dlopen when OCL_NON_COMPILER=1 is set, so I tried this:
OCL_NON_COMPILER=1 ./ocl
and all the rest works, so just loading the compiler some
Code:[...] 3. Platform 3.1 Name : Intel Gen OCL Driver 3.2 Vendor : Intel 3.3 Version : OpenCL 1.2 beignet 0.9 3.4 Profile : FULL_PROFILE 3.5 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_icd
Comment
-
That should be a pure dlopen issue with libgbe.so. Could you please send the details of how to reproduce this issue
to beignet mail list? Including the detail distribution version you are using and the toolchain version.
The beignet mail list is [email protected].
We will check whether we can reproduce it here and if so, will fix it soon. Thanks.
Originally posted by ChrisXY View PostI'm not aware of any environment variable that could influence beignet. Certainly none that start with OCL... are set.
But that made me try this:
./ocl simply segfaults when dlopen libgbe.so
I saw that it returns before that dlopen when OCL_NON_COMPILER=1 is set, so I tried this:
OCL_NON_COMPILER=1 ./ocl
and all the rest works, so just loading the compiler some
Code:[...] 3. Platform 3.1 Name : Intel Gen OCL Driver 3.2 Vendor : Intel 3.3 Version : OpenCL 1.2 beignet 0.9 3.4 Profile : FULL_PROFILE 3.5 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_icd
Comment
-
Any Gentoo users who don't mind using a live mesa package might like to give my beignet enabled ebuild a try:
https://github.com/sjnewbury/gentoo-opencl
To build with beignet you need to have the opencl and beignet USE flags enabled.
Beignet has optional EGL integration which depends upon the Mesa source tree, hence why it makes sense to build alongside Mesa. Last time I tried the option was broken, so it's behind a USE flag: beignet-egl
Finally, there's a beignet-generic USE flag which builds beignet with support for all Intel GPU targets, otherwise the ebuild detects the build system GPU.
There is no ICD, beignet is installed just like any other supported Gentoo OpenCL library and is switchable with "eselect opencl".
Comment
-
Seeing this thread far too late. But I'll reply anyway following my own attempts to run x264 with Beignet 1.1.0 on Intel Ivy Bridge with Ubuntu 14.04 and not seeing much benefit at all. Actually the issue really is with x264 support. No fault of theirs since it is clearly mentioned in the release thread:
Clearly says here that Intel integrated GPUs upto Ivy Bridge do not support the features that x264 expects.
Comment
-
the opencl functionality in x264 is more of an exercise in "is there anything at all we could do on the gpu so we could technically say we did" than "we just moved a tangible portion of the actual work to the gpu and you'll see tangible speed improvements." if you want to benchmark opencl, x264 is the last thing you should be looking at.
Comment
-
Good thought. I browsed through the opencl.c in the x264 common sub-dir and it was just a few of the operations that were being offloaded to the GPU, like lookahead and some ME. It has been a while since I last tried something similar to make 100% sense of these operations, but I mean to do it.
So then the question is do you see the benefit of faster execution, if x264 did have the option to offload a greater share of computation on to the GPU? Why is it that this has not been attempted? Mainly due to resource.
It may be known here that AMD has their VCE engine for the Radeon cards and have a reference h264 encoder implemented for it:
This may probably have much better results in terms of encode speed and paralellizing encodes. I am very curious to see if x264-dev have any interest in improving performance through GPU. This may be a question for their dev list though.
Comment
-
Originally posted by s_j_newbury View PostAny Gentoo users who don't mind using a live mesa package might like to give my beignet enabled ebuild a try:
To build with beignet you need to have the opencl and beignet USE flags enabled.
Beignet has optional EGL integration which depends upon the Mesa source tree, hence why it makes sense to build alongside Mesa. Last time I tried the option was broken, so it's behind a USE flag: beignet-egl
Finally, there's a beignet-generic USE flag which builds beignet with support for all Intel GPU targets, otherwise the ebuild detects the build system GPU.
There is no ICD, beignet is installed just like any other supported Gentoo OpenCL library and is switchable with "eselect opencl".
Comment
Comment