0

I'm trying to compile a program to run some opencl code using Cloo.

static void Main(string[] arg)
{
    CLCalc.InitCL();
    string src = File.ReadAllText("kernels.cl");   

    CLCalc.Program.Compile(src);
}

The program was previously working fine, but now I get a null reference exception. error At first I thought there was a bug in my opencl code but I replaced the opencl with a very simple kernel and it still would not compile.

ie:

static void Main(string[] arg)
{
    CLCalc.InitCL();
    //string src = File.ReadAllText("kernels.cl");   
    string src = "__kernel void hello(__global char * out){}";

    CLCalc.Program.Compile(src);
}

NoDevice

Note that there is no device present. Why would this be? I have a GPU...

This has been a problem since installing the CUDA tooklkit on my PC. Is it even possible for this to be the cause though?

EDIT

I've created a very simple project with only a few lines of code which exbits my bug.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using OpenCL;
using OpenCL.Net;
using OpenCLTemplate;

namespace ClooTest
{
    class Program
    {
        static void Main(string[] args)
        {
            CLCalc.InitCL();

            string src = "__kernel void hello(__global char * out){}";

            CLCalc.Program.Compile(src);
        }
    }
}

EDIT

I've recoverd an old working copy of my program from USB. It ran fine on my home PC. But I get the same bug when I run it on my work PC.

cmd

EDIT

If I put a break point in before the compile line I can see an exception NotFound

Why would it not be finding my device all of a sudden?

EDIT

When I look at my OpenCL devices the only one listed as default device is my CPU ...

Devices

Why!?

sav
  • 2,064
  • 5
  • 25
  • 45
  • I should note that I'm using the implementation of opencl found here http://www.cmsoft.com.br/index.php?option=com_content&view=section&id=13&Itemid=66 – sav Jun 03 '14 at 01:19
  • http://www.cmsoft.com.br/download/OpenCLTemplate.zip – sav Jun 03 '14 at 01:19
  • I've just found a backup of an old working version of my program from a USB. It is now exhibiting the same bug! I'm starting to think its time to give ghost busters a call... – sav Jun 03 '14 at 23:37
  • I should also add the the program dies at the line CLCalc.Program.Compile(src); – sav Jun 03 '14 at 23:46
  • It has been suggested to me that the problem may be related to the NVIDIA driver. I've tried installing the latest driver for my graphics card (Quadro K4000) http://www.nvidia.com/download/driverResults.aspx/75456/en-us Still no success – sav Jun 05 '14 at 00:15
  • 1
    It appears my CPU actually supports a later version of OpenCL than my GPU. But of course my GPU is still the better option. I wonder if since downloading the latest drivers, my default OpenCL device has been my CPU since it has the latest version. – sav Jun 06 '14 at 07:47
  • Can you please post what code do you run under InitCL()? Is not possible that the CL devices disappear after you install another platform. My guess is that you are just using a different ICD driver (32bit / 64bits), or that you are searching inside the platform 0 only, and that platform is not the correct one any more. – DarkZeros Jan 19 '15 at 17:28
  • InitCL is a cloo function, its not mine. – sav Jan 20 '15 at 04:21
  • 1
    Sry, not very familiar with Cloo. My impresion is that the ICD loader is a diferent one, you can try compiling your app in 32bits/64bits. Depending on that the app may use one loader or the other, and see some devices only. – DarkZeros Jan 20 '15 at 09:51
  • @DarkZeros This is a very good idea. I've been using the express version of visual studio which does not support 64bit. However I've just tried moving this to a different PC (64 bit) and the program works! I'm not sure if the processor architecture issue is what caused the problem. – sav Jan 21 '15 at 01:46
  • Also interesting to note that my home PC is 64 bit – sav Jan 21 '15 at 01:46

0 Answers0