@@ -143,6 +143,10 @@ struct CODES codes[] = {
143
143
{ SEVERITY_ERR , MSG_NOGPUADL ,PARAM_GPU , "GPU %d does not have ADL" },
144
144
{ SEVERITY_ERR , MSG_INVINT , PARAM_STR , "Invalid intensity (%s) - must be '" _DYNAMIC "' or range " MIN_INTENSITY_STR " - " MAX_INTENSITY_STR },
145
145
{ SEVERITY_INFO , MSG_GPUINT , PARAM_BOTH , "GPU %d set new intensity to %s" },
146
+ { SEVERITY_ERR , MSG_INVXINT , PARAM_STR , "Invalid xintensity (%s) - must be range " MIN_XINTENSITY_STR " - " MAX_XINTENSITY_STR },
147
+ { SEVERITY_INFO , MSG_GPUXINT , PARAM_BOTH , "GPU %d set new xintensity to %s" },
148
+ { SEVERITY_ERR , MSG_INVRAWINT , PARAM_STR , "Invalid rawintensity (%s) - must be range " MIN_RAWINTENSITY_STR " - " MAX_RAWINTENSITY_STR },
149
+ { SEVERITY_INFO , MSG_GPURAWINT , PARAM_BOTH , "GPU %d set new rawintensity to %s" },
146
150
{ SEVERITY_SUCC , MSG_MINECONFIG ,PARAM_NONE , "sgminer config" },
147
151
{ SEVERITY_ERR , MSG_GPUMERR , PARAM_BOTH , "Setting GPU %d memoryclock to (%s) reported failure" },
148
152
{ SEVERITY_SUCC , MSG_GPUMEM , PARAM_BOTH , "Setting GPU %d memoryclock to (%s) reported success" },
@@ -2329,12 +2333,73 @@ static void gpuintensity(struct io_data *io_data, __maybe_unused SOCKETTYPE c, c
2329
2333
2330
2334
gpus [id ].dynamic = false;
2331
2335
gpus [id ].intensity = intensity ;
2336
+ gpus [id ].xintensity = 0 ;
2337
+ gpus [id ].rawintensity = 0 ;
2332
2338
sprintf (intensitystr , "%d" , intensity );
2333
2339
}
2334
2340
2341
+ // fix config with new settings so that we can save them
2342
+ update_config_intensity (get_gpu_profile (id ));
2343
+
2335
2344
message (io_data , MSG_GPUINT , id , intensitystr , isjson );
2336
2345
}
2337
2346
2347
+ static void gpuxintensity (struct io_data * io_data , __maybe_unused SOCKETTYPE c , char * param , bool isjson , __maybe_unused char group )
2348
+ {
2349
+ int id ;
2350
+ char * value ;
2351
+ int intensity ;
2352
+ char intensitystr [7 ];
2353
+
2354
+ if (!splitgpuvalue (io_data , param , & id , & value , isjson ))
2355
+ return ;
2356
+
2357
+ intensity = atoi (value );
2358
+ if (intensity < MIN_XINTENSITY || intensity > MAX_XINTENSITY ) {
2359
+ message (io_data , MSG_INVXINT , 0 , value , isjson );
2360
+ return ;
2361
+ }
2362
+
2363
+ gpus [id ].dynamic = false;
2364
+ gpus [id ].intensity = 0 ;
2365
+ gpus [id ].xintensity = intensity ;
2366
+ gpus [id ].rawintensity = 0 ;
2367
+ sprintf (intensitystr , "%d" , intensity );
2368
+
2369
+ // fix config with new settings so that we can save them
2370
+ update_config_xintensity (get_gpu_profile (id ));
2371
+
2372
+ message (io_data , MSG_GPUXINT , id , intensitystr , isjson );
2373
+ }
2374
+
2375
+ static void gpurawintensity (struct io_data * io_data , __maybe_unused SOCKETTYPE c , char * param , bool isjson , __maybe_unused char group )
2376
+ {
2377
+ int id ;
2378
+ char * value ;
2379
+ int intensity ;
2380
+ char intensitystr [16 ];
2381
+
2382
+ if (!splitgpuvalue (io_data , param , & id , & value , isjson ))
2383
+ return ;
2384
+
2385
+ intensity = atoi (value );
2386
+ if (intensity < MIN_RAWINTENSITY || intensity > MAX_RAWINTENSITY ) {
2387
+ message (io_data , MSG_INVRAWINT , 0 , value , isjson );
2388
+ return ;
2389
+ }
2390
+
2391
+ gpus [id ].dynamic = false;
2392
+ gpus [id ].intensity = 0 ;
2393
+ gpus [id ].xintensity = 0 ;
2394
+ gpus [id ].rawintensity = intensity ;
2395
+ sprintf (intensitystr , "%d" , intensity );
2396
+
2397
+ // fix config with new settings so that we can save them
2398
+ update_config_rawintensity (get_gpu_profile (id ));
2399
+
2400
+ message (io_data , MSG_GPURAWINT , id , intensitystr , isjson );
2401
+ }
2402
+
2338
2403
static void gpumem (struct io_data * io_data , __maybe_unused SOCKETTYPE c , __maybe_unused char * param , bool isjson , __maybe_unused char group )
2339
2404
{
2340
2405
#ifdef HAVE_ADL
@@ -2929,6 +2994,8 @@ struct CMDS {
2929
2994
{ "addprofile" , api_profile_add , true, false },
2930
2995
{ "removeprofile" , api_profile_remove , true, false },
2931
2996
{ "gpuintensity" , gpuintensity , true, false },
2997
+ { "gpuxintensity" , gpuxintensity , true, false },
2998
+ { "gpurawintensity" , gpurawintensity , true, false },
2932
2999
{ "gpumem" , gpumem , true, false },
2933
3000
{ "gpuengine" , gpuengine , true, false },
2934
3001
{ "gpufan" , gpufan , true, false },
0 commit comments