context creation failure on 64bit linux

Hi all,

We are trying to run OpenCL on a x86_64 machine with Linux RHEL 4, which has a Quadro FX 5600. We had 32-bit c/c++ library in the machine and followed the standard procedure of installing OpenCL on 32bit linux. By adding the -m32 option in the Makefiles, we were able to compile the SDK samples. We also updated the driver for x86_64 from:

[url=“http://ftp%3a%2f/download.nvidia.com/XFree86/Linux-x86_64/185.18.08/”]ftp://download.nvidia.com/XFree86/Linux-x86_64/185.18.08/[/url]

However, when we then try to run the compiled SDK sample, context creation fails:

release> ./oclBitonicSort
oclBitonicSort.exe Starting…

Initializing data…
Initializing OpenCL…

!!! Error # -1 at file Source/oclBitonicSort.cpp, line 113


line 113 is the error checking statement just below context creation.

We understand that currently OpenCL is supposed to work on 32bit linux. So what we have done is doomed to fail? Or is there some work-around? Any thought will be appreciated. Thanks!

Pretty sure this is doomed to fail…

We actually have this working quite well on a 64-bit machine. -m32 on the application appeared to be sufficient to work with a 64-bit host and graphics driver. At least, it lets us move data to/from the card and run kernels.

(Obviously we could not ship products with such an unsupported configuration but it has proven important in enabling our transition from CUDA to OpenCL early on.)

In your case it would appear that the GPU is not recognised as an OpenCL device. (-1 is CL_DEVICE_NOT_FOUND from clCreateContextFromType) This works for us on a GT 120 and GTX 260 but I expect you will have to wait for 64-bit drivers, or try a 32-bit installation, to receive any kind of support.

it also runs well on my 64bit machine. i’m using NVIDIA-Linux-x86_64-185.18.08-pkg2.run.

but there was more necessary than just to append -m32 to the compiler (at least on my ubuntu system):

http://forums.nvidia.com/index.php?showtopic=96831

martin@vanadium:~/NVIDIA_GPU_Computing_SDK/OpenCL/bin/linux/release$ ./oclBitonicSort 

 oclBitonicSort.exe Starting...

Initializing data...

 Initializing OpenCL...

 Creating OpenCL memory objects...

 Loading OpenCL program from file...

 Creating program...

 Building program...

 Creating kernels...

 Running bitonic sort on 1024 arrays by 1024 elements...

 Reading back OpenCL results...

 Validating the sort results...

validateSortResults(): Results are ordered correctly

TEST PASSED

oclBitonicSort.exe Ending...

 -----------------------------------------------------------

Press ENTER to exit...

martin@vanadium:~/NVIDIA_GPU_Computing_SDK/OpenCL/bin/linux/release$ uname -a

 Linux vanadium 2.6.28-11-generic #42-Ubuntu SMP Fri Apr 17 01:58:03 UTC 2009 x86_64 GNU/Linux

 martin@vanadium:~/NVIDIA_GPU_Computing_SDK/OpenCL/bin/linux/release$

Thanks very much for all your replies!

An update: after changing to another 64bit Linux machine with RHEL 5.3 and repeat the same procedures, it works. So apparently lower version of Linux was causing the problem.

And a beta1 release of OpenCL1.0, supporting 64-bit, is out. All SDK samples run fine - Fedora 10.

Tons of production commercial/research shops run older Linux distros, so this is still a problem I would expect will have to be solved before a 1.0 release is made. Otherwise, there will be zero uptake in cases where one needs to ship binaries to non-technical end users that don’t even know what a kernel is :-)