@ -564,6 +564,7 @@ char *set_intensity(char *arg)
@@ -564,6 +564,7 @@ char *set_intensity(char *arg)
tt = & gpus [ device ] . intensity ;
* tt = val ;
gpus [ device ] . xintensity = 0 ; // Disable shader based intensity
gpus [ device ] . rawintensity = 0 ; // Disable raw intensity
}
device + + ;
@ -580,6 +581,7 @@ char *set_intensity(char *arg)
@@ -580,6 +581,7 @@ char *set_intensity(char *arg)
tt = & gpus [ device ] . intensity ;
* tt = val ;
gpus [ device ] . xintensity = 0 ; // Disable shader based intensity
gpus [ device ] . rawintensity = 0 ; // Disable raw intensity
}
device + + ;
}
@ -588,6 +590,7 @@ char *set_intensity(char *arg)
@@ -588,6 +590,7 @@ char *set_intensity(char *arg)
gpus [ i ] . dynamic = gpus [ 0 ] . dynamic ;
gpus [ i ] . intensity = gpus [ 0 ] . intensity ;
gpus [ i ] . xintensity = 0 ; // Disable shader based intensity
gpus [ i ] . rawintensity = 0 ; // Disable raw intensity
}
}
@ -604,10 +607,11 @@ char *set_xintensity(char *arg)
@@ -604,10 +607,11 @@ char *set_xintensity(char *arg)
return " Invalid parameters for shader based intensity " ;
val = atoi ( nextptr ) ;
if ( val < MIN_XINTENSITY | | val > MAX_XINTENSITY )
return " Invalid value passed to set shader intensity " ;
return " Invalid value passed to set shader-based intensity " ;
gpus [ device ] . dynamic = false ; // Disable dynamic intensity
gpus [ device ] . intensity = 0 ; // Disable regular intensity
gpus [ device ] . rawintensity = 0 ; // Disable raw intensity
gpus [ device ] . xintensity = val ;
device + + ;
@ -617,13 +621,54 @@ char *set_xintensity(char *arg)
@@ -617,13 +621,54 @@ char *set_xintensity(char *arg)
return " Invalid value passed to set shader based intensity " ;
gpus [ device ] . dynamic = false ; // Disable dynamic intensity
gpus [ device ] . intensity = 0 ; // Disable regular intensity
gpus [ device ] . rawintensity = 0 ; // Disable raw intensity
gpus [ device ] . xintensity = val ;
device + + ;
}
if ( device = = 1 )
for ( i = device ; i < MAX_GPUDEVICES ; i + + ) {
gpus [ i ] . dynamic = gpus [ 0 ] . dynamic ; // Disable dynamic intensity
gpus [ i ] . intensity = gpus [ 0 ] . intensity ; // Disable regular intensity
gpus [ i ] . dynamic = gpus [ 0 ] . dynamic ;
gpus [ i ] . intensity = gpus [ 0 ] . intensity ;
gpus [ i ] . rawintensity = gpus [ 0 ] . rawintensity ;
gpus [ i ] . xintensity = gpus [ 0 ] . xintensity ;
}
return NULL ;
}
char * set_rawintensity ( char * arg )
{
int i , device = 0 , val = 0 ;
char * nextptr ;
nextptr = strtok ( arg , " , " ) ;
if ( nextptr = = NULL )
return " Invalid parameters for raw intensity " ;
val = atoi ( nextptr ) ;
if ( val < MIN_RAWINTENSITY | | val > MAX_RAWINTENSITY )
return " Invalid value passed to set raw intensity " ;
gpus [ device ] . dynamic = false ; // Disable dynamic intensity
gpus [ device ] . intensity = 0 ; // Disable regular intensity
gpus [ device ] . xintensity = 0 ; // Disable xintensity
gpus [ device ] . rawintensity = val ;
device + + ;
while ( ( nextptr = strtok ( NULL , " , " ) ) ! = NULL ) {
val = atoi ( nextptr ) ;
if ( val < MIN_RAWINTENSITY | | val > MAX_RAWINTENSITY )
return " Invalid value passed to set raw intensity " ;
gpus [ device ] . dynamic = false ; // Disable dynamic intensity
gpus [ device ] . intensity = 0 ; // Disable regular intensity
gpus [ device ] . xintensity = 0 ; // Disable xintensity
gpus [ device ] . rawintensity = val ;
device + + ;
}
if ( device = = 1 )
for ( i = device ; i < MAX_GPUDEVICES ; i + + ) {
gpus [ i ] . dynamic = gpus [ 0 ] . dynamic ;
gpus [ i ] . intensity = gpus [ 0 ] . intensity ;
gpus [ i ] . rawintensity = gpus [ 0 ] . rawintensity ;
gpus [ i ] . xintensity = gpus [ 0 ] . xintensity ;
}
@ -693,10 +738,10 @@ retry: // TODO: refactor
@@ -693,10 +738,10 @@ retry: // TODO: refactor
mhash_base = false ;
}
wlog ( " GPU %d: %.1f / %.1f %sh/s | A:%d R:%d HW:%d U:%.2f/m I:%d xI:%d \n " ,
wlog ( " GPU %d: %.1f / %.1f %sh/s | A:%d R:%d HW:%d U:%.2f/m I:%d xI:%d rI:%d \n " ,
gpu , displayed_rolling , displayed_total , mhash_base ? " M " : " K " ,
cgpu - > accepted , cgpu - > rejected , cgpu - > hw_errors ,
cgpu - > utility , cgpu - > intensity , cgpu - > xintensity ) ;
cgpu - > utility , cgpu - > intensity , cgpu - > xintensity , cgpu - > rawintensity ) ;
# ifdef HAVE_ADL
if ( gpus [ gpu ] . has_adl ) {
int engineclock = 0 , memclock = 0 , activity = 0 , fanspeed = 0 , fanpercent = 0 , powertune = 0 ;
@ -764,7 +809,7 @@ retry: // TODO: refactor
@@ -764,7 +809,7 @@ retry: // TODO: refactor
wlog ( " \n " ) ;
}
wlogprint ( " [E]nable [D]isable [I]ntensity [x]Intensity [R]estart GPU %s \n " , adl_active ? " [C]hange settings " : " " ) ;
wlogprint ( " [E]nable [D]isable [I]ntensity [x]Intensity R[a]w Intensity [R]estart GPU %s \n " , adl_active ? " [C]hange settings " : " " ) ;
wlogprint ( " Or press any other key to continue \n " ) ;
logwin_update ( ) ;
@ -850,7 +895,8 @@ retry: // TODO: refactor
@@ -850,7 +895,8 @@ retry: // TODO: refactor
}
gpus [ selected ] . dynamic = false ;
gpus [ selected ] . intensity = intensity ;
gpus [ selected ] . xintensity = 0 ; // disable
gpus [ selected ] . xintensity = 0 ; // Disable xintensity when enabling intensity
gpus [ selected ] . rawintensity = 0 ; // Disable raw intensity when enabling intensity
wlogprint ( " Intensity on gpu %d set to %d \n " , selected , intensity ) ;
pause_dynamic_threads ( selected ) ;
goto retry ;
@ -877,11 +923,41 @@ retry: // TODO: refactor
@@ -877,11 +923,41 @@ retry: // TODO: refactor
goto retry ;
}
gpus [ selected ] . dynamic = false ;
gpus [ selected ] . intensity = 0 ; // disable
gpus [ selected ] . intensity = 0 ; // Disable intensity when enabling xintensity
gpus [ selected ] . rawintensity = 0 ; // Disable raw intensity when enabling xintensity
gpus [ selected ] . xintensity = xintensity ;
wlogprint ( " Experimental intensity on gpu %d set to %d \n " , selected , xintensity ) ;
pause_dynamic_threads ( selected ) ;
goto retry ;
} else if ( ! strncasecmp ( & input , " a " , 1 ) ) {
int rawintensity ;
char * intvar ;
if ( selected )
selected = curses_int ( " Select GPU to change raw intensity on " ) ;
if ( selected < 0 | | selected > = nDevs ) {
wlogprint ( " Invalid selection \n " ) ;
goto retry ;
}
intvar = curses_input ( " Set raw GPU scan intensity ( " MIN_RAWINTENSITY_STR " -> " MAX_RAWINTENSITY_STR " ) " ) ;
if ( ! intvar ) {
wlogprint ( " Invalid input \n " ) ;
goto retry ;
}
rawintensity = atoi ( intvar ) ;
free ( intvar ) ;
if ( rawintensity < MIN_RAWINTENSITY | | rawintensity > MAX_RAWINTENSITY ) {
wlogprint ( " Invalid selection \n " ) ;
goto retry ;
}
gpus [ selected ] . dynamic = false ;
gpus [ selected ] . intensity = 0 ; // Disable intensity when enabling raw intensity
gpus [ selected ] . xintensity = 0 ; // Disable xintensity when enabling raw intensity
gpus [ selected ] . rawintensity = rawintensity ;
wlogprint ( " Raw intensity on gpu %d set to %d \n " , selected , rawintensity ) ;
pause_dynamic_threads ( selected ) ;
goto retry ;
} else if ( ! strncasecmp ( & input , " r " , 1 ) ) {
if ( selected )
selected = curses_int ( " Select GPU to attempt to restart " ) ;
@ -942,11 +1018,13 @@ static cl_int queue_scrypt_kernel(_clState *clState, dev_blk_ctx *blk, __maybe_u
@@ -942,11 +1018,13 @@ static cl_int queue_scrypt_kernel(_clState *clState, dev_blk_ctx *blk, __maybe_u
}
static void set_threads_hashes ( unsigned int vectors , unsigned int compute_shaders , int64_t * hashes , size_t * globalThreads ,
unsigned int minthreads , __maybe_unused int * intensity , __maybe_unused int * xintensity )
unsigned int minthreads , __maybe_unused int * intensity , __maybe_unused int * xintensity , __maybe_unused int * rawintensity )
{
unsigned int threads = 0 ;
while ( threads < minthreads ) {
if ( * xintensity > 0 ) {
if ( * rawintensity > 0 ) {
threads = * rawintensity ;
} else if ( * xintensity > 0 ) {
threads = compute_shaders * * xintensity ;
} else {
threads = 1 < < * intensity ;
@ -1145,7 +1223,9 @@ static void get_opencl_statline_before(char *buf, size_t bufsiz, struct cgpu_inf
@@ -1145,7 +1223,9 @@ static void get_opencl_statline_before(char *buf, size_t bufsiz, struct cgpu_inf
static void get_opencl_statline ( char * buf , size_t bufsiz , struct cgpu_info * gpu )
{
if ( gpu - > xintensity > 0 )
if ( gpu - > rawintensity > 0 )
tailsprintf ( buf , bufsiz , " rI:%3d " , gpu - > rawintensity ) ;
else if ( gpu - > xintensity > 0 )
tailsprintf ( buf , bufsiz , " xI:%3d " , gpu - > xintensity ) ;
else
tailsprintf ( buf , bufsiz , " I:%2d " , gpu - > intensity ) ;
@ -1314,7 +1394,7 @@ static int64_t opencl_scanhash(struct thr_info *thr, struct work *work,
@@ -1314,7 +1394,7 @@ static int64_t opencl_scanhash(struct thr_info *thr, struct work *work,
gpu - > intervals = 0 ;
}
set_threads_hashes ( clState - > vwidth , clState - > compute_shaders , & hashes , globalThreads , localThreads [ 0 ] , & gpu - > intensity , & gpu - > xintensity ) ;
set_threads_hashes ( clState - > vwidth , clState - > compute_shaders , & hashes , globalThreads , localThreads [ 0 ] , & gpu - > intensity , & gpu - > xintensity , & gpu - > rawintensity ) ;
if ( hashes > gpu - > max_hashes )
gpu - > max_hashes = hashes ;