You've got the general concepts correct - let me fill in the details for you.
Thread-Concurrency : for scrypt, this ONLY affects the size of the OpenCL buffer on the GPU. It creates a buffer in size = TC*128/(1024/Lookup-Gap) (roughly, for LG=1, 2, 4 & 8 - there's other considerations for the other LG's). TC of 8192 and Lookup Gap of 2 = 512 MB buffer - this is the most common setting I see people using for regular scrypt coins.
Lookup-Gap : as this setting goes up, this increases the effective size of the memory available to openCL hashing threads at the cost of some GPU cycles. A LG of 2 doubles the buffer size, a LG of 4 quadruples it. In-between settings give in-between values, etc. The same setting of TC=8192 and LG=2 gives an effective memory size of 1024MB
Hash Size - based on N. Vertcoin is currently at N=11 and requires 256KB of memory per hash.
Hash Size is variable according to difficulty? Thread-Concurrency : for scrypt, this ONLY affects the size of the OpenCL buffer on the GPU. It creates a buffer in size = TC*128/(1024/Lookup-Gap) (roughly, for LG=1, 2, 4 & 8 - there's other considerations for the other LG's). TC of 8192 and Lookup Gap of 2 = 512 MB buffer - this is the most common setting I see people using for regular scrypt coins.
Lookup-Gap : as this setting goes up, this increases the effective size of the memory available to openCL hashing threads at the cost of some GPU cycles. A LG of 2 doubles the buffer size, a LG of 4 quadruples it. In-between settings give in-between values, etc. The same setting of TC=8192 and LG=2 gives an effective memory size of 1024MB
Hash Size - based on N. Vertcoin is currently at N=11 and requires 256KB of memory per hash.
Quote
AMD GPU shaders (this one is based on observation) : AMD cards running mining software can get 4 * the number of shaders executing simultaneously. Each one needs its own memory allocation.
Combine all of this.
Take the number of shaders on your card, multiply by 4. Then multiply by 256 KB. This is how large your effective memory needs to be. With the TC 8192 and LG 2, the effective memory of 1024 MB means that if your card has 1024 shaders, you're fine as this is the exact amount needed! If you have any more shaders (say even an R9 270 with 1280 shaders), you need to allocate a higher buffer size or you will get HW errors. With 1280 Shaders, you need effective memory of 1280 MB which can be accomplished by a TC of 10240/LG 2.
Taking this to the extreme - the 290X has 2816 shaders, to keep the LG at 2, you need a TC of 22528 (1,408 MB, effective size of 2816). At this level, you may have difficulty allocating the whole buffer size in one thread if your system ram is only 2GB - The buffer gets allocated in system ram before being passed to the OpenCL kernel for execution.
I am looking at my memory usage, actually it does not used up to maximum allocation as calculated fluctuating btw 700~1000mb. 5850 has 1440 shaders (1440MB). this value might be the theoretical max required.Combine all of this.
Take the number of shaders on your card, multiply by 4. Then multiply by 256 KB. This is how large your effective memory needs to be. With the TC 8192 and LG 2, the effective memory of 1024 MB means that if your card has 1024 shaders, you're fine as this is the exact amount needed! If you have any more shaders (say even an R9 270 with 1280 shaders), you need to allocate a higher buffer size or you will get HW errors. With 1280 Shaders, you need effective memory of 1280 MB which can be accomplished by a TC of 10240/LG 2.
Taking this to the extreme - the 290X has 2816 shaders, to keep the LG at 2, you need a TC of 22528 (1,408 MB, effective size of 2816). At this level, you may have difficulty allocating the whole buffer size in one thread if your system ram is only 2GB - The buffer gets allocated in system ram before being passed to the OpenCL kernel for execution.
probably can lower the tc or limit number of shader to enable the card to run with lower system memory but still may not achieve stability with hw error which is another problem all together. strangely I seen ppl report with same card but cannot use same setting on both card to achieve stability.
Quote
If you think you've got the hang of it, try tuning your card to mine YACoin, where each hash requires 4MB of memory
will try once I have a better rig, currently running on old rig which is still running on ddr2, originally had 4GB ram but one stick failed recently crippling it to 2gb onlyGreat info, thanks!