From 516eff60b045a1d916f2be3e47e0857c1efbe364 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Sat, 8 Dec 2012 03:27:09 -0500 Subject: [PATCH 1/3] - client: Hook up the XML portion of the Intel GPU detection code so the server scheduler knows about it. - client: Print out the peak flops for the Intel GPU, the regular OpenCL descriptions do not show peak flops. --- checkin_notes | 24 ++++++++++++++++++ client/client_state.cpp | 6 ++--- client/cs_scheduler.cpp | 6 ++--- client/cs_statefile.cpp | 4 +-- client/gpu_detect.cpp | 42 +++++++++++++++++++++++++++----- client/gpu_detect.h | 3 ++- client/gpu_intel.cpp | 50 ++++++++++++++++++++++++++++++++++++++ client/gpu_opencl.cpp | 26 ++++++++++++++------ client/log_flags.cpp | 8 +++--- lib/cc_config.cpp | 10 ++++---- lib/cc_config.h | 2 +- lib/coproc.cpp | 27 ++++++++++++++++++-- lib/coproc.h | 19 ++++++++++----- win_build/boinc_cli.vcproj | 4 +++ 14 files changed, 190 insertions(+), 41 deletions(-) create mode 100644 client/gpu_intel.cpp diff --git a/checkin_notes b/checkin_notes index 3f2309f855..da60c95e11 100644 --- a/checkin_notes +++ b/checkin_notes @@ -7385,3 +7385,27 @@ Rom 7 Dec 2012 client/ gpu_detect.cpp + +Rom 8 Dec 2012 + - client: Hook up the XML portion of the Intel GPU detection code so + the server scheduler knows about it. + - client: Print out the peak flops for the Intel GPU, the regular + OpenCL descriptions do not show peak flops. + + NOTE: At this point we should be supporting Intel GPUs as far as + detection and reporting its presence to the server goes. I don't + know about scheduling though. + + Thanks Tank Master for the interactive debug session in IRC. + + client\ + gpu_intel.cpp (Added) + client_state.cpp + cs_scheduler.cpp + cs_statefile.cpp + gpu_detect.cpp, .h + gpu_opencl.cpp + log_flags.cpp + lib\ + cc_config.cpp, .h + coproc.cpp, .h diff --git a/client/client_state.cpp b/client/client_state.cpp index 280100d0e3..53a9723380 100644 --- a/client/client_state.cpp +++ b/client/client_state.cpp @@ -372,7 +372,7 @@ int CLIENT_STATE::init() { vector warnings; coprocs.get( config.use_all_gpus, descs, warnings, - config.ignore_nvidia_dev, config.ignore_ati_dev, config.ignore_intel_gpu_dev + config.ignore_nvidia_dev, config.ignore_ati_dev, config.ignore_intel_dev ); for (i=0; i0) { msg_printf(NULL, MSG_INFO, "INTEL GPU info taken from cc_config.xml"); } else { - coprocs.add(coprocs.intel_gpu); + coprocs.add(coprocs.intel); } } host_info._coprocs = coprocs; diff --git a/client/cs_scheduler.cpp b/client/cs_scheduler.cpp index d664dbd77f..5ae84d8349 100644 --- a/client/cs_scheduler.cpp +++ b/client/cs_scheduler.cpp @@ -237,9 +237,9 @@ int CLIENT_STATE::make_scheduler_request(PROJECT* p) { } j = rsc_index(GPU_TYPE_INTEL); if (j > 0) { - coprocs.intel_gpu.req_secs = rsc_work_fetch[j].req_secs; - coprocs.intel_gpu.req_instances = rsc_work_fetch[j].req_instances; - coprocs.intel_gpu.estimated_delay = rsc_work_fetch[j].req_secs?rsc_work_fetch[j].busy_time_estimator.get_busy_time():0; + coprocs.intel.req_secs = rsc_work_fetch[j].req_secs; + coprocs.intel.req_instances = rsc_work_fetch[j].req_instances; + coprocs.intel.estimated_delay = rsc_work_fetch[j].req_secs?rsc_work_fetch[j].busy_time_estimator.get_busy_time():0; } if (coprocs.n_rsc > 1) { diff --git a/client/cs_statefile.cpp b/client/cs_statefile.cpp index 1b296ec12c..a141fd0205 100644 --- a/client/cs_statefile.cpp +++ b/client/cs_statefile.cpp @@ -937,8 +937,8 @@ int CLIENT_STATE::write_state_gui(MIOFILE& f) { if (coprocs.have_ati()) { f.printf("\n"); } - if (coprocs.have_intel_gpu()) { - f.printf("\n"); + if (coprocs.have_intel()) { + f.printf("\n"); } #if 1 diff --git a/client/gpu_detect.cpp b/client/gpu_detect.cpp index d462179f5f..685e67f753 100644 --- a/client/gpu_detect.cpp +++ b/client/gpu_detect.cpp @@ -64,15 +64,16 @@ void segv_handler(int) { vector ati_gpus; vector nvidia_gpus; +vector intel_gpus; vector ati_opencls; vector nvidia_opencls; -vector intel_gpu_opencls; +vector intel_opencls; void COPROCS::get( bool use_all, vector&descs, vector&warnings, vector& ignore_nvidia_dev, vector& ignore_ati_dev, - vector& ignore_intel_gpu_dev + vector& ignore_intel_dev ) { unsigned int i; char buf[256], buf2[256]; @@ -91,7 +92,13 @@ void COPROCS::get( warnings.push_back("Caught SIGSEGV in ATI GPU detection"); } try { - get_opencl(use_all, warnings, ignore_ati_dev, ignore_nvidia_dev, ignore_intel_gpu_dev); + intel.get(use_all, warnings, ignore_intel_dev); + } + catch (...) { + warnings.push_back("Caught SIGSEGV in INTEL GPU detection"); + } + try { + get_opencl(use_all, warnings, ignore_ati_dev, ignore_nvidia_dev, ignore_intel_dev); } catch (...) { warnings.push_back("Caught SIGSEGV in OpenCL detection"); @@ -110,6 +117,11 @@ void COPROCS::get( ati.get(use_all, warnings, ignore_ati_dev); } #endif + if (setjmp(resume)) { + warnings.push_back("Caught SIGSEGV in INTEL GPU detection"); + } else { + intel.get(use_all, warnings, ignore_intel_dev); + } if (setjmp(resume)) { warnings.push_back("Caught SIGSEGV in OpenCL detection"); } else { @@ -152,6 +164,23 @@ void COPROCS::get( descs.push_back(string(buf2)); } + for (i=0; i ati_gpus; extern vector nvidia_gpus; +extern vector intel_gpus; extern vector nvidia_opencls; extern vector ati_opencls; -extern vector intel_gpu_opencls; +extern vector intel_opencls; extern bool in_vector(int n, vector& v); diff --git a/client/gpu_intel.cpp b/client/gpu_intel.cpp new file mode 100644 index 0000000000..7c522affb1 --- /dev/null +++ b/client/gpu_intel.cpp @@ -0,0 +1,50 @@ +// This file is part of BOINC. +// http://boinc.berkeley.edu +// Copyright (C) 2012 University of California +// +// BOINC is free software; you can redistribute it and/or modify it +// under the terms of the GNU Lesser General Public License +// as published by the Free Software Foundation, +// either version 3 of the License, or (at your option) any later version. +// +// BOINC is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +// See the GNU Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public License +// along with BOINC. If not, see . + +// Detection of Intel GPUs +// + +#ifdef _WIN32 +#include "boinc_win.h" +#else +#ifdef __APPLE__ +// Suppress obsolete warning when building for OS 10.3.9 +#define DLOPEN_NO_WARN +#include +#endif +#include "config.h" +#include +#endif + +#include +#include + +using std::vector; +using std::string; + +#include "coproc.h" +#include "util.h" + +#include "client_msgs.h" +#include "gpu_detect.h" + +void COPROC_INTEL::get( + bool, + vector&, + vector& +) { +} diff --git a/client/gpu_opencl.cpp b/client/gpu_opencl.cpp index e2e8044742..02653c2046 100644 --- a/client/gpu_opencl.cpp +++ b/client/gpu_opencl.cpp @@ -115,7 +115,7 @@ void COPROCS::get_opencl( vector& warnings, vector& ignore_ati_dev, vector& ignore_nvidia_dev, - vector& ignore_intel_gpu_dev + vector& ignore_intel_dev ) { cl_int ciErrNum; cl_platform_id platforms[MAX_OPENCL_PLATFORMS]; @@ -330,16 +330,26 @@ void COPROCS::get_opencl( } if (device_type == CL_DEVICE_TYPE_CPU) continue; - prop.device_num = (int)(intel_gpu_opencls.size()); + prop.device_num = (int)(intel_opencls.size()); prop.opencl_device_index = device_index; COPROC_INTEL c; c.opencl_prop = prop; + c.is_used = COPROC_UNUSED; + c.available_ram = prop.global_mem_size; + strcpy(c.name, prop.name); + strcpy(c.version, prop.opencl_driver_version); + c.set_peak_flops(); prop.peak_flops = c.peak_flops; - prop.opencl_available_ram = prop.global_mem_size; - intel_gpu_opencls.push_back(prop); + + intel_opencls.push_back(prop); + + // At present Intel GPUs only support OpenCL and do not have a native + // GPGPU framework, so treat each detected Intel OpenCL GPU device as + // a native device. + intel_gpus.push_back(c); } } } @@ -358,7 +368,7 @@ void COPROCS::get_opencl( if ((nvidia_opencls.size() == 0) && (ati_opencls.size() == 0) && - (intel_gpu_opencls.size() == 0) + (intel_opencls.size() == 0) ) { warnings.push_back( "OpenCL library present but no OpenCL-capable GPUs found" @@ -386,9 +396,9 @@ void COPROCS::get_opencl( strcpy(ati.name, ati.opencl_prop.name); } - intel_gpu.find_best_opencls(use_all, intel_gpu_opencls, ignore_intel_gpu_dev); - intel_gpu.available_ram = intel_gpu.opencl_prop.global_mem_size; - strcpy(intel_gpu.name, intel_gpu.opencl_prop.name); + intel.find_best_opencls(use_all, intel_opencls, ignore_intel_dev); + intel.available_ram = intel.opencl_prop.global_mem_size; + strcpy(intel.name, intel.opencl_prop.name); // TODO: Add code to allow adding other GPU vendors } diff --git a/client/log_flags.cpp b/client/log_flags.cpp index a51aa7779c..b233b79771 100644 --- a/client/log_flags.cpp +++ b/client/log_flags.cpp @@ -191,7 +191,7 @@ void CONFIG::show() { } show_gpu_ignore(ignore_nvidia_dev, GPU_TYPE_NVIDIA); show_gpu_ignore(ignore_ati_dev, GPU_TYPE_ATI); - show_gpu_ignore(ignore_intel_gpu_dev, GPU_TYPE_ATI); + show_gpu_ignore(ignore_intel_dev, GPU_TYPE_ATI); for (i=0; i%d\n", - ignore_intel_gpu_dev[i] + ignore_intel_dev[i] ); } diff --git a/lib/cc_config.h b/lib/cc_config.h index f1a32a0456..3b1187acbd 100644 --- a/lib/cc_config.h +++ b/lib/cc_config.h @@ -157,7 +157,7 @@ struct CONFIG { int http_transfer_timeout; std::vector ignore_ati_dev; std::vector ignore_nvidia_dev; - std::vector ignore_intel_gpu_dev; + std::vector ignore_intel_dev; int max_file_xfers; int max_file_xfers_per_project; int max_stderr_file_size; diff --git a/lib/coproc.cpp b/lib/coproc.cpp index 4e6b3ea2aa..0ac05a7fae 100644 --- a/lib/coproc.cpp +++ b/lib/coproc.cpp @@ -324,6 +324,12 @@ void COPROCS::summary_string(char* buf, int len) { ); strlcat(buf, buf2, len); } + if (intel.count) { + sprintf(buf2,"[INTEL|%s|%d|%dMB|%s]", + intel.name, intel.count, intel.opencl_prop.global_mem_size/MEGA, intel.version + ); + strlcat(buf, buf2, len); + } } int COPROCS::parse(XML_PARSER& xp) { @@ -354,6 +360,15 @@ int COPROCS::parse(XML_PARSER& xp) { } continue; } + if (xp.match_tag("coproc_intel")) { + retval = intel.parse(xp); + if (retval) { + intel.clear(); + } else { + coprocs[n_rsc++] = intel; + } + continue; + } } return ERR_XML_PARSE; } @@ -368,6 +383,9 @@ void COPROCS::write_xml(MIOFILE& mf, bool scheduler_rpc) { if (ati.count) { ati.write_xml(mf, scheduler_rpc); } + if (intel.count) { + intel.write_xml(mf, scheduler_rpc); + } mf.printf(" \n"); #endif } @@ -964,6 +982,11 @@ int COPROC_INTEL::parse(XML_PARSER& xp) { return ERR_XML_PARSE; } +void COPROC_INTEL::description(char* buf) { + sprintf(buf, "%s (version %s, %.0fMB, %.0fMB available, %.0f GFLOPS peak)", + name, version, ((double)opencl_prop.global_mem_size)/MEGA, available_ram/MEGA, peak_flops/1.e9 + ); +} // http://en.wikipedia.org/wiki/Comparison_of_Intel_graphics_processing_units says: // The raw performance of integrated GPU, in single-precision FLOPS, @@ -978,7 +1001,7 @@ void COPROC_INTEL::set_peak_flops() { if (opencl_prop.max_compute_units) { x = opencl_prop.max_compute_units * 8 * opencl_prop.max_clock_frequency * 1e6; } - peak_flops = (x>0)?x:45e9; + peak_flops = (x>0)?x:45e9; } //TODO: Fix this @@ -1001,7 +1024,7 @@ const char* proc_type_name_xml(int pt) { case PROC_TYPE_CPU: return "CPU"; case PROC_TYPE_NVIDIA_GPU: return "NVIDIA"; case PROC_TYPE_AMD_GPU: return "ATI"; - case PROC_TYPE_INTEL_GPU: return "intel_gpu"; + case PROC_TYPE_INTEL_GPU: return "INTEL"; } return "unknown"; } diff --git a/lib/coproc.h b/lib/coproc.h index 765b23c268..9a04b7f071 100644 --- a/lib/coproc.h +++ b/lib/coproc.h @@ -166,7 +166,7 @@ struct OPENCL_DEVICE_PROP { void write_xml(MIOFILE&); #endif int parse(XML_PARSER&); -void description(char* buf, const char* type); + void description(char* buf, const char* type); }; @@ -378,6 +378,7 @@ struct COPROC_ATI : public COPROC { struct COPROC_INTEL : public COPROC { char name[256]; char version[50]; + double global_mem_size; COPROC_USAGE is_used; // temp used in scan process #ifndef _USING_FCGI_ @@ -386,6 +387,12 @@ struct COPROC_INTEL : public COPROC { COPROC_INTEL(): COPROC() { strcpy(type, proc_type_name_xml(PROC_TYPE_INTEL_GPU)); } + void get( + bool use_all, + std::vector&, + std::vector& ignore_devs + ); + void description(char*); void clear(); int parse(XML_PARSER&); void set_peak_flops(); @@ -397,7 +404,7 @@ struct COPROCS { COPROC coprocs[MAX_RSC]; COPROC_NVIDIA nvidia; COPROC_ATI ati; - COPROC_INTEL intel_gpu; + COPROC_INTEL intel; void write_xml(MIOFILE& out, bool scheduler_rpc); void get( @@ -471,8 +478,8 @@ struct COPROCS { inline bool have_ati() { return (ati.count > 0); } - inline bool have_intel_gpu() { - return (intel_gpu.count > 0); + inline bool have_intel() { + return (intel.count > 0); } int add(COPROC& c) { if (n_rsc >= MAX_RSC) return ERR_BUFFER_OVERFLOW; @@ -488,7 +495,7 @@ struct COPROCS { switch(t) { case PROC_TYPE_NVIDIA_GPU: return &nvidia; case PROC_TYPE_AMD_GPU: return &ati; - case PROC_TYPE_INTEL_GPU: return &intel_gpu; + case PROC_TYPE_INTEL_GPU: return &intel; } return NULL; } @@ -496,7 +503,7 @@ struct COPROCS { n_rsc = 0; nvidia.count = 0; ati.count = 0; - intel_gpu.count = 0; + intel.count = 0; COPROC c; strcpy(c.type, "CPU"); add(c); diff --git a/win_build/boinc_cli.vcproj b/win_build/boinc_cli.vcproj index deea5757c7..de5f0e32cf 100644 --- a/win_build/boinc_cli.vcproj +++ b/win_build/boinc_cli.vcproj @@ -691,6 +691,10 @@ RelativePath="..\client\gpu_detect.cpp" > + + From 2dd82881dea8f6930850bc299a276d2f6cd5ff07 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Sat, 8 Dec 2012 12:05:11 -0500 Subject: [PATCH 2/3] - client/server: fix build breaks I introduced last night with a variable rename. --- checkin_notes | 21 +++++++++++++++++++++ client/acct_mgr.cpp | 2 +- client/cpu_sched.cpp | 2 +- client/gpu_detect.cpp | 20 ++++++++++++++++---- clientgui/AdvancedFrame.cpp | 4 ++-- clientgui/AsyncRPC.cpp | 2 +- clientgui/BOINCTaskBar.cpp | 8 ++++---- clientgui/DlgItemProperties.cpp | 2 +- lib/gui_rpc_client.h | 2 +- lib/gui_rpc_client_ops.cpp | 4 ++-- sched/plan_class_spec.cpp | 4 ++-- sched/sched_send.cpp | 4 ++-- sched/sched_types.cpp | 2 +- 13 files changed, 55 insertions(+), 22 deletions(-) diff --git a/checkin_notes b/checkin_notes index da60c95e11..944f7d1be2 100644 --- a/checkin_notes +++ b/checkin_notes @@ -7409,3 +7409,24 @@ Rom 8 Dec 2012 lib\ cc_config.cpp, .h coproc.cpp, .h + +Rom 8 Dec 2012 + - client/server: fix build breaks I introduced last night with a variable + rename. + + client\ + acct_mgr.cpp + cpu_sched.cpp + gpu_detect.cpp + clientgui\ + AdvancedFrame.cpp + AsyncRPC.cpp + BOINCTaskBar.cpp + DlgItemProperties.cpp + lib\ + gui_rpc_client.h + gui_rpc_client_ops.cpp + sched\ + plan_class_spec.cpp + sched_send.cpp + sched_types.cpp diff --git a/client/acct_mgr.cpp b/client/acct_mgr.cpp index fcbe849126..1dedb10b4f 100644 --- a/client/acct_mgr.cpp +++ b/client/acct_mgr.cpp @@ -269,7 +269,7 @@ int AM_ACCOUNT::parse(XML_PARSER& xp) { handle_no_rsc(GPU_TYPE_NVIDIA, btemp); continue; } - if (xp.parse_bool("no_intel_gpu", btemp)) { + if (xp.parse_bool("no_intel", btemp)) { handle_no_rsc(GPU_TYPE_INTEL, btemp); continue; } diff --git a/client/cpu_sched.cpp b/client/cpu_sched.cpp index ddfc82d9bb..ef7d6f7552 100644 --- a/client/cpu_sched.cpp +++ b/client/cpu_sched.cpp @@ -1347,7 +1347,7 @@ static inline void assign_coprocs(vector& jobs) { if (coprocs.have_ati()) { copy_available_ram(coprocs.ati, GPU_TYPE_ATI); } - if (coprocs.have_intel_gpu()) { + if (coprocs.have_intel()) { copy_available_ram(coprocs.intel_gpu, GPU_TYPE_INTEL); } #endif diff --git a/client/gpu_detect.cpp b/client/gpu_detect.cpp index 685e67f753..07c3c5a7d1 100644 --- a/client/gpu_detect.cpp +++ b/client/gpu_detect.cpp @@ -125,7 +125,7 @@ void COPROCS::get( if (setjmp(resume)) { warnings.push_back("Caught SIGSEGV in OpenCL detection"); } else { - get_opencl(use_all, warnings, ignore_ati_dev, ignore_nvidia_dev, ignore_intel_gpu_dev); + get_opencl(use_all, warnings, ignore_ati_dev, ignore_nvidia_dev, ignore_intel_dev); } signal(SIGSEGV, old_sig); #endif @@ -141,7 +141,11 @@ void COPROCS::get( break; case COPROC_UNUSED: default: - sprintf(buf2, "NVIDIA GPU %d (not used): %s", nvidia_gpus[i].device_num, buf); + if (nvidia_gpus[i].opencl_prop.is_used) { + sprintf(buf2, "NVIDIA GPU %d (OpenCL only): %s", nvidia_gpus[i].device_num, buf); + } else { + sprintf(buf2, "NVIDIA GPU %d (not used): %s", nvidia_gpus[i].device_num, buf); + } break; } descs.push_back(string(buf2)); @@ -158,7 +162,11 @@ void COPROCS::get( break; case COPROC_UNUSED: default: - sprintf(buf2, "ATI GPU %d: (not used) %s", ati_gpus[i].device_num, buf); + if (ati_gpus[i].opencl_prop.is_used) { + sprintf(buf2, "ATI GPU %d: (OpenCL only) %s", ati_gpus[i].device_num, buf); + } else { + sprintf(buf2, "ATI GPU %d: (not used) %s", ati_gpus[i].device_num, buf); + } break; } descs.push_back(string(buf2)); @@ -175,7 +183,11 @@ void COPROCS::get( break; case COPROC_UNUSED: default: - sprintf(buf2, "INTEL GPU %d: (not used) %s", intel_gpus[i].device_num, buf); + if (intel_gpus[i].opencl_prop.is_used) { + sprintf(buf2, "INTEL GPU %d: (OpenCL only) %s", intel_gpus[i].device_num, buf); + } else { + sprintf(buf2, "INTEL GPU %d: (not used) %s", intel_gpus[i].device_num, buf); + } break; } descs.push_back(string(buf2)); diff --git a/clientgui/AdvancedFrame.cpp b/clientgui/AdvancedFrame.cpp index bb7dedae50..87e6c12c9b 100644 --- a/clientgui/AdvancedFrame.cpp +++ b/clientgui/AdvancedFrame.cpp @@ -470,7 +470,7 @@ bool CAdvancedFrame::CreateMenu() { _("Stop work regardless of preferences") ); - if (pDoc->state.have_nvidia || pDoc->state.have_ati || pDoc->state.have_intel_gpu) { + if (pDoc->state.have_nvidia || pDoc->state.have_ati || pDoc->state.have_intel) { #ifndef __WXGTK__ menuActivity->AppendSeparator(); @@ -1822,7 +1822,7 @@ void CAdvancedFrame::OnFrameRender(wxTimerEvent& WXUNUSED(event)) { CC_STATUS status; if ((pDoc->IsConnected()) && (0 == pDoc->GetCoreClientStatus(status))) { UpdateActivityModeControls(status); - if (pDoc->state.have_nvidia || pDoc->state.have_ati || pDoc->state.have_intel_gpu) { + if (pDoc->state.have_nvidia || pDoc->state.have_ati || pDoc->state.have_intel) { UpdateGPUModeControls(status); } UpdateNetworkModeControls(status); diff --git a/clientgui/AsyncRPC.cpp b/clientgui/AsyncRPC.cpp index 1047437d7d..6832333ad1 100644 --- a/clientgui/AsyncRPC.cpp +++ b/clientgui/AsyncRPC.cpp @@ -1006,7 +1006,7 @@ void CMainDocument::HandleCompletedRPC() { exchangeBuf->executing_as_daemon = arg1->executing_as_daemon; exchangeBuf->have_nvidia = arg1->have_nvidia; exchangeBuf->have_ati = arg1->have_ati; - exchangeBuf->have_intel_gpu = arg1->have_intel_gpu; + exchangeBuf->have_intel = arg1->have_intel; } break; case RPC_GET_RESULTS: diff --git a/clientgui/BOINCTaskBar.cpp b/clientgui/BOINCTaskBar.cpp index 02242a5eb7..99d589205b 100644 --- a/clientgui/BOINCTaskBar.cpp +++ b/clientgui/BOINCTaskBar.cpp @@ -523,7 +523,7 @@ wxMenu *CTaskBarIcon::BuildContextMenu() { pMenu->AppendSeparator(); m_SnoozeMenuItem = pMenu->AppendCheckItem(ID_TB_SUSPEND, _("Snooze"), wxEmptyString); - if (pDoc->state.have_nvidia || pDoc->state.have_ati || pDoc->state.have_intel_gpu) { + if (pDoc->state.have_nvidia || pDoc->state.have_ati || pDoc->state.have_intel) { m_SnoozeGPUMenuItem = pMenu->AppendCheckItem(ID_TB_SUSPEND_GPU, _("Snooze GPU"), wxEmptyString); } @@ -633,7 +633,7 @@ void CTaskBarIcon::AdjustMenuItems(wxMenu* pMenu) { } } - if (pDoc->state.have_nvidia || pDoc->state.have_ati || pDoc->state.have_intel_gpu) { + if (pDoc->state.have_nvidia || pDoc->state.have_ati || pDoc->state.have_intel) { switch (status.gpu_mode) { case RUN_MODE_NEVER: switch (status.gpu_mode_perm) { @@ -660,7 +660,7 @@ void CTaskBarIcon::AdjustMenuItems(wxMenu* pMenu) { } break; } - if (pDoc->state.have_nvidia || pDoc->state.have_ati || pDoc->state.have_intel_gpu) { + if (pDoc->state.have_nvidia || pDoc->state.have_ati || pDoc->state.have_intel) { if (status.task_mode == RUN_MODE_NEVER) { m_SnoozeGPUMenuItem->Check(false); m_SnoozeGPUMenuItem->Enable(false); @@ -724,7 +724,7 @@ void CTaskBarIcon::UpdateTaskbarStatus() { } strMessage += wxT(".\n"); - if (!comp_suspended && (pDoc->state.have_nvidia || pDoc->state.have_ati || pDoc->state.have_intel_gpu)) { + if (!comp_suspended && (pDoc->state.have_nvidia || pDoc->state.have_ati || pDoc->state.have_intel)) { switch(status.gpu_suspend_reason) { case 0: strMessage += _("GPU computing is enabled"); diff --git a/clientgui/DlgItemProperties.cpp b/clientgui/DlgItemProperties.cpp index 648fdcb6ef..b6822fe1e4 100644 --- a/clientgui/DlgItemProperties.cpp +++ b/clientgui/DlgItemProperties.cpp @@ -280,7 +280,7 @@ void CDlgItemProperties::renderInfos(PROJECT* project_in) { project->rsc_desc_ati ); } - if (pDoc->state.have_intel_gpu) { + if (pDoc->state.have_intel) { show_rsc( wxString(proc_type_name(PROC_TYPE_INTEL_GPU), wxConvUTF8), project->rsc_desc_intel_gpu diff --git a/lib/gui_rpc_client.h b/lib/gui_rpc_client.h index d91584c82e..030eae66c4 100644 --- a/lib/gui_rpc_client.h +++ b/lib/gui_rpc_client.h @@ -389,7 +389,7 @@ struct CC_STATE { TIME_STATS time_stats; bool have_nvidia; // deprecated; include for compat (set by ) bool have_ati; // deprecated; include for compat - bool have_intel_gpu; + bool have_intel; CC_STATE(); ~CC_STATE(); diff --git a/lib/gui_rpc_client_ops.cpp b/lib/gui_rpc_client_ops.cpp index d0fa3eaafa..79fc590e9e 100644 --- a/lib/gui_rpc_client_ops.cpp +++ b/lib/gui_rpc_client_ops.cpp @@ -982,7 +982,7 @@ int CC_STATE::parse(XML_PARSER& xp) { } if (xp.parse_bool("have_cuda", have_nvidia)) continue; if (xp.parse_bool("have_ati", have_ati)) continue; - if (xp.parse_bool("have_intel_gpu", have_intel_gpu)) continue; + if (xp.parse_bool("have_intel", have_intel)) continue; } return 0; } @@ -1014,7 +1014,7 @@ void CC_STATE::clear() { host_info.clear_host_info(); have_nvidia = false; have_ati = false; - have_intel_gpu = false; + have_intel = false; } PROJECT* CC_STATE::lookup_project(const char* url) { diff --git a/sched/plan_class_spec.cpp b/sched/plan_class_spec.cpp index ebea4e5b6c..92ed1058cc 100644 --- a/sched/plan_class_spec.cpp +++ b/sched/plan_class_spec.cpp @@ -375,7 +375,7 @@ bool PLAN_CLASS_SPEC::check(SCHEDULER_REQUEST& sreq, HOST_USAGE& hu) { // Intel GPU // } else if (!strcmp(gpu_type, "intel")) { - COPROC& cp = sreq.coprocs.intel_gpu; + COPROC& cp = sreq.coprocs.intel; cpp = &cp; if (!cp.count) { @@ -494,7 +494,7 @@ bool PLAN_CLASS_SPEC::check(SCHEDULER_REQUEST& sreq, HOST_USAGE& hu) { } else if (!strcmp(gpu_type, "nvidia")) { hu.proc_type = PROC_TYPE_NVIDIA_GPU; hu.gpu_usage = gpu_usage; - } else if (!strcmp(gpu_type, "intel_gpu")) { + } else if (!strcmp(gpu_type, "intel")) { hu.proc_type = PROC_TYPE_INTEL_GPU; hu.gpu_usage = gpu_usage; } diff --git a/sched/sched_send.cpp b/sched/sched_send.cpp index 069d07c815..414082c5f2 100644 --- a/sched/sched_send.cpp +++ b/sched/sched_send.cpp @@ -1512,9 +1512,9 @@ void send_gpu_messages() { proc_type_name(PROC_TYPE_AMD_GPU) ); } - if (g_request->coprocs.intel_gpu.count && ssp->have_apps_for_proc_type[PROC_TYPE_INTEL_GPU]) { + if (g_request->coprocs.intel.count && ssp->have_apps_for_proc_type[PROC_TYPE_INTEL_GPU]) { send_gpu_property_messages(gpu_requirements[PROC_TYPE_INTEL_GPU], - g_request->coprocs.intel_gpu.opencl_prop.global_mem_size, + g_request->coprocs.intel.opencl_prop.global_mem_size, 0, proc_type_name(PROC_TYPE_INTEL_GPU) ); diff --git a/sched/sched_types.cpp b/sched/sched_types.cpp index dce64735c3..dc69bb1cae 100644 --- a/sched/sched_types.cpp +++ b/sched/sched_types.cpp @@ -98,7 +98,7 @@ int CLIENT_APP_VERSION::parse(XML_PARSER& xp) { host_usage.proc_type = PROC_TYPE_NVIDIA_GPU; } else if (!strcmp(coproc_req.type, "ATI")) { host_usage.proc_type = PROC_TYPE_AMD_GPU; - } else if (!strcmp(coproc_req.type, "INTEL_GPU")) { + } else if (!strcmp(coproc_req.type, "INTEL")) { host_usage.proc_type = PROC_TYPE_INTEL_GPU; } } From c8ff613c446123ca2a1e90ea69e9daa275d746b8 Mon Sep 17 00:00:00 2001 From: Rom Walton Date: Sat, 8 Dec 2012 12:14:32 -0500 Subject: [PATCH 3/3] - client/server: Make sure the GPU Type field is really classified as an Intel GPU. --- checkin_notes | 7 +++++++ lib/coproc.cpp | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/checkin_notes b/checkin_notes index 944f7d1be2..a3b30b2ffe 100644 --- a/checkin_notes +++ b/checkin_notes @@ -7430,3 +7430,10 @@ Rom 8 Dec 2012 plan_class_spec.cpp sched_send.cpp sched_types.cpp + +Rom 8 Dec 2012 + - client/server: Make sure the GPU Type field is really classified as an Intel + GPU. + + lib\ + coproc.cpp diff --git a/lib/coproc.cpp b/lib/coproc.cpp index 0ac05a7fae..186f233cb8 100644 --- a/lib/coproc.cpp +++ b/lib/coproc.cpp @@ -942,7 +942,7 @@ void COPROC_INTEL::write_xml(MIOFILE& f, bool scheduler_rpc) { void COPROC_INTEL::clear() { COPROC::clear(); - strcpy(type, proc_type_name_xml(PROC_TYPE_AMD_GPU)); + strcpy(type, proc_type_name_xml(PROC_TYPE_INTEL_GPU)); estimated_delay = -1; strcpy(name, ""); strcpy(version, ""); @@ -1006,7 +1006,7 @@ void COPROC_INTEL::set_peak_flops() { //TODO: Fix this void COPROC_INTEL::fake(double ram, double avail_ram, int n) { - strcpy(type, proc_type_name_xml(PROC_TYPE_AMD_GPU)); + strcpy(type, proc_type_name_xml(PROC_TYPE_INTEL_GPU)); strcpy(version, "1.4.3"); strcpy(name, "foobar"); count = n;