Hi everybody,

I implemented a generic OpenCL plan class. We talked about it on the 
projects mailing list here:
http://lists.ssl.berkeley.edu/mailman/private/boinc_projects/2011-November/009132.html

The diff is quite short and below the mail. I encountered two problems, 
which I can't fix without more input (one of those could also be a user 
error on my side).

The first one is marked in the diff with //CAUTION, CHECK THIS BEFORE 
CHECKIN
In all the other opencl_checks or cuda_checks memory is always 
multiplied with a MEGA constant. The ATI opencl_check however reports 
memory in megabyte already (cp.opencl_prop.global_mem_size is in Mega 
for me) . Therefore I skipped the multiplication with MEGA. There could 
be an inconsistency between ati and nvidia here. It would be nice if 
someone with a recent nvidia card could check
cp.opencl_prop.global_mem_size in the opencl_check function and decide 
if it's already given in MB too.

The second thing I encountered, which I couldn't fix is the need_ati 
function.
inline bool need_ati() {
return (ati_req_secs>0) || (ati_req_instances>0);
}

Somehow this always returns false. I did not really understand where 
ati_req_secs and instances are set. For now I just return true here, as 
we have separate applications for opencl and cpu (hence a gpu is always 
needed).

The whole modified file is here:
http://www.timo-strunk.de/data/boinc/sched_customize.cpp

Thanks for your help,
Timo


--- sched_customize.cpp (revision 24689)
+++ sched_customize.cpp (working copy)
@@ -464,7 +464,44 @@
static inline bool app_plan_opencl(
SCHEDULER_REQUEST& sreq, const char* plan_class, HOST_USAGE& hu
) {
- if (strstr(plan_class, "nvidia")) {
+ //The plan class is called opencl_generic_101.
+ if (strstr(plan_class,"generic_101"))
+ {
+ //Generic class for 256Meg OpenCL accelerators with OpenCL >= 1.1
+ COPROC_NVIDIA& cn = sreq.coprocs.nvidia;
+ COPROC_ATI& ca = sreq.coprocs.ati;
+ bool result = false;
+ //First we check nvidia, if it's true, we shortcut out
+ if (cn.count != 0) {
+ if (cn.have_opencl) {
+ result = opencl_check(cn,hu,
+ 101,
+ //CAUTION, CHECK THIS BEFORE CHECKIN: 256.0 without Mega. The ati 
framework reports 1024Meg memory. Nvidia unknown.
+ 256.0,
+ 1,
+ .1,
+ .2
+ );
+ }
+ }
+ //Shortcut here
+ if (result) return true;
+
+ if (ca.count != 0) {
+ if (ca.have_opencl) {
+ result = opencl_check(ca,hu,
+ 101,
+ //CAUTION, CHECK THIS BEFORE CHECKIN: 256.0 without Mega. The ati 
framework reports 1024Meg memory. Nvidia unknown.
+ 256.0,
+ 1,
+ .1,
+ .2
+ );
+ }
+ }
+ return result;
+ }
+ else if (strstr(plan_class, "nvidia")) {
COPROC_NVIDIA& c = sreq.coprocs.nvidia;
if (!c.count) return false;
if (!c.have_opencl) return false;

----- end of diff

-- 
(0x2b |~ 0x2b)^2 == 1 (Shakespeare)
--
Karlsruhe Institute of Technology (KIT)
Institute of Nanotechnology

Timo Strunk
Physicist

Hermann-von-Helmholtz-Platz 1
Building 640, Room 0-215
76344 Eggenstein-Leopoldshafen, Germany

Phone: +49 721 6082-8954
Fax: +49 721 6082-6368
Email: [email protected]
http://www.int.kit.edu/

KIT – University of the State of Baden-Wuerttemberg and
National Laboratory of the Helmholtz Association

_______________________________________________
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