cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

evk8888
Journeyman III

device fission using clCreateSubDevicesEXT (command queue creation fails)

hi,

In my experiments i m trying to partition a cpu to 2 subdevices with 2 cores each and for the first subdevice the command queue is created and i can enqueue tasks into it but when I am trying to create command queues for devices_id [1] it says (failed to create command queue)

globally declared - static clCreateSubDevicesEXT_fn pfn_clCreateSubDevicesEXT = NULL;

pfn_clCreateSubDevicesEXT = (clCreateSubDevicesEXT_fn)clGetExtensionFunctionAddress("clCreateSubDevicesEXT");

const cl_context_properties part_props[] = { CL_DEVICE_PARTITION_BY_COUNTS_EXT, 2, 2, CL_PARTITION_BY_COUNTS_LIST_END_EXT, CL_PROPERTIES_LIST_END_EXT };

err =  pfn_clCreateSubDevicesEXT(device_id, (const cl_device_partition_property_ext *)part_props, 2, devices_id, &part_count);

printf("PARTITION SUCCESSSSSSS????? ERRR VALUE! (%d)\n", err);

         for (int i =0; i<2; i++) {

        err= clGetDeviceInfo(devices_id, CL_DEVICE_MAX_COMPUTE_UNITS, sizeof(val), &val, NULL);

        printf("Device partition %d: max compute units = %lld\n",i, val );}

        cl_context_properties context_props[3];

context_props[0] = (cl_context_properties)CL_CONTEXT_PLATFORM;      // indicates that next element is platform

context_props[1] = (cl_context_properties)platforms[0];  // platform is of type cl_platform_id

        context_props[2] = (cl_context_properties)0;                        // last element must be 0

         context = clCreateContext(context_props, 1, devices_id, NULL, NULL, &err);

        if (!context)

        {

           printf("Error: Failed to create a compute context!\n");

        }

        commands = clCreateCommandQueue(context, devices_id[1], NULL, &err);

        if (!commands)

        {

           printf("Error: Failed to create a command queue commands!\n");

        }

        can anyone help me out with this....

Thanks!

0 Likes
1 Solution
harryjiang
Adept I

Hi evk8888,

         context = clCreateContext(context_props, 1, devices_id, NULL, NULL, &err);

It may because you use 1 for the num_devices when create context. Please try 2 instead of 1.

View solution in original post

0 Likes
10 Replies