Browse Source

opencl: Ability to avoid using binary kernels with new --no-opencl-binaries option

Luke Dashjr 12 years ago
parent
commit
d53643e75b
4 changed files with 7 additions and 1 deletions
  1. 1 0
      README
  2. 1 0
      driver-opencl.h
  3. 3 0
      miner.c
  4. 2 1
      ocl.c

+ 1 - 0
README

@@ -163,6 +163,7 @@ Options for both config file and command line:
 --no-restart        Do not attempt to restart devices that hang
 --no-restart        Do not attempt to restart devices that hang
 --no-stratum        Disable Stratum detection
 --no-stratum        Disable Stratum detection
 --no-submit-stale   Don't submit shares if they are detected as stale
 --no-submit-stale   Don't submit shares if they are detected as stale
+--no-opencl-binaries Don't attempt to use or save OpenCL kernel binaries
 --pass|-p <arg>     Password for bitcoin JSON-RPC server
 --pass|-p <arg>     Password for bitcoin JSON-RPC server
 --per-device-stats  Force verbose mode and output per-device statistics
 --per-device-stats  Force verbose mode and output per-device statistics
 --pool-proxy|-x     Proxy URI to use for connecting to just the previous-defined pool
 --pool-proxy|-x     Proxy URI to use for connecting to just the previous-defined pool

+ 1 - 0
driver-opencl.h

@@ -30,6 +30,7 @@ extern void pause_dynamic_threads(int gpu);
 
 
 extern bool have_opencl;
 extern bool have_opencl;
 extern int opt_platform_id;
 extern int opt_platform_id;
+extern bool opt_opencl_binaries;
 
 
 extern struct device_api opencl_api;
 extern struct device_api opencl_api;
 
 

+ 3 - 0
miner.c

@@ -1332,6 +1332,9 @@ static struct opt_table opt_config_table[] = {
 	OPT_WITHOUT_ARG("--no-submit-stale",
 	OPT_WITHOUT_ARG("--no-submit-stale",
 			opt_set_invbool, &opt_submit_stale,
 			opt_set_invbool, &opt_submit_stale,
 		        "Don't submit shares if they are detected as stale"),
 		        "Don't submit shares if they are detected as stale"),
+	OPT_WITHOUT_ARG("--no-opencl-binaries",
+	                opt_set_invbool, &opt_opencl_binaries,
+	                "Don't attempt to use or save OpenCL kernel binaries"),
 	OPT_WITH_ARG("--pass|-p",
 	OPT_WITH_ARG("--pass|-p",
 		     set_pass, NULL, NULL,
 		     set_pass, NULL, NULL,
 		     "Password for bitcoin JSON-RPC server"),
 		     "Password for bitcoin JSON-RPC server"),

+ 2 - 1
ocl.c

@@ -212,6 +212,7 @@ CL_API_ENTRY cl_int CL_API_CALL
                        cl_event *       /* event */) CL_API_SUFFIX__VERSION_1_0;
                        cl_event *       /* event */) CL_API_SUFFIX__VERSION_1_0;
 
 
 int opt_platform_id = -1;
 int opt_platform_id = -1;
+bool opt_opencl_binaries = true;
 
 
 char *file_contents(const char *filename, int *length)
 char *file_contents(const char *filename, int *length)
 {
 {
@@ -395,7 +396,7 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize)
 {
 {
 	_clState *clState = calloc(1, sizeof(_clState));
 	_clState *clState = calloc(1, sizeof(_clState));
 	bool patchbfi = false, prog_built = false;
 	bool patchbfi = false, prog_built = false;
-	bool usebinary = true, ismesa = false;
+	bool usebinary = opt_opencl_binaries, ismesa = false;
 	struct cgpu_info *cgpu = &gpus[gpu];
 	struct cgpu_info *cgpu = &gpus[gpu];
 	cl_platform_id platform = NULL;
 	cl_platform_id platform = NULL;
 	char pbuff[256], vbuff[255];
 	char pbuff[256], vbuff[255];