Merge branch 'master' of ssh://boinc.berkeley.edu/boinc-v2

This commit is contained in:
Joachim Fritzsch 2013-04-18 15:46:44 +02:00
commit 97860f15d0
3 changed files with 90 additions and 77 deletions

View File

@ -94,7 +94,8 @@ void APP_CONFIGS::config_app_versions(PROJECT* p) {
APP* app = gstate.lookup_app(p, ac.name);
if (!app) {
msg_printf(p, MSG_USER_ALERT,
"app %s not found in app_config.xml", ac.name
"Your app_config.xml file includes settings for application %s, which does not exist",
ac.name
);
continue;
}

View File

@ -15,7 +15,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with BOINC. If not, see <http://www.gnu.org/licenses/>.
// Detection of GPUs using OpenCL
// Detection of GPUs using OpenCL
#ifdef _WIN32
#include "boinc_win.h"
@ -91,12 +91,21 @@ cl_int (*__clGetDeviceInfo)(
#endif
static bool is_AMD(char *vendor) {
if ((strstr(vendor, GPU_TYPE_ATI)) ||
(strstr(vendor, "AMD")) ||
(strstr(vendor, "Advanced Micro Devices, Inc."))
) return true;
return false;
if (strstr(vendor, "ATI")) return true;
if (strstr(vendor, "AMD")) return true;
if (strstr(vendor, "Advanced Micro Devices, Inc.")) return true;
return false;
}
static bool is_NVIDIA(char* vendor) {
if (strstr(vendor, "NVIDIA")) return true;
return false;
}
static bool is_intel(char* vendor) {
if (strcasestr(vendor, "intel")) return true;
return false;
}
// If "loose", tolerate small diff
@ -117,7 +126,7 @@ int opencl_compare(OPENCL_DEVICE_PROP& c1, OPENCL_DEVICE_PROP& c2, bool loose) {
}
// OpenCL interfaces are documented here:
// http://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/ and
// http://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/ and
// http://www.khronos.org/registry/cl/sdk/1.1/docs/man/xhtml/
void COPROCS::get_opencl(
@ -189,7 +198,7 @@ void COPROCS::get_opencl(
warnings.push_back("clGetPlatformIDs() failed to return any OpenCL platforms");
return;
}
for (platform_index=0; platform_index<num_platforms; ++platform_index) {
ciErrNum = (*__clGetPlatformInfo)(
platforms[platform_index], CL_PLATFORM_VERSION,
@ -216,7 +225,7 @@ void COPROCS::get_opencl(
platforms[platform_index], CL_DEVICE_TYPE_GPU,
MAX_COPROC_INSTANCES, devices, &num_devices
);
if (ciErrNum == CL_DEVICE_NOT_FOUND) continue; // No devices
if (num_devices == 0) continue; // No devices
@ -232,7 +241,7 @@ void COPROCS::get_opencl(
// the Mac, so we can use this to match OpenCL devices with CUDA.
//
current_CUDA_index = 0;
// ATI/AMD OpenCL does not always recognize all GPUs returned by CAL.
// This is complicated for several reasons:
// * CAL returns only an enum (CALtargetEnum) for the GPU's family,
@ -272,7 +281,7 @@ void COPROCS::get_opencl(
++min_CAL_target;
}
}
for (device_index=0; device_index<num_devices; ++device_index) {
memset(&prop, 0, sizeof(prop));
prop.device_id = devices[device_index];
@ -280,17 +289,17 @@ void COPROCS::get_opencl(
prop.opencl_platform_version, platform_version,
sizeof(prop.opencl_platform_version)-1
);
//TODO: Should we store the platform(s) for each GPU found?
//TODO: Must we check if multiple platforms found the same GPU and merge the records?
ciErrNum = get_opencl_info(prop, device_index, warnings);
if (ciErrNum != CL_SUCCESS) continue;
prop.is_used = COPROC_UNUSED;
prop.get_device_version_int();
//////////// NVIDIA //////////////
if (strstr(prop.vendor, GPU_TYPE_NVIDIA)) {
if (is_NVIDIA(prop.vendor)) {
if (nvidia.have_cuda) {
// Mac OpenCL does not recognize all NVIDIA GPUs returned by
// CUDA but we assume that OpenCL and CUDA return devices in
@ -300,8 +309,8 @@ void COPROCS::get_opencl(
if (current_CUDA_index >= (int)(nvidia_gpus.size())) {
if (log_flags.coproc_debug) {
msg_printf(0, MSG_INFO,
"[coproc] OpenCL NVIDIA index #%d does not match any CUDA device",
device_index
"[coproc] OpenCL NVIDIA index #%d does not match any CUDA device",
device_index
);
}
return; // Should never happen
@ -339,23 +348,23 @@ void COPROCS::get_opencl(
nvidia_opencls.push_back(prop);
++current_CUDA_index;
}
//////////// AMD / ATI //////////////
if (is_AMD(prop.vendor)) {
prop.opencl_device_index = device_index;
if (ati.have_cal) {
// AMD OpenCL does not recognize all AMD GPUs returned by
// CAL but we assume that OpenCL and CAL return devices in
// the same order. See additional comments earlier in
// the same order. See additional comments earlier in
// this source file for more details.
//
while (1) {
if (current_CAL_index >= num_CAL_devices) {
if (log_flags.coproc_debug) {
msg_printf(0, MSG_INFO,
"[coproc] OpenCL ATI device #%d does not match any CAL device",
device_index
"[coproc] OpenCL ATI device #%d does not match any CAL device",
device_index
);
}
return; // Should never happen
@ -369,14 +378,14 @@ void COPROCS::get_opencl(
++current_CAL_index;
}
prop.device_num = current_CAL_index;
// Always use GPU model name from CAL if
// Always use GPU model name from CAL if
// available for ATI / AMD GPUs because
// (we believe) it is more user-friendly.
//
strcpy(prop.name, ati_gpus[prop.device_num].name);
// Work around a bug in OpenCL which returns only
// Work around a bug in OpenCL which returns only
// 1/2 of total global RAM size: use the value from CAL.
// This bug applies only to ATI GPUs, not to NVIDIA
// See also further workaround code for Macs.
@ -390,7 +399,7 @@ void COPROCS::get_opencl(
c.set_peak_flops();
prop.peak_flops = c.peak_flops;
}
if (ati_gpus.size()) {
prop.opencl_available_ram = ati_gpus[prop.device_num].available_ram;
} else {
@ -398,11 +407,12 @@ void COPROCS::get_opencl(
}
ati_opencls.push_back(prop);
}
//////////// INTEL GPU //////////////
if (strcasestr(prop.vendor, "intel")) {
//
if (is_intel(prop.vendor)) {
cl_device_type device_type;
ciErrNum = (*__clGetDeviceInfo)(
prop.device_id, CL_DEVICE_TYPE,
sizeof(device_type), &device_type, NULL
@ -419,7 +429,7 @@ void COPROCS::get_opencl(
prop.device_num = (int)(intel_gpu_opencls.size());
prop.opencl_device_index = device_index;
COPROC_INTEL c;
c.opencl_prop = prop;
c.is_used = COPROC_UNUSED;
@ -433,9 +443,11 @@ void COPROCS::get_opencl(
intel_gpu_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
// 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);
}
}
@ -444,9 +456,9 @@ void COPROCS::get_opencl(
#ifdef __APPLE__
// Work around a bug in OpenCL which returns only
// 1/2 of total global RAM size.
// 1/2 of total global RAM size.
// This bug applies only to ATI GPUs, not to NVIDIA
// This has already been fixed on latest Catalyst
// This has already been fixed on latest Catalyst
// drivers, but Mac does not use Catalyst drivers.
if (ati_opencls.size() > 0) {
opencl_get_ati_mem_size_from_opengl();
@ -462,7 +474,7 @@ void COPROCS::get_opencl(
);
return;
}
if (nvidia.have_cuda) { // If CUDA already found the "best" NVIDIA GPU
nvidia.merge_opencl(
nvidia_opencls, ignore_gpu_instance[PROC_TYPE_NVIDIA_GPU]
@ -495,8 +507,8 @@ void COPROCS::get_opencl(
}
cl_int COPROCS::get_opencl_info(
OPENCL_DEVICE_PROP& prop,
cl_uint device_index,
OPENCL_DEVICE_PROP& prop,
cl_uint device_index,
vector<string>&warnings
) {
cl_int ciErrNum;
@ -655,17 +667,17 @@ cl_int COPROCS::get_opencl_info(
return CL_SUCCESS;
}
// This is called for ATI GPUs with CAL or NVIDIA GPUs with CUDA, to merge
// This is called for ATI GPUs with CAL or NVIDIA GPUs with CUDA, to merge
// the OpenCL info into the CAL or CUDA data for the "best" CAL or CUDA GPU.
// This assumes that, for each GPU, we have previously correlated its CAL
// This assumes that, for each GPU, we have previously correlated its CAL
// or CUDA device_num with its opencl_device_index.
//
void COPROC::merge_opencl(
vector<OPENCL_DEVICE_PROP> &opencls,
vector<OPENCL_DEVICE_PROP> &opencls,
vector<int>& ignore_dev
) {
unsigned int i, j;
for (i=0; i<opencls.size(); i++) {
if (in_vector(opencls[i].device_num, ignore_dev)) {
opencls[i].is_used = COPROC_IGNORED;
@ -678,7 +690,7 @@ void COPROC::merge_opencl(
break;
}
}
opencl_device_count = 0;
// Fill in info for other GPUs which CAL or CUDA found equivalent to best
@ -698,11 +710,11 @@ void COPROC::merge_opencl(
//
void COPROC::find_best_opencls(
bool use_all,
vector<OPENCL_DEVICE_PROP> &opencls,
vector<OPENCL_DEVICE_PROP> &opencls,
vector<int>& ignore_dev
) {
unsigned int i;
// identify the most capable ATI or NVIDIA OpenCL GPU
//
bool first = true;
@ -727,7 +739,7 @@ void COPROC::find_best_opencls(
}
}
// see which other instances are equivalent, and set the count,
// see which other instances are equivalent, and set the count,
// device_nums, opencl_device_count and opencl_device_ids fields
//
count = 0;
@ -748,7 +760,7 @@ void COPROC::find_best_opencls(
#ifdef __APPLE__
// OpenCL returns incorrect total RAM size for some
// OpenCL returns incorrect total RAM size for some
// ATI GPUs so we get that info from OpenGL on Macs
#include <OpenGL/OpenGL.h>
@ -773,16 +785,16 @@ void COPROCS::opencl_get_ati_mem_size_from_opengl() {
for (i=0; i<32; ++i) {
rendererIDs[i] = 0;
modelName[i] = NULL;
CGOpenGLDisplayMask myMask = 1 << i;
CGDirectDisplayID displayID = CGOpenGLDisplayMaskToDisplayID(myMask);
theErr2 = CGLQueryRendererInfo(myMask, &info, &numRenderers);
theErr2 = CGLQueryRendererInfo(myMask, &info, &numRenderers);
if ((displayID != kCGNullDirectDisplay) && (theErr2 == kCGLNoError)) {
// Get the I/O Kit service port for the display
io_registry_entry_t dspPort = CGDisplayIOServicePort(displayID);
for (j = 0; j < numRenderers; j++) {
// find accelerated renderer (assume only one)
CGLDescribeRenderer (info, j, kCGLRPAcceleratedCompute, &rv);
CGLDescribeRenderer (info, j, kCGLRPAcceleratedCompute, &rv);
if (true == rv) { // if openCL-capable
// what is the renderer ID
CGLDescribeRenderer (info, j, kCGLRPRendererID, &rendererIDs[i]);
@ -805,8 +817,8 @@ void COPROCS::opencl_get_ati_mem_size_from_opengl() {
if (ati_gpu_index >= (int)ati_opencls.size()) {
break;
}
CGLDescribeRenderer (info, i, kCGLRPAcceleratedCompute, &rv);
CGLDescribeRenderer (info, i, kCGLRPAcceleratedCompute, &rv);
if (true == rv) { // if openCL-capable
// what is the renderer ID
CGLDescribeRenderer (info, i, kCGLRPRendererID, &rendererID);
@ -816,7 +828,7 @@ void COPROCS::opencl_get_ati_mem_size_from_opengl() {
// build context and context specific info
CGLPixelFormatAttribute attribs[] = {
kCGLPFARendererID,
(CGLPixelFormatAttribute)rendererID,
(CGLPixelFormatAttribute)rendererID,
kCGLPFAAllowOfflineRenderers,
(CGLPixelFormatAttribute)0
};
@ -844,7 +856,7 @@ void COPROCS::opencl_get_ati_mem_size_from_opengl() {
*++p='M';
*++p='D';
}
for (j=0; j<32; j++) {
if ((rendererID == rendererIDs[j]) && (modelName[j] != NULL)) {
break;
@ -872,8 +884,8 @@ void COPROCS::opencl_get_ati_mem_size_from_opengl() {
*++p='D';
}
}
if ((strRend == NULL) ||
if ((strRend == NULL) ||
(!strstr(iokit_name, opencl_name))) {
msg_printf(0, MSG_INFO,
"[coproc] opencl_get_ati_mem_size_from_opengl model name to renderer mismatch: %s vs %s\n",
@ -885,7 +897,7 @@ void COPROCS::opencl_get_ati_mem_size_from_opengl() {
ati_gpu_index++;
} // End if ATI / AMD GPU
CGLDestroyContext (cglContext);
} else {
if (log_flags.coproc_debug) {
@ -905,14 +917,14 @@ void COPROCS::opencl_get_ati_mem_size_from_opengl() {
} // End loop: for (i = 0; i < numRenderers; i++)
CGLDestroyRendererInfo (info);
}
if (log_flags.coproc_debug) {
for (j=0; j<32; j++) {
if (modelName[j] != NULL) {
CFRelease(modelName[j]);
}
}
}
}
CGLSetCurrentContext (curr_ctx); // restore current CGL context
}
#endif

View File

@ -44,10 +44,10 @@ function linux_info() {
}
$w70dev = array(
"num"=>"7.0.62",
"num"=>"7.0.64",
"status"=>"Development version",
"file"=>"boinc_7.0.62_windows_intelx86.exe",
"date"=>"9 Apr 2013",
"file"=>"boinc_7.0.64_windows_intelx86.exe",
"date"=>"17 Apr 2013",
"type"=>"win_new",
);
@ -84,10 +84,10 @@ $w5816 = array(
);
$w70x64dev = array(
"num"=>"7.0.62",
"num"=>"7.0.64",
"status"=>"Development version",
"file"=>"boinc_7.0.62_windows_x86_64.exe",
"date"=>"9 Apr 2013",
"file"=>"boinc_7.0.64_windows_x86_64.exe",
"date"=>"17 Apr 2013",
"type"=>"win_new",
);
@ -108,10 +108,10 @@ $w612x64 = array(
);
$m70dev = array(
"num"=>"7.0.62",
"num"=>"7.0.65",
"status"=>"Development version (standard GUI)",
"file"=>"boinc_7.0.62_macOSX_i686.zip",
"date"=>"10 Apr 2013",
"file"=>"boinc_7.0.65_macOSX_i686.zip",
"date"=>"17 Apr 2013",
"type"=>"mac_advanced",
);
@ -148,10 +148,10 @@ $m66 = array(
);
$m70cdev = array(
"num"=>"7.0.62",
"num"=>"7.0.65",
"status"=>"Development version (Unix command-line version)",
"file"=>"boinc_7.0.62_i686-apple-darwin.zip",
"date"=>"10 Apr 2013",
"file"=>"boinc_7.0.65_i686-apple-darwin.zip",
"date"=>"17 Apr 2013",
"type"=>"bare_core",
);
@ -204,10 +204,10 @@ $l66 = array(
);
$l70ubuntudev = array(
"num"=>"7.0.62",
"num"=>"7.0.65",
"status"=>"Development version",
"file"=>"boinc_7.0.62_i686-pc-linux-gnu.sh",
"date"=>"9 Apr 2013",
"file"=>"boinc_7.0.65_i686-pc-linux-gnu.sh",
"date"=>"17 Apr 2013",
"type"=>"sea",
);
@ -228,10 +228,10 @@ $l612ubuntu = array(
);
$l70ubuntux64dev = array(
"num"=>"7.0.62",
"num"=>"7.0.65",
"status"=>"Development version",
"file"=>"boinc_7.0.62_x86_64-pc-linux-gnu.sh",
"date"=>"9 Apr 2013",
"file"=>"boinc_7.0.65_x86_64-pc-linux-gnu.sh",
"date"=>"17 Apr 2013",
"type"=>"sea",
);