>For backward compatibility, BOINC _still_ passes the gpu_device_num to the >application in the command line; in our example case it _still_ passes >"--device 1" in the command line. To do anything different would break >compatibility with older applications!
I'm not sure in that. Assuming my app worked ok with older BOINC versions it will not work right with this approach. What will be: app recived --device 1 App enumerates OpenCL devices and sees only 1 OpenCL device so only index 0 is possible, not 1. App compares what it knows about OpenCL environment with what BOINC tells it to use 0!=1 => app complins that BOINC provides wrong device (and if app just used index of 1 w/o checking it will got out of bound exception apparently). So, such approach definitely breaks compatibility with my applications. What other apps that require index of 1 where only 1 capable device presents ? > >Around August 2011, we realized that passing the device number is not >sufficient if a user had both ATI and NVIDIA GPUs on the same computer, so we >created the API: > int boinc_get_opencl_ids(cl_device_id* device, cl_platform_id* platform); >which gets the GPU vendor and device number from the init_data.xml file. Of course, cause meaning of --device was distorted. >In January 2012, we discovered that on Macs, Apple's OpenCL does not support >some NVIDIA GPUs which CUDA does support, so we added the gpu_opencl_dev_index >field. This allowed the boinc_get_opencl_ids() API to handle these correctly. > OpenCL project applications did not need to worry about this, as long as they >were linked with a current version of boinc_get_opencl_ids(). When used with >older versions of BOINC which do not provide the gpu_opencl_dev_index field, >boinc_get_opencl_ids() reverts to using only gpu_device_num to be as backward >compatible as possible. > >But in December 2012, we realized that boinc_get_opencl_ids() was not >compatible with very old clients which did not provide the gpu_device_num or >the gpu_type field. So we deprecated the old boinc_get_opencl_ids() API and >added a new version which takes 5 arguments: > int boinc_get_opencl_ids(int argc, char** argv, int type, cl_device_id* >device, cl_platform_id* platform); More and more bandages IMHO. Please, give some example where simple --device N based approach will fail if it would be implementd as I suggested? Where it will break compatibility with older apps that doesn't know nothing about other possible device types (as should be, they knows only devices that they can use). > >Passing in the same argv and argc which were passed to the application allows >this function to use the value of --device from the command line for >compatibility with very old BOINC clients which did not have the >gpu_device_num field in the init_data.xml file. This gives us even better >backward compatibility than we had before. And allowing the project >application to pass in the type (NVIDIA, ATI or Intel) allows it to work with >older BOINC clients which did not have the gpu_type in the init_data.xml file. Any example of usage in particular discussed situation, please? > >This newest boinc_get_opencl_ids() API has an added feature. If your OpenCL >application can run on any vendor's GPU, then you can create a plan class >telling BOINC that the vendor (gpu_type) does not matter. On any version of >BOINC new enough to put the gpu_type in the init_data.xml file, that one >application will run on whichever GPU is assigned by BOINC; you will no longer >need separate copies of the same OpenCL application for each GPU vendor. This makes generic OpenCL type of accelerator unneeded indeed. > >I looked at the source code for your OpenCL and Brook anonymous platform SETI >Astropulse applications. I see they do not examine the --device argument >directly, but instead call the older version of boinc_get_opencl_ids() with 2 >arguments. I strongly recommend you update to the newer, 5 argument version >to have backward compatibility with even older versions of the BOINC client. Ok, will look into that, thanks. > >I have one more suggestion. In your OpenCL anonymous platform SETI Astropulse >application, the application writes "BOINC assigns device %d" with the value >of BOINCs_device, which is the value of the gpu_opencl_dev_index. This is >confusing to users, who have seen the GPUs identified by their physical device >number gpu_device_num in the Event Log. It would be better if the application >would display the physical device number, and use the gpu_opencl_dev_index >only internally. You can get the value of gpu_device_num either from the >--device command-line argument, or from the gpu_device_num field of the >init_data struct. Thanks, this will be needed if current approach used. _______________________________________________ boinc_dev mailing list [email protected] http://lists.ssl.berkeley.edu/mailman/listinfo/boinc_dev To unsubscribe, visit the above URL and (near bottom of page) enter your email address.
