|
|
@ -484,20 +484,28 @@ _clState *initCl(unsigned int gpu, char *name, size_t nameSize) |
|
|
|
} else |
|
|
|
} else |
|
|
|
cgpu->lookup_gap = cgpu->opt_lg; |
|
|
|
cgpu->lookup_gap = cgpu->opt_lg; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: check if this params can be the same for both scrypt and nscrypt
|
|
|
|
|
|
|
|
unsigned int sixtyfours = use_nscrypt ? ((cgpu->max_alloc*cgpu->lookup_gap) / (2048*128) / 64 - 1) : (cgpu->max_alloc / 131072 / 64 - 1); |
|
|
|
if (!cgpu->opt_tc) { |
|
|
|
if (!cgpu->opt_tc) { |
|
|
|
unsigned int sixtyfours; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sixtyfours = cgpu->max_alloc / 131072 / 64 - 1; |
|
|
|
|
|
|
|
cgpu->thread_concurrency = sixtyfours * 64; |
|
|
|
cgpu->thread_concurrency = sixtyfours * 64; |
|
|
|
if (cgpu->shaders && cgpu->thread_concurrency > cgpu->shaders) { |
|
|
|
if (cgpu->shaders && cgpu->thread_concurrency > cgpu->shaders) { |
|
|
|
cgpu->thread_concurrency -= cgpu->thread_concurrency % cgpu->shaders; |
|
|
|
cgpu->thread_concurrency -= cgpu->thread_concurrency % cgpu->shaders; |
|
|
|
if (cgpu->thread_concurrency > cgpu->shaders * 5) |
|
|
|
size_t tc_limit = cgpu->shaders * use_nscrypt ? 11 : 5; |
|
|
|
cgpu->thread_concurrency = cgpu->shaders * 5; |
|
|
|
if (cgpu->thread_concurrency > tc_limit) |
|
|
|
|
|
|
|
cgpu->thread_concurrency = tc_limit; |
|
|
|
} |
|
|
|
} |
|
|
|
applog(LOG_DEBUG, "GPU %d: selecting thread concurrency of %d", gpu, (int)(cgpu->thread_concurrency)); |
|
|
|
applog(LOG_DEBUG, "GPU %d: selecting thread concurrency of %d", gpu, (int)(cgpu->thread_concurrency)); |
|
|
|
} else |
|
|
|
} else { |
|
|
|
cgpu->thread_concurrency = cgpu->opt_tc; |
|
|
|
cgpu->thread_concurrency = cgpu->opt_tc; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// TODO: check if this works with standard scrypt, too
|
|
|
|
|
|
|
|
if (use_nscrypt) { |
|
|
|
|
|
|
|
if (((cgpu->thread_concurrency * (2048*128)) / cgpu->lookup_gap) > cgpu->max_alloc) { |
|
|
|
|
|
|
|
cgpu->thread_concurrency = sixtyfours * 64; |
|
|
|
|
|
|
|
applog(LOG_INFO, "GPU %d: thread concurrency too high, set to %d", gpu, (int)(cgpu->thread_concurrency)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
FILE *binaryfile; |
|
|
|
FILE *binaryfile; |
|
|
|
size_t *binary_sizes; |
|
|
|
size_t *binary_sizes; |
|
|
|