Browse Source

Select diablo kernel on all but GCN+SDK 2.6.

nfactor-troky
Con Kolivas 13 years ago
parent
commit
00290a3e02
  1. 2
      cgminer.c
  2. 4
      device-gpu.c
  3. 26
      ocl.c

2
cgminer.c

@ -714,7 +714,7 @@ static struct opt_table opt_config_table[] = {
"Specify a path to where the kernel .cl files are"), "Specify a path to where the kernel .cl files are"),
OPT_WITH_ARG("--kernel|-k", OPT_WITH_ARG("--kernel|-k",
opt_set_charp, NULL, &opt_kernel, opt_set_charp, NULL, &opt_kernel,
"Select kernel to use (poclbm, phatk or diakgcn - default: auto)"), "Select kernel to use (diablo, poclbm, phatk or diakgcn - default: auto)"),
#endif #endif
OPT_WITHOUT_ARG("--load-balance", OPT_WITHOUT_ARG("--load-balance",
set_loadbalance, &pool_strategy, set_loadbalance, &pool_strategy,

4
device-gpu.c

@ -1009,7 +1009,7 @@ static void opencl_detect()
strcmp(opt_kernel, "phatk") && strcmp(opt_kernel, "phatk") &&
strcmp(opt_kernel, "diakgcn") && strcmp(opt_kernel, "diakgcn") &&
strcmp(opt_kernel, "diablo")) strcmp(opt_kernel, "diablo"))
quit(1, "Invalid kernel name specified - must be poclbm, phatk or diakgcn"); quit(1, "Invalid kernel name specified - must be diablo, poclbm, phatk or diakgcn");
if (!strcmp(opt_kernel, "diakgcn")) if (!strcmp(opt_kernel, "diakgcn"))
chosen_kernel = KL_DIAKGCN; chosen_kernel = KL_DIAKGCN;
else if (!strcmp(opt_kernel, "poclbm")) else if (!strcmp(opt_kernel, "poclbm"))
@ -1147,12 +1147,12 @@ static bool opencl_thread_init(struct thr_info *thr)
thrdata->queue_kernel_parameters = &queue_poclbm_kernel; thrdata->queue_kernel_parameters = &queue_poclbm_kernel;
break; break;
case KL_PHATK: case KL_PHATK:
default:
thrdata->queue_kernel_parameters = &queue_phatk_kernel; thrdata->queue_kernel_parameters = &queue_phatk_kernel;
break; break;
case KL_DIAKGCN: case KL_DIAKGCN:
thrdata->queue_kernel_parameters = &queue_diakgcn_kernel; thrdata->queue_kernel_parameters = &queue_diakgcn_kernel;
break; break;
default:
case KL_DIABLO: case KL_DIABLO:
thrdata->queue_kernel_parameters = &queue_diablo_kernel; thrdata->queue_kernel_parameters = &queue_diablo_kernel;
break; break;

26
ocl.c

@ -117,13 +117,6 @@ int clDevicesNum(void) {
status = clGetPlatformInfo(platform, CL_PLATFORM_VERSION, sizeof(pbuff), pbuff, NULL); status = clGetPlatformInfo(platform, CL_PLATFORM_VERSION, sizeof(pbuff), pbuff, NULL);
if (status == CL_SUCCESS) if (status == CL_SUCCESS)
applog(LOG_INFO, "CL Platform %d version: %s", i, pbuff); applog(LOG_INFO, "CL Platform %d version: %s", i, pbuff);
if (strstr(pbuff, "844.4") /* Linux 64 bit ATI 2.6 SDK */ ||
strstr(pbuff, "851.4") /* Windows 64 bit "" */ ||
strstr(pbuff, "831.4") /* Windows & Linux 32 bit "" */ ||
strstr(pbuff, "898.1") /* Windows 64 bit 12.2 driver SDK */) {
applog(LOG_WARNING, "AMD OpenCL SDK 2.6 installed giving POOR PERFORMANCE on R5xxx and R6xxx.");
applog(LOG_WARNING, "Downgrade SDK, delete .bin files and restart cgminer to fix this.");
}
status = clGetDeviceIDs(platform, CL_DEVICE_TYPE_GPU, 0, NULL, &numDevices); status = clGetDeviceIDs(platform, CL_DEVICE_TYPE_GPU, 0, NULL, &numDevices);
if (status != CL_SUCCESS) { if (status != CL_SUCCESS) {
applog(LOG_ERR, "Error %d: Getting Device IDs (num)", status); applog(LOG_ERR, "Error %d: Getting Device IDs (num)", status);
@ -371,20 +364,19 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
char numbuf[10]; char numbuf[10];
if (chosen_kernel == KL_NONE) { if (chosen_kernel == KL_NONE) {
/* If no binary is available, and we have a card that suffers with phatk /* If no binary is available, and we have a card that suffers with diablo
* on SDK2.6, use the poclbm kernel instead if one has not been * on SDK2.6, use the poclbm kernel instead if one has not been
* selected. */ * selected. */
if (strstr(name, "Tahiti") // GCN if (strstr(name, "Tahiti") &&
|| !clState->hasBitAlign // Older Radeon & Nvidia (strstr(vbuff, "844.4") || // Linux 64 bit ATI 2.6 SDK
|| strstr(vbuff, "844.4") // Linux 64 bit ATI 2.6 SDK strstr(vbuff, "851.4") || // Windows 64 bit ""
|| strstr(vbuff, "851.4") // Windows 64 bit "" strstr(vbuff, "831.4"))) // Windows & Linux 32 bit ""
|| strstr(vbuff, "831.4") // Windows & Linux 32 bit "" {
) {
applog(LOG_INFO, "Selecting poclbm kernel"); applog(LOG_INFO, "Selecting poclbm kernel");
clState->chosen_kernel = KL_POCLBM; clState->chosen_kernel = KL_POCLBM;
} else { } else {
applog(LOG_INFO, "Selecting phatk kernel"); applog(LOG_INFO, "Selecting diablo kernel");
clState->chosen_kernel = KL_PHATK; clState->chosen_kernel = KL_DIABLO;
} }
} else } else
clState->chosen_kernel = chosen_kernel; clState->chosen_kernel = chosen_kernel;
@ -394,7 +386,6 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
strcpy(filename, POCLBM_KERNNAME".cl"); strcpy(filename, POCLBM_KERNNAME".cl");
strcpy(binaryfilename, POCLBM_KERNNAME); strcpy(binaryfilename, POCLBM_KERNNAME);
break; break;
case KL_NONE: /* Shouldn't happen */
case KL_PHATK: case KL_PHATK:
strcpy(filename, PHATK_KERNNAME".cl"); strcpy(filename, PHATK_KERNNAME".cl");
strcpy(binaryfilename, PHATK_KERNNAME); strcpy(binaryfilename, PHATK_KERNNAME);
@ -403,6 +394,7 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
strcpy(filename, DIAKGCN_KERNNAME".cl"); strcpy(filename, DIAKGCN_KERNNAME".cl");
strcpy(binaryfilename, DIAKGCN_KERNNAME); strcpy(binaryfilename, DIAKGCN_KERNNAME);
break; break;
case KL_NONE: /* Shouldn't happen */
case KL_DIABLO: case KL_DIABLO:
strcpy(filename, DIABLO_KERNNAME".cl"); strcpy(filename, DIABLO_KERNNAME".cl");
strcpy(binaryfilename, DIABLO_KERNNAME); strcpy(binaryfilename, DIABLO_KERNNAME);

Loading…
Cancel
Save