Hi Charlie!

On 25.04.13 12:46, Charlie Fenton wrote:

How is your application determining the cl_platform_id and cl_device_id of the 
GPU assigned by the client?

It calls boinc_get_opencl_ids(cl_device_id* device, cl_platform_id* platform). As we allow OpenCL Apps only for Clients >= 7.0.24, this shouldn't make any difference to the newer function that adds support for Clients older than 7.0.12. Ultimately both functions call boinc_get_opencl_ids_aux() with the info they got from init_data anyway.

You should be using the api/boinc_opencl.cpp from March 4 (boinc 7.0.45) or 
later.  The version of api/boinc_opencl.cpp from January 11 is deprecated.


The complete diff from current master HEAD and the version we were using 
(tagged current_fgrp_apps) is:


git diff current_fgrp_apps ./api/boinc_opencl.cpp
diff --git a/api/boinc_opencl.cpp b/api/boinc_opencl.cpp
index 80b87a8..a2763fc 100644
--- a/api/boinc_opencl.cpp
+++ b/api/boinc_opencl.cpp
@@ -59,8 +59,9 @@ int get_vendor(cl_device_id device_id, char* vendor, int len) 
{
     retval = clGetDeviceInfo(
         device_id, CL_DEVICE_VENDOR, len, vendor, NULL
     );
-    if ((retval != CL_SUCCESS) || (strlen(vendor)==0)) return retval;
-
+    if (retval != CL_SUCCESS) return retval;
+    if (!strlen(vendor)) return CL_INVALID_DEVICE_TYPE;
+
     if ((strstr(vendor, "AMD")) ||
         (strstr(vendor, "Advanced Micro Devices, Inc."))
     ) {
@@ -75,7 +76,6 @@ int get_vendor(cl_device_id device_id, char* vendor, int len) 
{
         strcpy(vendor, GPU_TYPE_INTEL);     // "intel_gpu"
     }

-    if (!strlen(vendor)) return CL_INVALID_DEVICE_TYPE;
     return 0;
 }


I don't see any change in there that could have any effect on the issue in question. We certainly can rebuild the App with current master HEAD, publish it and see if it fixes the problem, but that's another day of work wasted if this doesn't help.

We discovered some time ago that the use of a single device number is overly 
simplistic and problematic, because not all CUDA GPUs are recognized by OpenCL 
on the Mac, and not all CAL-capable GPUs support openCL.  All BOINC GPU apps 
must use api/boinc_opencl.cpp to get the cl_platform_id and cl_device_id of the 
GPU assigned by the client.

Yep, but our currrent problem happens neither on a Mac nor with ATI, and we do use the API function and don't handle --device on out own (for OpenCL Apps).

Does this answer your questions?

I'm afraid it doesn't solve the problem.

We _do_ use the API function in question and init_data.xml _does_ contain reasonable values for the GPU tags; however for one device boinc_get_opencl_ids() appears to return the wrong cl_device_id. The only thing that IMHO can go wrong there is the device enumeration in the API function.

Best,
Bernd

Footnote: Could you name the sha1 of the commit you are referring to?
The tag current_fgrp_apps actually sits on commit 
9bef2edbf0fd6b9da2c282735935ce1b27727ddc
This commit is a merge commit that Oliver rebuild on March 4 from the original merge commit c43ee0869234f400b99f8a16dff276017ba0b480 in the v1 repo, which also carries the timestamp of Jan 11. If you type 'git log' and scroll down to 9bef2edbf0fd6b9da2c282735935ce1b27727ddc (which is tagged March 4), you will see other commits on top of that, beginning with 657c0f9730f0796724875433f12a3d92494b2973 from David of Jan 11. So the original merge actually also happened on Jan 11, although the commit reconstructed for "boinc-git-v2" lists Mar 4.

On Apr 25, 2013, at 12:43 AM, Bernd Machenschalk wrote:
Hi!

We recently issued our first OpenCL App for NVidia devices and ran into a 
problem with device assignment.

When there are two NVidia devices capable of OpenCL in the system, a (recent) 
Client (correctly) starts two such tasks, but both end up actually running on 
the same devices while the other being idle.

Here are some details that may or may not help to track down the problem:

- BOINC Client version 7.0.28
- the two tasks correctly get additional command-line arguments --device 0 and 
--device 1 respectively.
- init_data.xml of the two tasks contain
  <gpu_type>NVIDIA</gpu_type>
  <gpu_device_num>0</gpu_device_num>
  <gpu_opencl_dev_index>0</gpu_opencl_dev_index>
and
  <gpu_type>NVIDIA</gpu_type>
<gpu_device_num>1</gpu_device_num>
<gpu_opencl_dev_index>1</gpu_opencl_dev_index>
respectively
- the App was built with BOINC 9bef2edbf0fd6b9da2c282735935ce1b27727ddc (in current 
git-v2 repo, last commit was Charlie's "Fix file permissions" of Jan 11)
_______________________________________________
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.

Reply via email to