clMathLibraries / clBLAS

a software library containing BLAS functions written in OpenCL
Apache License 2.0
838 stars 242 forks source link

OpenCL error -11 'failed to build program' in xgemm.cc, on Windows #256

Open hughperkins opened 8 years ago

hughperkins commented 8 years ago
Using NVIDIA Corporation , OpenCL platform: NVIDIA CUDA
Using OpenCL device: GRID K520
initializing clblas
OpenCL error -11 on line 252 of ..\..\..\..\..\clMathLibraries\clBLAS\src\librar
y\blas\xgemm.cc
Assertion failed: false, file ..\..\..\..\..\clMathLibraries\clBLAS\src\library\
blas\xgemm.cc, line 252
hughperkins commented 8 years ago

Line 252 is basically this:

#ifdef AUTOGEMM_PRINT_DEBUG
      printf("makeGemmKernel: Creating program from source\n");
#endif
      clProgram = clCreateProgramWithSource(
        clContext,
        1, &kernelSource,
        NULL, &err );
      CL_CHECK(err)
      err = clBuildProgram(
        clProgram,
        1, &clDevice,
        sourceBuildOptions, NULL, NULL );
      CL_CHECK(err)
    }
hughperkins commented 8 years ago

Associated test scenario:

TEST(testClBlas, basic) {
    EasyCL *cl = EasyCL::createForFirstGpuOtherwiseCpu();

    float A[] = {1, 3,
                 2, 7,
                 9, 5};
    float B[] = {3,
                 -1};

    float C[3];
    ClBlasInstance clblasInstance;
    CLWrapper *AWrap = cl->wrap(6, A);
    CLWrapper *BWrap = cl->wrap(2, B);
    CLWrapper *CWrap = cl->wrap(3, C);
    AWrap->copyToDevice();
    BWrap->copyToDevice();
    CWrap->createOnDevice();
    ClBlasHelper::Gemm(
        cl,
        clblasRowMajor,
        clblasNoTrans, clblasNoTrans,
        3, 2, 1,
        1,
        AWrap, 0,
        BWrap, 0,
        0,
        CWrap, 0
    );
    cl->finish();
    CWrap->copyToHost();
    EXPECT_EQ(0, C[0]);
    EXPECT_EQ(-1, C[1]);
    EXPECT_EQ(22, C[2]);

    cl->finish();

    delete CWrap;
    delete BWrap;
    delete AWrap;

    cl->finish();

    delete cl;
//    clblasTeardown();
}
anadon commented 8 years ago

Can you test with the nvidia driver on linux and another vendor's driver on windows? The -11 error codes maps to CL_BUILD_PROGRAM_FAILURE. I've been running into this on mesa, but it is probably unrelated.

anadon commented 8 years ago

Also, it's be useful to know if your driver relies on a LLVM backend for it's openCL compilation or something custom. I'm not sure if that information is available.

hughperkins commented 8 years ago

On linux, using nvidia 352.55 driver, works ok.

For Windows, I'm using Amazon EC2, on a g2 box. Tricky to use a different vendor's driver I would think :-)