Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: Trying Intel OpenCL On Linux For Video Encoding

  1. #11

    Default

    Could you run the utest_run correctly?

    Quote Originally Posted by ChrisXY View Post
    I for one only get this segfault: http://pastebin.com/raw.php?i=GTirsFBb
    Possibly since the 3.17 rcs. I haven't really checked again with 3.16.

    Also libgbe seems to be compiled without debug symbols no matter what.

  2. #12
    Join Date
    Jun 2010
    Location
    ฿ 16LDJ6Hrd1oN3nCoFL7BypHSEYL84ca1JR
    Posts
    1,052

    Default

    Quote Originally Posted by gongzg View Post
    Could you run the utest_run correctly?
    Hm, 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;
     }
    But it worked some time ago and I'm not sure what I changed other than upgrading the kernel.

  3. #13

    Default

    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.

    Quote Originally Posted by ChrisXY View Post
    Hm, 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;
     }
    But it worked some time ago and I'm not sure what I changed other than upgrading the kernel.

  4. #14
    Join Date
    Jun 2010
    Location
    ฿ 16LDJ6Hrd1oN3nCoFL7BypHSEYL84ca1JR
    Posts
    1,052

    Default

    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
    And then it's this super early crash where nothing has actually happened yet... bgeloader -> dlopen -> "global constructors keyed to a () from /usr/lib/beignet//libgbe.so"...

  5. #15

    Default

    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 beignet@lists.freedesktop.org.

    We will check whether we can reproduce it here and if so, will fix it soon. Thanks.

    Quote Originally Posted by ChrisXY View Post
    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
    And then it's this super early crash where nothing has actually happened yet... bgeloader -> dlopen -> "global constructors keyed to a () from /usr/lib/beignet//libgbe.so"...

  6. #16
    Join Date
    Feb 2013
    Posts
    83

    Default

    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".

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •