Browse Source

Merge branch 'master' into myfork

Luke Dashjr 13 years ago
parent
commit
e22771e9d0
5 changed files with 235 additions and 15 deletions
  1. 27 10
      NEWS
  2. 108 4
      README
  3. 88 0
      cgminer.c
  4. 2 0
      miner.h
  5. 10 1
      ocl.c

+ 27 - 10
NEWS

@@ -1,26 +1,43 @@
+Version 2.3.4 - April 25, 2012
 
 
+- Extensively document the cause of GPU device issues and the use of --gpu-map.
+- Support for share logging
+- Detect poorly performing combination of SDK and phatk kernel and add verbose
+warning at startup.
 - Icarus update to new add_cgpu()
 - Icarus update to new add_cgpu()
 - Icarus driver working with Linux and Windows
 - Icarus driver working with Linux and Windows
 - api.c fix unused variable compile warning
 - api.c fix unused variable compile warning
-- Display all OpenCL devices when -n is called as well to allow debugging of differential mapping of OpenCL to ADL.
-- Add a --gpu-map option which will allow arbitrarily mapping ADL devices to OpenCL devices for instances where association by enumeration alone fails.
-- Increase upper limit on number of extra items to queue as some FPGA code can't yet reliably keep many devices busy.
-- Display configuration file information when -c option is passed and only when file exists on loading default config file.
-- Display configuration file loaded, if any, and debug output if configuration file parsing failed.
+- Display all OpenCL devices when -n is called as well to allow debugging of
+differential mapping of OpenCL to ADL.
+- Add a --gpu-map option which will allow arbitrarily mapping ADL devices to
+OpenCL devices for instances where association by enumeration alone fails.
+- Increase upper limit on number of extra items to queue as some FPGA code can't
+yet reliably keep many devices busy.
+- Display configuration file information when -c option is passed and only when
+file exists on loading default config file.
+- Display configuration file loaded, if any, and debug output if configuration
+file parsing failed.
 - Add missing ztex header to Makefile for distribution.
 - Add missing ztex header to Makefile for distribution.
-- Document long-form COM port device names on Windows, required to specify serial ports above 9
+- Document long-form COM port device names on Windows, required to specify
+serial ports above 9
 - Include ztex bitstreams firmware in distribution and install if configured in.
 - Include ztex bitstreams firmware in distribution and install if configured in.
 - Style police on driver-ztex.c
 - Style police on driver-ztex.c
 - work_restart should only be changed by cgminer.c now
 - work_restart should only be changed by cgminer.c now
-- Shut down the api cleanly when the api thread is cancelled. This should allow the api socket to be closed successfully to next be reopened with app_restart.
-- Make a union for cgpu device handles, and rename "device" to "device_ztex" since it's Ztex-specific
+- Shut down the api cleanly when the api thread is cancelled. This should allow
+the api socket to be closed successfully to next be reopened with app_restart.
+- Make a union for cgpu device handles, and rename "device" to "device_ztex"
+since it's Ztex-specific
 - Initialise name variable.
 - Initialise name variable.
 - Remove unnecessary check for variable that always has memory allocated.
 - Remove unnecessary check for variable that always has memory allocated.
 - Bugfix: Missing "break" no-op in default case
 - Bugfix: Missing "break" no-op in default case
-- Make the status window and log window as large as can fit on startup, rechecking to see if it can be enlarged after the fact. This allows any number of devices to be displayed provided the window is made long enough without corrupting the output.
+- Make the status window and log window as large as can fit on startup,
+rechecking to see if it can be enlarged after the fact. This allows any number
+of devices to be displayed provided the window is made long enough without
+corrupting the output.
 - Style police on libztex.c.
 - Style police on libztex.c.
 - API add removepool like the screen interface
 - API add removepool like the screen interface
-- api.c escape required characters in return strings + pools returns the username
+- api.c escape required characters in return strings + pools returns the
+username
 - Set lp_path to NULL after free for consistency.
 - Set lp_path to NULL after free for consistency.
 - Removing dmalloc import left behind by mistake
 - Removing dmalloc import left behind by mistake
 - Fixing leak in resp_hdr_cb
 - Fixing leak in resp_hdr_cb

+ 108 - 4
README

@@ -156,6 +156,7 @@ Options for both config file and command line:
 --scan-time|-s <arg> Upper bound on time spent scanning current work, in seconds (default: 60)
 --scan-time|-s <arg> Upper bound on time spent scanning current work, in seconds (default: 60)
 --sched-start <arg> Set a time of day in HH:MM to start mining (a once off without a stop time)
 --sched-start <arg> Set a time of day in HH:MM to start mining (a once off without a stop time)
 --sched-stop <arg>  Set a time of day in HH:MM to stop mining (will quit without a start time)
 --sched-stop <arg>  Set a time of day in HH:MM to stop mining (will quit without a start time)
+--sharelog <arg>    Append share log to file
 --shares <arg>      Quit after mining N shares (default: unlimited)
 --shares <arg>      Quit after mining N shares (default: unlimited)
 --socks-proxy <arg> Set socks4 proxy (host:port)
 --socks-proxy <arg> Set socks4 proxy (host:port)
 --submit-stale      Submit shares even if they would normally be considered stale
 --submit-stale      Submit shares even if they would normally be considered stale
@@ -183,6 +184,7 @@ GPU only options:
 --gpu-dyninterval <arg> Set the refresh interval in ms for GPUs using dynamic intensity (default: 7)
 --gpu-dyninterval <arg> Set the refresh interval in ms for GPUs using dynamic intensity (default: 7)
 --gpu-engine <arg>  GPU engine (over)clock range in Mhz - one value, range and/or comma separated list (e.g. 850-900,900,750-850)
 --gpu-engine <arg>  GPU engine (over)clock range in Mhz - one value, range and/or comma separated list (e.g. 850-900,900,750-850)
 --gpu-fan <arg>     GPU fan percentage range - one value, range and/or comma separated list (e.g. 25-85,85,65)
 --gpu-fan <arg>     GPU fan percentage range - one value, range and/or comma separated list (e.g. 25-85,85,65)
+--gpu-map <arg>     Map OpenCL to ADL device order manually, paired CSV (e.g. 1:0,2:1 maps OpenCL 1 to ADL 0, 2 to 1)
 --gpu-memclock <arg> Set the GPU memory (over)clock in Mhz - one value for all or separate by commas for per card.
 --gpu-memclock <arg> Set the GPU memory (over)clock in Mhz - one value for all or separate by commas for per card.
 --gpu-memdiff <arg> Set a fixed difference in clock speed between the GPU and memory in auto-gpu mode
 --gpu-memdiff <arg> Set a fixed difference in clock speed between the GPU and memory in auto-gpu mode
 --gpu-powertune <arg> Set the GPU powertune percentage - one value for all or separate by commas for per card.
 --gpu-powertune <arg> Set the GPU powertune percentage - one value for all or separate by commas for per card.
@@ -216,7 +218,7 @@ FPGA mining boards(BitForce, Icarus) only options:
        (where n = the correct device number for the FPGA device)
        (where n = the correct device number for the FPGA device)
 
 
 
 
-CPU only options:
+CPU only options (deprecated, not included in binaries!):
 
 
 --algo|-a <arg>     Specify sha256 implementation for CPU mining:
 --algo|-a <arg>     Specify sha256 implementation for CPU mining:
         auto            Benchmark at startup and pick fastest algorithm
         auto            Benchmark at startup and pick fastest algorithm
@@ -415,10 +417,32 @@ if you use
 ./cgminer -o xxx -u yyy -p zzz 2>logfile.txt
 ./cgminer -o xxx -u yyy -p zzz 2>logfile.txt
 it will log to a file called logfile.txt and otherwise work the same.
 it will log to a file called logfile.txt and otherwise work the same.
 
 
-
 There is also the -m option on linux which will spawn a command of your choice
 There is also the -m option on linux which will spawn a command of your choice
 and pipe the output directly to that command.
 and pipe the output directly to that command.
 
 
+
+If you start cgminer with the --sharelog option, you can get detailed
+information for each share found. The argument to the option may be "-" for
+standard output (not advisable with the ncurses UI), any valid positive number
+for that file descriptor, or a filename.
+
+To log share data to a file named "share.log", you can use either:
+./cgminer --sharelog 50 -o xxx -u yyy -p zzz 50>share.log
+./cgminer --sharelog share.log -o xxx -u yyy -p zzz
+
+For every share found, data will be logged in a CSV (Comma Separated Value)
+format:
+    timestamp,disposition,target,pool,dev,thr,sharehash,sharedata
+For example (this is wrapped, but it's all on one line for real):
+    1335313090,reject,
+    ffffffffffffffffffffffffffffffffffffffffffffffffffffffff00000000,
+    http://localhost:8337,GPU0,0,
+    6f983c918f3299b58febf95ec4d0c7094ed634bc13754553ec34fc3800000000,
+    00000001a0980aff4ce4a96d53f4b89a2d5f0e765c978640fe24372a000001c5
+    000000004a4366808f81d44f26df3d69d7dc4b3473385930462d9ab707b50498
+    f681634a4f1f63d01a0cd43fb338000000000080000000000000000000000000
+    0000000000000000000000000000000000000000000000000000000080020000
+
 ---
 ---
 OVERCLOCKING WARNING AND INFORMATION
 OVERCLOCKING WARNING AND INFORMATION
 
 
@@ -813,6 +837,81 @@ miner.php - an example web page to access the API
  Read the top of the file (miner.php) for details of how to tune the display
  Read the top of the file (miner.php) for details of how to tune the display
  and also to use the option to display a multi-rig summary
  and also to use the option to display a multi-rig summary
 
 
+---
+
+GPU DEVICE ISSUES and use of --gpu-map
+
+GPUs mine with OpenCL software via the GPU device driver. This means you need
+to have both an OpenCL SDK installed, and the GPU device driver RUNNING (i.e.
+Xorg up and running configured for all devices that will mine on linux etc.)
+Meanwhile, the hardware monitoring that cgminer offers for AMD devices relies
+on the ATI Display Library (ADL) software to work. OpenCL DOES NOT TALK TO THE
+ADL. There is no 100% reliable way to know that OpenCL devices are identical
+to the ADL devices, as neither give off the same information. cgminer does its
+best to correlate these devices based on the order that OpenCL and ADL numbers
+them. It is possible that this will fail for the following reasons:
+
+1. The device order is listed differently by OpenCL and ADL (rare), even if the
+number of devices is the same.
+2. There are more OpenCL devices than ADL. OpenCL stupidly sees one GPU as two
+devices if you have two monitors connected to the one GPU.
+3. There are more ADL devices than OpenCL. ADL devices include any ATI GPUs,
+including ones that can't mine, like some older R4xxx cards.
+
+To cope with this, the ADVANCED option for --gpu-map is provided with cgminer.
+DO NOT USE THIS UNLESS YOU KNOW WHAT YOU ARE DOING. The default will work the
+vast majority of the time unless you know you have a problem already.
+
+To get useful information, start cgminer with just the -n option. You will get
+output that looks like this:
+
+[2012-04-25 13:17:34] CL Platform 0 vendor: Advanced Micro Devices, Inc.
+[2012-04-25 13:17:34] CL Platform 0 name: AMD Accelerated Parallel Processing
+[2012-04-25 13:17:34] CL Platform 0 version: OpenCL 1.1 AMD-APP (844.4)
+[2012-04-25 13:17:34] Platform 0 devices: 3
+[2012-04-25 13:17:34]   0       Tahiti
+[2012-04-25 13:17:34]   1       Tahiti
+[2012-04-25 13:17:34]   2       Cayman
+[2012-04-25 13:17:34] GPU 0 AMD Radeon HD 7900 Series  hardware monitoring enabled
+[2012-04-25 13:17:34] GPU 1 AMD Radeon HD 7900 Series  hardware monitoring enabled
+[2012-04-25 13:17:34] GPU 2 AMD Radeon HD 6900 Series hardware monitoring enabled
+[2012-04-25 13:17:34] 3 GPU devices max detected
+
+Note the number of devices here match, and the order is the same. If devices 1
+and 2 were different between Tahiti and Cayman, you could run cgminer with:
+--gpu-map 2:1,1:2
+And it would swap the monitoring it received from ADL device 1 and put it to
+opencl device 2 and vice versa.
+
+If you have 2 monitors connected to the first device it would look like this:
+
+[2012-04-25 13:17:34] Platform 0 devices: 4
+[2012-04-25 13:17:34]   0       Tahiti
+[2012-04-25 13:17:34]   1       Tahiti
+[2012-04-25 13:17:34]   2       Tahiti
+[2012-04-25 13:17:34]   3       Cayman
+[2012-04-25 13:17:34] GPU 0 AMD Radeon HD 7900 Series  hardware monitoring enabled
+[2012-04-25 13:17:34] GPU 1 AMD Radeon HD 7900 Series  hardware monitoring enabled
+[2012-04-25 13:17:34] GPU 2 AMD Radeon HD 6900 Series hardware monitoring enabled
+
+To work around this, you would use:
+-d 0 -d 2 -d 3 --gpu-map 2:1,3:2
+
+If you have an older card as well as the rest it would look like this:
+
+[2012-04-25 13:17:34] Platform 0 devices: 3
+[2012-04-25 13:17:34]   0       Tahiti
+[2012-04-25 13:17:34]   1       Tahiti
+[2012-04-25 13:17:34]   2       Cayman
+[2012-04-25 13:17:34] GPU 0 AMD Radeon HD 4500 Series  hardware monitoring enabled
+[2012-04-25 13:17:34] GPU 1 AMD Radeon HD 7900 Series  hardware monitoring enabled
+[2012-04-25 13:17:34] GPU 2 AMD Radeon HD 7900 Series  hardware monitoring enabled
+[2012-04-25 13:17:34] GPU 3 AMD Radeon HD 6900 Series hardware monitoring enabled
+
+To work around this you would use:
+--gpu-map 0:1,1:2,2:3
+
+
 ---
 ---
 
 
 FAQ
 FAQ
@@ -908,6 +1007,10 @@ no longer under active development and will not be supported unless someone
 steps up to help maintain it. No binary builds supporting CPU mining will be
 steps up to help maintain it. No binary builds supporting CPU mining will be
 released but CPU mining can be built into cgminer when it is compiled.
 released but CPU mining can be built into cgminer when it is compiled.
 
 
+Q: I upgraded cgminer version and mu hashrate suddenly dropped!
+A: No, you upgraded your SDK version unwittingly between upgrades of cgminer
+and that caused  your hashrate to drop. See the next question.
+
 Q: I upgraded my ATI driver/SDK/cgminer and my hashrate suddenly dropped!
 Q: I upgraded my ATI driver/SDK/cgminer and my hashrate suddenly dropped!
 A: The hashrate performance in cgminer is tied to the version of the ATI SDK
 A: The hashrate performance in cgminer is tied to the version of the ATI SDK
 that is installed only for the very first time cgminer is run. This generates
 that is installed only for the very first time cgminer is run. This generates
@@ -916,11 +1019,12 @@ SDK after that time will have no effect on the binaries. However, if you
 install a fresh version of cgminer, and have since upgraded your SDK, new
 install a fresh version of cgminer, and have since upgraded your SDK, new
 binaries will be built. It is known that the 2.6 ATI SDK has a huge hashrate
 binaries will be built. It is known that the 2.6 ATI SDK has a huge hashrate
 penalty on generating new binaries. It is recommended to not use this SDK at
 penalty on generating new binaries. It is recommended to not use this SDK at
-this time.
+this time unless you are using an ATI 7xxx card that needs it.
 
 
 Q: Which ATI SDK is the best for cgminer?
 Q: Which ATI SDK is the best for cgminer?
 A: At the moment, versions 2.4 and 2.5 work the best. If you are forced to use
 A: At the moment, versions 2.4 and 2.5 work the best. If you are forced to use
-the 2.6 SDK.
+the 2.6 SDK, the phatk kernel will perform poorly, while the diablo or my
+custom modified poclbm kernel are optimised for it.
 
 
 Q: I have multiple SDKs installed, can I choose which one it uses?
 Q: I have multiple SDKs installed, can I choose which one it uses?
 A: Run cgminer with the -n option and it will list all the platforms currently
 A: Run cgminer with the -n option and it will list all the platforms currently

+ 88 - 0
cgminer.c

@@ -323,6 +323,61 @@ static void applog_and_exit(const char *fmt, ...)
 	exit(1);
 	exit(1);
 }
 }
 
 
+static pthread_mutex_t sharelog_lock;
+FILE *sharelog_file = NULL;
+
+static void
+sharelog(const char*disposition, const struct work*work) {
+	if (!sharelog_file)
+		return;
+
+	int thr_id = work->thr_id;
+	struct cgpu_info *cgpu = thr_info[thr_id].cgpu;
+	struct pool *pool = work->pool;
+	unsigned long int t = (unsigned long int)work->share_found_time;
+	char *target = bin2hex(work->target, sizeof(work->target));
+	if (unlikely(!target)) {
+		applog(LOG_ERR, "sharelog target OOM");
+		return;
+	}
+	char *hash = bin2hex(work->hash, sizeof(work->hash));
+	if (unlikely(!hash)) {
+		free(target);
+		applog(LOG_ERR, "sharelog hash OOM");
+		return;
+	}
+	char *data = bin2hex(work->data, sizeof(work->data));
+	if (unlikely(!data)) {
+		free(target);
+		free(hash);
+		applog(LOG_ERR, "sharelog data OOM");
+		return;
+	}
+
+	// timestamp,disposition,target,pool,dev,thr,sharehash,sharedata
+	char s[1024];
+	int rv;
+	rv = snprintf(s, sizeof(s), "%lu,%s,%s,%s,%s%u,%u,%s,%s\n", t, disposition, target, pool->rpc_url, cgpu->api->name, cgpu->device_id, thr_id, hash, data);
+	free(target);
+	free(hash);
+	free(data);
+	if (rv >= sizeof(s))
+		s[sizeof(s) - 1] = '\0';
+	else
+	if (rv < 0) {
+		applog(LOG_ERR, "sharelog printf error");
+		return;
+	}
+
+	size_t ret;
+	mutex_lock(&sharelog_lock);
+	ret = fwrite(s, rv, 1, sharelog_file);
+	fflush(sharelog_file);
+	mutex_unlock(&sharelog_lock);
+	if (1 != ret)
+		applog(LOG_ERR, "sharelog fwrite error");
+}
+
 static void add_pool(void)
 static void add_pool(void)
 {
 {
 	struct pool *pool;
 	struct pool *pool;
@@ -552,6 +607,28 @@ static char *set_schedtime(const char *arg, struct schedtime *st)
 	return NULL;
 	return NULL;
 }
 }
 
 
+static char*
+set_sharelog(char *arg) {
+	char *r = "";
+	long int i = strtol(arg, &r, 10);
+
+	if ((!*r) && i >= 0 && i <= INT_MAX) {
+		sharelog_file = fdopen((int)i, "a");
+		if (!sharelog_file)
+			applog(LOG_ERR, "Failed to open fd %u for share log", (unsigned int)i);
+	} else if (!strcmp(arg, "-")) {
+		sharelog_file = stdout;
+		if (!sharelog_file)
+			applog(LOG_ERR, "Standard output missing for share log");
+	} else {
+		sharelog_file = fopen(arg, "a");
+		if (!sharelog_file)
+			applog(LOG_ERR, "Failed to open %s for share log", arg);
+	}
+
+	return NULL;
+}
+
 static char *temp_cutoff_str = NULL;
 static char *temp_cutoff_str = NULL;
 
 
 char *set_temp_cutoff(char *arg)
 char *set_temp_cutoff(char *arg)
@@ -823,6 +900,9 @@ static struct opt_table opt_config_table[] = {
 	OPT_WITH_ARG("--sched-stop",
 	OPT_WITH_ARG("--sched-stop",
 		     set_schedtime, NULL, &schedstop,
 		     set_schedtime, NULL, &schedstop,
 		     "Set a time of day in HH:MM to stop mining (will quit without a start time)"),
 		     "Set a time of day in HH:MM to stop mining (will quit without a start time)"),
+	OPT_WITH_ARG("--sharelog",
+		     set_sharelog, NULL, NULL,
+		     "Append share log to file"),
 	OPT_WITH_ARG("--shares",
 	OPT_WITH_ARG("--shares",
 		     opt_set_intval, NULL, &opt_shares,
 		     opt_set_intval, NULL, &opt_shares,
 		     "Quit after mining N shares (default: unlimited)"),
 		     "Quit after mining N shares (default: unlimited)"),
@@ -1606,6 +1686,7 @@ static bool submit_upstream_work(const struct work *work)
 				applog(LOG_NOTICE, "Accepted %s %s %d thread %d",
 				applog(LOG_NOTICE, "Accepted %s %s %d thread %d",
 				       hashshow, cgpu->api->name, cgpu->device_id, thr_id);
 				       hashshow, cgpu->api->name, cgpu->device_id, thr_id);
 		}
 		}
+		sharelog("accept", work);
 		if (opt_shares && total_accepted >= opt_shares) {
 		if (opt_shares && total_accepted >= opt_shares) {
 			applog(LOG_WARNING, "Successfully mined %d accepted shares as requested and exiting.", opt_shares);
 			applog(LOG_WARNING, "Successfully mined %d accepted shares as requested and exiting.", opt_shares);
 			kill_work();
 			kill_work();
@@ -1618,6 +1699,7 @@ static bool submit_upstream_work(const struct work *work)
 		applog(LOG_DEBUG, "PROOF OF WORK RESULT: false (booooo)");
 		applog(LOG_DEBUG, "PROOF OF WORK RESULT: false (booooo)");
 		if (!QUIET) {
 		if (!QUIET) {
 			char where[17];
 			char where[17];
+			char disposition[36] = "reject";
 			char reason[32];
 			char reason[32];
 
 
 			if (total_pools > 1)
 			if (total_pools > 1)
@@ -1635,11 +1717,14 @@ static bool submit_upstream_work(const struct work *work)
 				reason[0] = ' '; reason[1] = '(';
 				reason[0] = ' '; reason[1] = '(';
 				memcpy(2 + reason, reasontmp, reasonLen);
 				memcpy(2 + reason, reasontmp, reasonLen);
 				reason[reasonLen + 2] = ')'; reason[reasonLen + 3] = '\0';
 				reason[reasonLen + 2] = ')'; reason[reasonLen + 3] = '\0';
+				memcpy(disposition + 7, reasontmp, reasonLen);
+				disposition[6] = ':'; disposition[reasonLen + 7] = '\0';
 			} else
 			} else
 				strcpy(reason, "");
 				strcpy(reason, "");
 
 
 			applog(LOG_NOTICE, "Rejected %s %s %d thread %d%s%s",
 			applog(LOG_NOTICE, "Rejected %s %s %d thread %d%s%s",
 			       hashshow, cgpu->api->name, cgpu->device_id, thr_id, where, reason);
 			       hashshow, cgpu->api->name, cgpu->device_id, thr_id, where, reason);
+			sharelog(disposition, work);
 		}
 		}
 	}
 	}
 
 
@@ -2011,6 +2096,7 @@ static void *submit_work_thread(void *userdata)
 			applog(LOG_NOTICE, "Stale share detected, submitting as pool requested");
 			applog(LOG_NOTICE, "Stale share detected, submitting as pool requested");
 		else {
 		else {
 			applog(LOG_NOTICE, "Stale share detected, discarding");
 			applog(LOG_NOTICE, "Stale share detected, discarding");
+			sharelog("discard", work);
 			total_stale++;
 			total_stale++;
 			pool->stale_shares++;
 			pool->stale_shares++;
 			goto out;
 			goto out;
@@ -3484,6 +3570,7 @@ bool submit_work_sync(struct thr_info *thr, const struct work *work_in)
 	wc->cmd = WC_SUBMIT_WORK;
 	wc->cmd = WC_SUBMIT_WORK;
 	wc->thr = thr;
 	wc->thr = thr;
 	memcpy(wc->u.work, work_in, sizeof(*work_in));
 	memcpy(wc->u.work, work_in, sizeof(*work_in));
+	wc->u.work->share_found_time = time(NULL);
 
 
 	applog(LOG_DEBUG, "Pushing submit work to work thread");
 	applog(LOG_DEBUG, "Pushing submit work to work thread");
 
 
@@ -4515,6 +4602,7 @@ int main(int argc, char *argv[])
 	mutex_init(&curses_lock);
 	mutex_init(&curses_lock);
 #endif
 #endif
 	mutex_init(&control_lock);
 	mutex_init(&control_lock);
+	mutex_init(&sharelog_lock);
 	rwlock_init(&blk_lock);
 	rwlock_init(&blk_lock);
 	rwlock_init(&netacc_lock);
 	rwlock_init(&netacc_lock);
 
 

+ 2 - 0
miner.h

@@ -657,6 +657,8 @@ struct work {
 	unsigned int	work_block;
 	unsigned int	work_block;
 	int		id;
 	int		id;
 	UT_hash_handle hh;
 	UT_hash_handle hh;
+
+	time_t share_found_time;
 };
 };
 
 
 extern void get_datestamp(char *, struct timeval *);
 extern void get_datestamp(char *, struct timeval *);

+ 10 - 1
ocl.c

@@ -372,8 +372,17 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
 			clState->chosen_kernel = KL_PHATK;
 			clState->chosen_kernel = KL_PHATK;
 		}
 		}
 		gpus[gpu].kernel = clState->chosen_kernel;
 		gpus[gpu].kernel = clState->chosen_kernel;
-	} else
+	} else {
 		clState->chosen_kernel = gpus[gpu].kernel;
 		clState->chosen_kernel = gpus[gpu].kernel;
+		if (clState->chosen_kernel == KL_PHATK &&
+		    (strstr(vbuff, "844.4") || strstr(vbuff, "851.4") ||
+		     strstr(vbuff, "831.4") || strstr(vbuff, "898.1"))) {
+			applog(LOG_WARNING, "WARNING: You have selected the phatk kernel.");
+			applog(LOG_WARNING, "You are running SDK 2.6 which performs poorly with this kernel.");
+			applog(LOG_WARNING, "Downgrade your SDK and delete any .bin files before starting again.");
+			applog(LOG_WARNING, "Or allow cgminer to automatically choose a more suitable kernel.");
+		}
+	}
 
 
 	/* For some reason 2 vectors is still better even if the card says
 	/* For some reason 2 vectors is still better even if the card says
 	 * otherwise, and many cards lie about their max so use 256 as max
 	 * otherwise, and many cards lie about their max so use 256 as max