Con Kolivas
43752ee58c
Limit thread concurrency for scrypt to 5xshaders if shaders is specified.
2012-07-26 16:12:45 +10:00
Con Kolivas
da1b996a39
Simplify repeated use of gpus[gpu]. in ocl.c
2012-07-26 16:10:21 +10:00
Con Kolivas
ea10b08dce
Find the nearest power of 2 maximum alloc size for the scrypt buffer that can successfully be allocated and is large enough to accomodate the thread concurrency chosen, thus mapping it to an intensity.
2012-07-25 22:02:14 +10:00
Con Kolivas
9a6c082ad1
Make the thread concurrency and lookup gap options hidden on the command line and autotune parameters with a newly parsed --shaders option.
2012-07-24 20:27:37 +10:00
Con Kolivas
3a0d60cfe1
Always create the largest possible padbuffer for scrypt kernels even if not needed for thread_concurrency, giving us some headroom for intensity levels.
2012-07-23 21:30:30 +10:00
Con Kolivas
d8f81c18ee
Use the detected maximum allocable memory on a GPU to determine the optimal scrypt settings when lookup_gap and thread_concurrency parameters are not given.
2012-07-23 17:51:57 +10:00
Con Kolivas
89eb1fa393
Check the maximum allocable memory size per opencl device.
2012-07-23 17:41:31 +10:00
Con Kolivas
5087ff9069
Add debugging output if buffer allocation fails for scrypt and round up bufsize to a multiple of 256.
2012-07-23 16:37:13 +10:00
Con Kolivas
1711b4eb77
Display size of scrypt buffer used in debug.
2012-07-22 00:58:09 +10:00
Con Kolivas
39f7d2fa74
Allow lookup gap and thread concurrency to be passed per device and store details in kernel binary filename.
2012-07-21 17:31:06 +10:00
Con Kolivas
7d53fba1ad
Reinstate GPU only opencl device detection.
2012-07-21 02:49:50 +10:00
Con Kolivas
d13a3f1d50
Decrease lookup gap to 1. Does not seem to help in any way being 2.
2012-07-21 02:47:27 +10:00
Con Kolivas
d72add9af3
Send correct values to scrypt kernel to get it finally working.
2012-07-20 16:16:18 +10:00
Con Kolivas
3e61db105d
Create command queue before compiling program in opencl.
2012-07-18 21:58:27 +10:00
Con Kolivas
471daecb5f
Initialise mdplatform.
2012-07-16 20:15:27 +10:00
Con Kolivas
428d5e5d4d
Limit scrypt to 1 vector.
2012-07-16 13:22:35 +10:00
Con Kolivas
a9a0bba18b
Set the correct data for cldata and prepare for pad8 fixes.
2012-07-16 11:53:18 +10:00
Con Kolivas
04edf4bfa2
Temporarily set opencl to use all devices to allow debugging of scrypt kernel rapidly.
2012-07-15 13:40:56 +10:00
Con Kolivas
53e9c61c02
Find the gpu platform with the most devices and use that if no platform option is passed.
2012-07-15 13:40:11 +10:00
Con Kolivas
884f83f313
Allow more platforms to be probed if first does not return GPUs.
2012-07-15 13:31:03 +10:00
Con Kolivas
243d005b1b
Set scrypt settings and buffer size in ocl.c code to be future modifiable.
2012-07-14 16:21:27 +10:00
Con Kolivas
aabc723326
Make sure goffset is set for scrypt and drop padbuffer8 to something manageable for now.
2012-07-14 00:30:25 +10:00
Con Kolivas
e0296c411b
Set up buffer8 for scrypt.
2012-07-13 21:35:25 +10:00
Con Kolivas
0f43eb5eb7
Don't test nonce with sha and various fixes for scrypt.
2012-07-13 20:35:44 +10:00
Con Kolivas
b085c338f6
Make scrypt buffers and midstate compatible with cgminer.
2012-07-13 20:28:36 +10:00
Con Kolivas
dd740caa98
Provide initial support for the scrypt kernel to compile with and mine scrypt with the --scrypt option.
2012-07-13 19:02:43 +10:00
Philip Kaufmann
f479be0700
add goffset support for diakgcn with -v 1 and update kernel version
2012-04-27 09:58:30 +02:00
Con Kolivas
9a3ae2660e
Add support for latest ATI SDK on windows.
2012-04-27 10:22:53 +10:00
Con Kolivas
bb31988347
Detect poorly performing combination of SDK and phatk kernel and add verbose warning at startup.
2012-04-25 11:41:35 +10:00
Con Kolivas
9175e4f25c
Display all OpenCL devices when -n is called as well to allow debugging of differential mapping of OpenCL to ADL.
2012-04-23 17:56:31 +10:00
Con Kolivas
6274fbe727
Change the preferred vector width to 1 for Tahiti only, not all poclbm kernels.
2012-03-30 09:32:42 +11:00
Con Kolivas
621bcca7f5
Use global offset parameter to diablo and poclbm kernel ONLY for 1 vector kernels.
2012-03-27 22:58:46 +11:00
Con Kolivas
39395eb1e0
Use poclbm preferentially on Tahiti now regardless of SDK.
2012-03-27 22:58:46 +11:00
Con Kolivas
edb070c833
Fixes.
2012-02-24 14:14:05 +11:00
Con Kolivas
fb077c6d59
Pass vectors * worksize to kernel to avoid one op.
2012-02-24 14:14:04 +11:00
Con Kolivas
709c4cd8e1
Use diablo kernel on all future SDKs for Tahiti and set preferred vector width to 1 on poclbm kernel only.
2012-02-23 20:24:32 +11:00
ckolivas
dfcb98debf
Use the SDK and hardware information to choose good performing default kernels.
2012-02-23 00:45:40 +11:00
ckolivas
d3ad87f5d2
Allow writing of multiple worksizes to the configuration file.
2012-02-22 20:13:23 +11:00
ckolivas
1b1fa5cd89
Allow writing of multiple vector sizes to the configuration file.
2012-02-22 20:08:29 +11:00
ckolivas
994cd77501
Allow writing of multiple kernels to the configuration file.
2012-02-22 20:01:09 +11:00
ckolivas
93efb726bb
Allow multiple different kernels to be chosen per device.
2012-02-22 19:38:01 +11:00
ckolivas
a54f76061b
Fix multiple work size entry.
2012-02-22 19:00:44 +11:00
Con Kolivas
26c59fbf0f
Allow the worksize to be set per-device.
2012-02-22 16:59:28 +11:00
Con Kolivas
deff55c640
Allow different vectors to be set per device.
2012-02-22 16:54:06 +11:00
Con Kolivas
bf3a9f94f1
Unintentionally dropped the device name from the binary filenames. Reinstate.
2012-02-22 14:42:20 +11:00
Con Kolivas
5d23d70f68
As all kernels will be new versions it's an opportunity to change the .bin format and make it simpler. Specifying bitalign is redundant and long can be
...
l.
2012-02-22 14:14:26 +11:00
Con Kolivas
d1cddf8bad
Update licensing to GPL V3.
2012-02-21 22:23:07 +11:00
Con Kolivas
00290a3e02
Select diablo kernel on all but GCN+SDK 2.6.
2012-02-21 21:48:10 +11:00
Con Kolivas
e9c3d7309a
Tahiti prefers worksize 64 with poclbm.
2012-02-19 18:32:56 +11:00
Con Kolivas
30936f17e3
No need to expressly retain the opencl program now that the zero binary issue is fixed.
2012-02-18 23:28:41 +11:00
Con Kolivas
810ad04578
More copyright updates.
2012-02-18 23:16:08 +11:00
Con Kolivas
22d3034e10
Show error code on any opencl failure status.
2012-02-18 23:13:45 +11:00
Con Kolivas
be9db9ce63
Copyright updates.
2012-02-18 23:00:21 +11:00
Con Kolivas
0b6e35cda9
Add detection for version 898.1 SDK as well but only give SDK 2.6 warning once on startup instead of with each device initialisation.
2012-02-18 22:49:49 +11:00
Con Kolivas
67c4ada1b7
Provide warning on each startup about sdk 2.6 and decrease poclbm kernel selection to LOG_INFO.
2012-02-16 01:10:11 +11:00
Con Kolivas
b4c86ba615
Give SDK 2.6 warning only on building a kernel for !GCN bitalign devices.
2012-02-16 00:48:34 +11:00
Con Kolivas
728e3d4398
Revert "Automatically choose phatk kernel for bitalign non-gcn ATI cards, and then only select poclbm if SDK2.6 is detected."
...
This reverts commit e7fdadfc8f
.
Broke kernel loading.
2012-02-16 00:45:08 +11:00
ckolivas
e7fdadfc8f
Automatically choose phatk kernel for bitalign non-gcn ATI cards, and then only select poclbm if SDK2.6 is detected.
2012-02-15 14:52:29 +11:00
ckolivas
6a78594618
Make SDK 2.6 warning and advice big and bold.
2012-02-15 14:47:02 +11:00
Con Kolivas
23c01bc79c
Make output buffer write only as per Diapolo's suggestion.
2012-02-13 13:19:04 +11:00
Con Kolivas
b2b5083bda
Microoptimise phatk kernel on return code.
2012-02-13 12:22:35 +11:00
Con Kolivas
fd05341a87
Do not loop indefinitely setting poclbm kernel to load a binary.
2012-02-13 10:39:26 +11:00
Con Kolivas
d689cfbdf6
Try to load a binary if we've defaulted to the poclbm kernel on SDK2.6
2012-02-13 10:06:26 +11:00
Con Kolivas
3057b701e7
Use the poclbm kernel on SDK2.6 with bitalign devices only if there is no binary available.
2012-02-13 09:59:29 +11:00
Con Kolivas
2c33f12255
Whitelist ATI SDK 2.6 to use the poclbm kernel by default.
2012-02-13 08:34:44 +11:00
Con Kolivas
fb99c8d52a
The longstanding generation of a zero sized binary appears to be due to the OpenCL library putting the binary in a RANDOM SLOT amongst 4 possible binary
...
locations. Iterate over each of them after building from source till the real binary is found and use that.
2012-02-12 21:38:45 +11:00
Con Kolivas
56907db2d6
Fix harmless warnings with -Wsign-compare to allow cgminer to build with -W.
2012-02-12 18:21:30 +11:00
Con Kolivas
405a2120f8
Remove unnecessary check for opt_debug on every invocation of applog at LOG_DEBUG and place the check in applog().
2012-02-11 20:11:18 +11:00
Con Kolivas
60c701457a
Retain cl program after successfully loading a binary image.
2012-02-11 16:41:41 +11:00
Con Kolivas
55bd031db3
Variable unused after this so remove setting it.
2012-02-11 16:38:55 +11:00
Con Kolivas
1c1b8bec9a
BFI INT patching is not necessarily true on binary loading of files and not true on ATI SDK2.6+. Report bitalign instead.
2012-02-11 15:58:07 +11:00
ckolivas
f2d5db0c77
Use only working kernels by default.
2012-02-11 11:48:58 +11:00
ckolivas
59d3d0112b
Implement diablo kernel support and try to make it work.
2012-02-11 11:48:12 +11:00
ckolivas
95a989da4d
Conflicting entries of cl_kernel may have been causing problems, and automatically chosen kernel type was not being passed on. Rename the enum to cl_kernels and store the chosen kernel in each clState.
2012-02-11 11:48:12 +11:00
ckolivas
e6cf96adfa
ALlow much longer filenames for kernels to load properly.
2012-02-11 11:48:12 +11:00
ckolivas
4822cca72b
Allow different kernels to be used by different devices and fix the logic fail of overcorrecting on last commit with !strstr.
2012-02-11 11:48:11 +11:00
Con Kolivas
196e8a0f76
Fix kernel selection process and build error.
2012-02-11 11:48:11 +11:00
Philip Kaufmann
47a09ceab8
added OpenCL >= 1.1 detection code, in preparation of OpenCL 1.1 global offset parameter support
2012-02-11 11:48:11 +11:00
ckolivas
cb7145b179
Add basic build ability with diakgcn and put all kernel names in configure.ac to avoid changing them in mutliple places.
2012-02-11 11:48:11 +11:00
ckolivas
53c1e9ae37
Allow the OpenCL platform ID to be chosen with --gpu-platform.
2012-02-04 15:15:57 +11:00
ckolivas
a4f47812ff
Iterate over all platforms displaying their information and number of devices when --ndevs is called.
2012-02-04 14:47:23 +11:00
Con Kolivas
ebaa2be1df
Update poclbm kernel for better performance on GCN and new SDKs with bitalign support when not BFI INT patching.
...
Update phatk kernel to work properly for non BFI INT patched kernels, providing support for phatk to run on GCN and non-ATI cards.
2012-02-03 18:19:39 +11:00
Con Kolivas
82af288e69
Revert "Fix various harmless warnings."
...
This reverts commit a4b67f030f
.
2012-01-29 22:57:29 +11:00
Con Kolivas
a4b67f030f
Fix various harmless warnings.
2012-01-29 21:06:17 +11:00
Con Kolivas
b8f845b478
Display information about the opencl platform with verbose enabled.
2012-01-29 16:43:38 +11:00
ckolivas
5d5584f80c
Explicitly check for nvidia in opencl platform strings as well.
2012-01-29 16:31:03 +11:00
Con Kolivas
a3d90f84e2
Default to poclbm kernel on Tahiti (7970) since phatk does not work, even though performance is sub-standard so that at least it will mine successfully
...
by default.
2012-01-29 11:01:17 +11:00
Con Kolivas
31f6e8c782
Unset prog_built after it is patched because it needs rebuilding.
2012-01-28 17:06:28 +11:00
Con Kolivas
1e5035497b
Retain cl program after every possible place we might build the program.
2012-01-28 16:29:19 +11:00
Con Kolivas
25caca9086
Revert "Don't explicitly retain the cl program as it is of no benefit to do so and may lead to problems when trying to release the program."
...
This reverts commit 32910463a3
.
Turns out this does help.
2012-01-28 16:26:53 +11:00
Con Kolivas
32910463a3
Don't explicitly retain the cl program as it is of no benefit to do so and may lead to problems when trying to release the program.
2012-01-26 20:53:35 +11:00
Con Kolivas
d18d55649f
Do not attempt to build the program that becomes the kernel twice. This could have been leading to failures on initialising cl.
2012-01-26 20:39:35 +11:00
Con Kolivas
c87460b34e
Typo.
2012-01-26 19:42:57 +11:00
Con Kolivas
2ecabd8535
Some opencl compilers have issues with no spaces after -D in the compiler options.
2012-01-26 19:38:15 +11:00
Con Kolivas
77e9b1c2e8
Use calloced stack memory for CompilerOptions to ensure sprintf writes to the beginning of the char.
2012-01-26 13:06:39 +11:00
Con Kolivas
d7aac25489
Whitelist 79x0 cards to prefer no vectors as they perform better without.
2012-01-26 11:44:42 +11:00
Con Kolivas
3d4cfce8df
Instead of using the BFI_INT patching hack on any device reporting cl_amd_media_ops, create a whitelist of devices that need it.
...
This should enable GCN architectures (ATI 79xx cards) to work properly.
2012-01-24 20:23:44 +11:00
Con Kolivas
6442c1aba0
Style police.
2012-01-22 20:36:57 +11:00
Con Kolivas
0719d40704
Clean up on failure to load a binary kernel.
2012-01-22 17:09:06 +11:00
Con Kolivas
fb0c580b62
Go to kernel build should we fail to clCreateProgramWithBinary instead of failing on that device.
...
Should fix the windows problems with devices not initialising.
2011-10-15 13:29:44 +11:00
Con Kolivas
2053de6d59
Add the directory name from the arguments cgminer was called from as well to allow it running from a relative pathname.
2011-09-06 10:11:34 +10:00
Con Kolivas
5848c11004
Confusion over the variable name for number of devices was passing a bogus value which likely was causing the zero sized binary issue.
2011-08-29 00:16:58 +10:00
Con Kolivas
3567b69e5e
Remove fragile source patching for bitalign, vectors et. al and simply pass it with the compiler options.
2011-08-26 10:20:02 +10:00
Con Kolivas
3d5f555407
Allow a custom kernel path to be entered on the command line.
2011-08-25 14:42:03 +10:00
Con Kolivas
413d97096d
Make cgminer look in the install directory for the .cl files making make install work correctly.
2011-08-25 13:59:46 +10:00
Con Kolivas
48180b697b
Fail gracefully if unable to open the opencl files.
2011-08-25 13:10:53 +10:00
Con Kolivas
6d10ef2f6e
Bump version numbers of kernels to indicate slightly different versions.
2011-08-22 10:17:23 +10:00
Con Kolivas
4beade3772
Retain the program immediately after it's created from source.
2011-08-18 22:42:37 +10:00
Con Kolivas
082e20df5f
Explicitly tell the compiler to retain the program to minimise the chance of the zero sized binary errors.
2011-08-18 22:34:03 +10:00
Con Kolivas
0f782ba6bd
Update poclbm kernel to FF sized mask and only check that range.
2011-08-17 15:47:18 +10:00
Con Kolivas
c40f51c7c1
Move to cgminer style buffer return and file naming convention and fix a compiler warning.
2011-08-17 15:06:59 +10:00
Phateus
d15d225a4c
Changed phatk version to 2.2
2011-08-17 14:53:17 +10:00
Con Kolivas
42d49ffdc7
Revert "Restart threads by abstracting out the clcontext initialisation and using that instead of probing all cards."
...
This reverts commit 8f186e61e2
.
2011-08-15 23:23:45 +10:00
Con Kolivas
cf543507c6
Revert "Preinitialise the devices only once on startup."
...
This reverts commit 071a0ad2f1
.
2011-08-15 23:23:39 +10:00
Con Kolivas
b1289a0159
Revert "Move the non cl_ variables into the cgpu info struct to allow creating a new cl state on reinit, preserving known GPU variables."
...
This reverts commit 28880d0dc7
.
2011-08-15 23:23:29 +10:00
Con Kolivas
28880d0dc7
Move the non cl_ variables into the cgpu info struct to allow creating a new cl state on reinit, preserving known GPU variables.
...
Create a new context from scratch in initCQ in case something was corrupted to maximise our chance of succesfully creating a new worker thread.
2011-08-13 20:54:20 +10:00
Con Kolivas
071a0ad2f1
Preinitialise the devices only once on startup.
2011-08-13 20:50:00 +10:00
Con Kolivas
8f186e61e2
Restart threads by abstracting out the clcontext initialisation and using that instead of probing all cards.
2011-07-30 16:59:54 +10:00
Con Kolivas
4365896ba2
Release the command queue created after we've copied the binary data.
2011-07-29 10:17:36 +10:00
Con Kolivas
283d5d2343
Create a command queue from the program created from source which allows us to flush the command queue in the hope it will not generate a zero sized binary any more.
2011-07-29 10:09:24 +10:00
Con Kolivas
2e37e3374e
Out of order command queue may fail on osx. Try without if it fails.
2011-07-24 10:58:03 +10:00
Con Kolivas
4cd12aa8e0
Fix harmless warning.
2011-07-24 09:04:56 +10:00
Con Kolivas
a9e1a25518
Make it possible to select the choice of kernel on the command line.
2011-07-23 15:15:46 +10:00
Con Kolivas
116a9dc025
Update phatk kernel to one with new parameters for slightly less overhead again.
...
Make the queue kernel parameters call a function pointer to select phatk or poclbm.
2011-07-23 14:17:25 +10:00
Con Kolivas
1c67f6068c
Sometimes the cl compiler generates zero sized binaries and only a reboot seems to fix it.
2011-07-21 10:07:29 +10:00
Con Kolivas
7b13812efb
Kernels are safely flushed in a way that allows out of order execution to work.
2011-07-21 09:58:28 +10:00
Con Kolivas
a7707a26cb
Rename the poclbm file to ensure a new binary is built since.
2011-07-18 10:42:24 +10:00
Con Kolivas
eea05c05b8
Update kernel with a shorter output path, and use 4k output buffer to match OS page sizes.
2011-07-15 13:04:25 +10:00
Con Kolivas
857902a13d
Commit a new phatk kernel renamed to force new binary building and add proper support in makefiles.
2011-07-12 22:23:03 +10:00
Con Kolivas
0c910673b2
Set max preferred size to 256 to prevent lying cards from crashing when no worksize is set.
2011-07-10 00:30:12 +10:00
Con Kolivas
826cc4800e
Opcode should be ULL.
2011-07-08 11:58:04 +10:00
Rusty Russell
efebee5ab8
Fix the case where there are no GPUs, and exit if they give errors.
...
If there are no GPUs, set nDevs to 0 not -1 (status is set to an
unhelpful -1001 here on my laptop, so we can't rely on a particular
status value).
Also, if nDevs is -1, exit rather than screwing up later.
2011-07-06 16:47:29 +09:30
Ycros
a636a6744f
Merge branch 'cgminer' of git://github.com/ckolivas/cgminer into cgminer
2011-07-05 21:31:41 +10:00
Ycros
52d6e7ca37
Fixed fread issues under Windows.
2011-07-05 21:31:24 +10:00
Con Kolivas
a93b22c630
Make it possible to build without GPU mining by picking up HAVE_OPENCL from config.h.
2011-07-05 17:34:54 +10:00
Con Kolivas
821da37c84
Add hardware name to binary kernel name allowing for unique kernels for different cards on the same machine.
2011-07-04 19:56:27 +10:00
Con Kolivas
13b43cfad1
Update copyright and authors.
2011-07-04 19:56:27 +10:00
Con Kolivas
594b38b8cb
Fix redefinition of gnu source.
2011-07-04 19:56:27 +10:00
Ycros
ec8319176e
Build on windows using mingw32.
2011-07-04 19:56:27 +10:00
Ycros
5d301c8ba0
Make a binary load failure build from source.
2011-07-04 19:56:27 +10:00
Con Kolivas
3aa5be4fcf
Reinstate binary kernel loading with fixes.
...
Build binaries with unique filenames from the kernel generated and save them.
Try to load this cached binary if it matches on next kernel instantiation.
This speeds up start-up dramatically, and has a unique kernel binary for different kernel configurations.
2011-07-04 19:47:46 +10:00
Con Kolivas
60f0bb19de
Temporarily back out binary building till it's working more reliably.
2011-07-04 19:47:46 +10:00
Con Kolivas
a095f0fae2
Broke source generated program. Fix.
2011-07-04 19:47:46 +10:00
Con Kolivas
4d73057772
Build binaries with unique filenames from the kernel generated and save them.
...
Try to load this cached binary if it matches on next kernel instantiation.
This speeds up start-up dramatically, and has a unique kernel binary for different kernel configurations.
2011-07-04 19:47:46 +10:00
Con Kolivas
973b2199e1
Tidy.
2011-07-04 19:47:46 +10:00
Con Kolivas
2b6e841673
Use a buffer of up to 512 * 4 integers when retrieving work from the GPU.
...
This allows each local thread id to have one slot to put any positive results into, thus making overlapping results far less likely.
Thus races will be much rarer, allowing more threads.
It should also pick up blocks close to each other more reliably and hopefully decrease the number of rejects and opencl errors.
Do the search over the buffer entirely in a separate thread to allow the GPU to stay as busy as possible.
Detach threads from themselves to prevent unlucky even where dereferencing occurs by freeing the data that stores the thread info.
2011-07-04 19:47:46 +10:00
ckolivas
1dfbe60353
Put sanity limit on work size since some nvidia fail :(
2011-07-04 19:47:45 +10:00
Con Kolivas
6374e0fafe
Import the phatk kernel. Enable it only for hardware with amd media ops for now since it crashes nvidia et. al.
...
Fallback to the poclbm kernel for the rest. Try harder to avoid stale blocks around longpoll detecting new blocks.
2011-07-04 19:47:45 +10:00
Con Kolivas
2dbb39444d
Base was being set wrongly meaning we were repeating searches and the rate was actually lower than displayed :(
...
Tweak Ma with new changes.
Change default vectors to 2 since it's faster than 4 even when 4 is reported as preferred.
2011-07-04 19:47:45 +10:00
Con Kolivas
c566605195
Tab dainbramage.
2011-07-04 19:47:45 +10:00