Provide warning on each startup about sdk 2.6 and decrease poclbm kernel selection to LOG_INFO.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
diff --git a/ocl.c b/ocl.c
index bd3f72e..ff2551e 100644
--- a/ocl.c
+++ b/ocl.c
@@ -111,6 +111,12 @@ int clDevicesNum(void) {
status = clGetPlatformInfo(platform, CL_PLATFORM_VERSION, sizeof(pbuff), pbuff, NULL);
if (status == CL_SUCCESS)
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 "" */ ) {
+ 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);
if (status != CL_SUCCESS) {
applog(LOG_ERR, "Error: Getting Device IDs (num)");
@@ -231,6 +237,13 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
if (status == CL_SUCCESS)
applog(LOG_INFO, "CL Platform version: %s", vbuff);
+ if (strstr(vbuff, "844.4") /* Linux 64 bit ATI 2.6 SDK */ ||
+ strstr(vbuff, "851.4") /* Windows 64 bit "" */ ||
+ strstr(vbuff, "831.4") /* Windows & Linux 32 bit "" */ ) {
+ 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);
if (status != CL_SUCCESS) {
applog(LOG_ERR, "Error: Getting Device IDs (num)");
@@ -356,15 +369,21 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
char numbuf[10];
if (chosen_kernel == KL_NONE) {
+ /* If no binary is available, and we have a card that suffers with phatk
+ * on SDK2.6, use the poclbm kernel instead if one has not been
+ * selected. */
if (strstr(name, "Tahiti") // GCN
|| !clState->hasBitAlign // Older Radeon & Nvidia
|| strstr(vbuff, "844.4") // Linux 64 bit ATI 2.6 SDK
|| strstr(vbuff, "851.4") // Windows 64 bit ""
|| strstr(vbuff, "831.4") // Windows & Linux 32 bit ""
- )
+ ) {
+ applog(LOG_INFO, "Selecting poclbm kernel");
clState->chosen_kernel = KL_POCLBM;
- else
+ } else {
+ applog(LOG_INFO, "Selecting phatk kernel");
clState->chosen_kernel = KL_PHATK;
+ }
} else
clState->chosen_kernel = chosen_kernel;
@@ -481,20 +500,6 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
/////////////////////////////////////////////////////////////////
build:
- /* If no binary is available, and we have a card that suffers with phatk
- * on SDK2.6, use the poclbm kernel instead if one has not been
- * selected. */
- if (clState->chosen_kernel == KL_POCLBM && chosen_kernel == KL_NONE &&
- !strstr(name, "Tahiti") && clState->hasBitAlign &&
- (strstr(vbuff, "844.4") /* Linux 64 bit ATI 2.6 SDK */ ||
- strstr(vbuff, "851.4") /* Windows 64 bit "" */ ||
- strstr(vbuff, "831.4") /* Windows & Linux 32 bit "" */ )) {
- applog(LOG_WARNING, "AMD OpenCL SDK 2.6 detected, using poclbm kernel");
- applog(LOG_WARNING, "This SDK will give POOR PERFORMANCE on this device");
- applog(LOG_WARNING, "To get best performance, remove any .bin files generated by cgminer,");
- applog(LOG_WARNING, "downgrade your SDK to 2.1-2.5 and restart cgminer.");
- }
-
clState->program = clCreateProgramWithSource(clState->context, 1, (const char **)&source, sourceSize, &status);
if (status != CL_SUCCESS) {
applog(LOG_ERR, "Error: Loading Binary into cl_program (clCreateProgramWithSource)");