Bug report: clGetDeviceIDs clGetDeviceIDs, CL_INVALID_VALUE

Sorry if this is the wrong place to post, but I do not see the “Bug Report” link as indicated in the early access release notes.

clDeviceIDs is returning CL_INVALID_VALUE for me even though I have a valid CUDA device installed, devices pointer is non-zero, and the num_devices field is non-null.

I tried CL_DEVICE_TYPE_GPU, CL_DEVICE_TYPE_DEFAULT, and CL_DEVICE_TYPE_ALL.

OS is Windows XP SP3, 32-bit.

All hardware/driver requirements are met as per the release notes.

I’m using the notebook version of the driver and my device is (from oclDeviceQuery example):

Quadro FX 1600M

Note that this is the first call to the OpenCL runtime in my application.

Thanks.

have you tried to run the included example applications (there are some example implementations included in the dir OpenCL/src/)?

did you specify the value platform_id (first parameter)?

you can find the bug report in the ndeveloper login area but i think this is not a bug.

Wow, it looks like you broke the specification. Where did cl_platform_id come from?

It’s in your header, yet the header from Khronos 1.0 Rev. 33 does not include an API for working with platforms.

Ugh. Is there a newer rev of the specification?

it’s not included in the khronos cl.hpp file (rev.33) but in the cl.h:

http://www.khronos.org/registry/cl/api/1.0/cl.hpp

thus i think that cl.h is the most up to date revision.

maybe they wanted to make sure, that the developer assumes the right profile to get the correct device ids or none if the necessary functions aren’t supported (e.g. if embedeed and full processors are both installed on a machine).

maybe this helps you a little bit:

/**

				* CPlatforms convenient class

				*/

				 class CPlatforms

				 {

				 public:

						 cl_platform_id *platform_ids;

						 cl_uint platform_ids_count;

		 

						 inline void initCPlatforms()

						 {

								 platform_ids = NULL;

								 platform_ids_count = 0;

						 }

		 

						 inline CPlatforms()

						 {

								 initCPlatforms();

		 

								 CL_CHECK_ERROR(clGetPlatformIDs(

														 NULL,

														 NULL,

														 &platform_ids_count

												 ));

		 

								 delete platform_ids;

								 platform_ids = new cl_platform_id[platform_ids_count];

		 

								 CL_CHECK_ERROR(clGetPlatformIDs(

														 platform_ids_count,

														 platform_ids,

														 NULL

												 ));

						 }

		 

						 inline ~CPlatforms()

						 {

								 delete platform_ids;

						 }

				 };

	   	/**

	 	 * CPlatform convenient class

	 	 */

	 	class CPlatform

	 	{

	 	public:

	 		cl_platform_id platform_id;

	 

	 		char *profile;

	 		char *version;

	 

	 		inline void initCPlatform()

	 		{

	 			profile = NULL;

	 			version = NULL;

	 		}

	 

	 		inline void cleanupCPlatform()

	 		{

	 			delete[] profile;

	 			delete[] version;

	 		}

	 		

	 		/**

	 		 * load information about platform and store to class

	 		 */

	 		inline void loadPlatformInfo()

	 		{

	 			size_t size_retval;

	 

	 			CL_CHECK_ERROR(clGetPlatformInfo(	platform_id,	CL_PLATFORM_PROFILE,	NULL,	NULL,	&size_retval));

	 			profile = new char;

	 			CL_CHECK_ERROR(clGetPlatformInfo(	platform_id,	CL_PLATFORM_PROFILE,	size_retval,	profile,	NULL));

	 

	 			CL_CHECK_ERROR(clGetPlatformInfo(	platform_id,	CL_PLATFORM_VERSION,	NULL,	NULL,	&size_retval));

	 			version = new char;

	 			CL_CHECK_ERROR(clGetPlatformInfo(	platform_id,	CL_PLATFORM_VERSION,	size_retval,	version,	NULL));

	 		}

	 

	 		/**

	 		 * load information about Platform given by platform_id

	 		 */

	 		inline CPlatform(cl_platform_id p_platform_id)

	 		{

	 			initCPlatform();

	 			platform_id = p_platform_id;

	 		}

	 

	 		inline ~CPlatform()

	 		{

	 			cleanupCPlatform();

	 		}

	 	};

I asked one of our OpenCL guys about this last night, and apparently there has been an update to the spec since revision 33 went up in February. Unsurprisingly, it was a lot of stuff related to the platform API.

Not sure why the new spec isn’t up or why there isn’t a revision in the header to reflect this, but as you’ve figured out, the header didn’t come from us anyway–it came from Khronos.

Thanks, it does look like that is the issue. There appears to be a new API entry (clGetPlatformIDs) that appears in the NVIDIA OpenCL header but not in the 1.0 Rev 33 Khronos header. Hopefully Khronos will update the specification and header.

Hi,
I tried the code above to catch and print all errors of the built. But unfortunately the ret_val_size var is just 1. Where’s the problem?

Greets
Daniel

Sorry, wrong thread…