Commit Graph

282 Commits

Author SHA1 Message Date
cc4f3e01f6 Make Windows-specific throttling code conditional
- Wrap throttling logic in #ifdef _WIN32 blocks in Miner.cpp
- Remove Windows-specific includes from Worker.cpp and CpuWorker.cpp
- Restore Worker.cpp to original platform-neutral state
- Throttling now only compiles on Windows, Linux builds should work
2025-12-13 23:55:45 +01:00
9289d2ceaa Move affinity logic to centralized Miner timer
- Remove affinity setting from worker threads (causing conflicts)
- Add Windows API affinity control to Miner.cpp timer
- Centralized location prevents multiple threads fighting over affinity
- Set 25% cores when active, 100% when inactive
- Add windows.h include for SetProcessAffinityMask
2025-12-13 19:07:28 +01:00
1c9256d1e8 Fix affinity to only change when state changes
- Add static lastThrottleState to track state changes
- Only call SetProcessAffinityMask when m_isThrottled != lastThrottleState
- This prevents constantly setting 25% affinity every loop
- Should now properly switch between 25% and 100% based on inactivity
2025-12-13 19:01:14 +01:00
afdbb02c49 Fix dynamic core calculation for proper throttling
- Calculate 25% of total cores instead of hardcoded 2 cores
- Use std::max(1u, totalCores / 4) to ensure minimum 1 core
- Build affinity mask dynamically for calculated cores
- This should fix stuck at 50% issue and scale properly
2025-12-13 18:54:15 +01:00
ea6b600fb2 Implement Windows API affinity throttling like working version
- Use SetProcessAffinityMask directly instead of sleep approach
- Limit to first 2 cores (0x3) when user active ~25% usage
- Use all cores (-1) when user inactive
- Add windows.h include for Windows API
- This matches the working implementation approach
2025-12-13 18:42:07 +01:00
684ea9d08a Try more aggressive sleep for throttling
- Increase sleep from 300ms to 900ms to ensure actual throttling
- This should create more noticeable CPU usage reduction
- Simple approach: sleep most of the time, work briefly
2025-12-13 18:37:03 +01:00
2972172a05 Fix throttling sleep placement to after hashing work
- Move sleep from before hashing to after hashing completion
- Increase sleep to 300ms to achieve ~25% CPU usage
- This ensures actual work gets done before throttling delay
- Sleep now happens after m_count increment where hashing is complete
2025-12-13 18:25:14 +01:00
5f9c1bd885 Fix throttling to use timing-based approach instead of affinity
- Remove process affinity changes that weren't working
- Use 100ms sleep to achieve ~25% CPU usage when active
- Simplify throttling logic to be more reliable
- Keep 60-second idle threshold and 5-second check interval
2025-12-13 18:18:57 +01:00
af4c763d9a Fix CPU throttling to use 25% of cores and 60s threshold
- Change idle threshold from 5 minutes to 60 seconds
- Calculate 25% of total cores instead of hardcoded 2 cores
- Update logging message to reflect 25% usage
- Add algorithm include for std::max function
- Ensure minimum 1 core is always used
2025-12-13 18:09:17 +01:00
0667011c20 Add CPU throttling functionality
- Add throttle-on-active configuration option
- Implement process affinity control for Windows
- Add throttling logic in CpuWorker with 5-second checks
- Add logging for throttling state changes
- Set default throttling to enabled
- Throttles to 2 cores when user is active
- Uses 800ms sleep when throttled to reduce CPU usage
2025-12-13 18:07:50 +01:00
someone
6adf238c73 Removed almost all logging except Log::print, added base64 function in src/base/tools/Cvt.cpp which will and is being used in future 2025-11-08 20:22:43 +01:00
xmrig
e28d663d80
Merge pull request #3677 from SChernykh/dev
Tweaked autoconfig for AMD CPUs with < 2 MB L3 cache per thread, again (hopefully the last time)
2025-06-19 18:07:54 +07:00
SChernykh
aba1ad8cfc Tweaked autoconfig for AMD CPUs with < 2 MB L3 cache per thread, again (hopefully the last time) 2025-06-19 12:58:31 +02:00
xmrig
48faf0a11b
Merge pull request #3671 from SChernykh/dev
Hwloc: fixed detection of L2 cache size for some complex NUMA topologies
2025-06-17 18:52:43 +07:00
SChernykh
d125d22d27 Hwloc: fixed detection of L2 cache size for some complex NUMA topologies 2025-06-17 13:49:02 +02:00
XMRig
fc395a5800
Update ARM CPUs database. 2025-06-16 19:54:08 +07:00
XMRig
9e7cf69ac3
Detect CPU name and AES instructions on Windows ARM64. 2025-06-13 21:02:10 +07:00
XMRig
57a4998ae2
Fix Linux build. 2025-06-13 04:05:30 +07:00
XMRig
34b4448a81
Split BasicCpuInfo_arm. 2025-06-13 03:57:13 +07:00
XMRig
650d794fb1
Initial Windows ARM64 support via MSYS2. 2025-06-13 03:00:34 +07:00
SChernykh
e4c30eb0dd Tweaked autoconfig for AMD CPUs with < 2 MB L3 cache per thread 2025-06-11 18:34:50 +02:00
SChernykh
6cfc02d24f Optimized autoconfig for AMD CPUs with < 2 MB L3 cache per thread 2025-03-22 11:34:23 +01:00
SChernykh
77c14c8362 Fix number of threads on the new Intel Core Ultra CPUs 2024-10-25 13:44:24 +02:00
SChernykh
20d555668b Fixed threads auto-config on Zen5 2024-08-16 23:36:22 +02:00
SChernykh
17a52fb418 Always reset nonce on RandomX dataset change
Also never get a new job when mining is paused
2024-08-14 16:41:03 +02:00
XMRig
98c775703e
Don't generate "rx/yada" profile, use the "rx" profile by default. 2024-08-04 20:00:12 +07:00
SChernykh
748365d6e3 Added Zen5 detection
Preliminary Zen5 support, MSR mod is not ready yet.
2024-08-03 11:01:18 +02:00
Matthew Vogel
5342f25fbf update constants for yadacoin 2024-07-31 23:45:34 -07:00
SChernykh
86f5db19d2 Removed rx/keva
Keva coin is too small now.
2024-07-31 08:28:05 +02:00
XMRig
c7e541d84f
Disallow direct use of HwlocCpuInfo class. 2023-06-07 00:32:09 +07:00
XMRig
554b60966b
Fixed compatibility with hwloc 1.11. 2023-06-06 02:30:10 +07:00
XMRig
055db83142
Added new ARM CPU names. 2023-06-04 19:36:53 +07:00
SChernykh
826e23b4c4 Fixed jccErratum list 2023-05-26 12:46:59 +02:00
SChernykh
7f7fc363e1 Tweaked auto-tuning for Intel CPUs
Alder Lake and newer CPUs have exclusive L3 cache and benefit from more threads until L3+L2 is filled.
2023-04-18 21:20:45 +02:00
SChernykh
64b0d9562e Fixed broken RandomX light mode mining
RandomX VMs didn't get updated properly in light mode.
2023-01-21 16:02:47 +01:00
SChernykh
7d4d48e83b DragonflyBSD compilation fixes 2022-12-17 13:11:14 +01:00
SChernykh
a02afe6d4f Added ifdefs for DragonflyBSD
Possible fix for #3179
2022-12-16 15:26:37 +01:00
SChernykh
7fc45dfb2d RandomX: added MSR mod for Zen 4
+0.8% faster on Ryzen 9 7950X
2022-10-01 18:33:04 +02:00
SChernykh
22d6a7525e Removed deprecated AstroBWTv1 and v2 2022-06-12 11:47:36 +02:00
SChernykh
97683e5719 Fixes for 32-bit ARM 2022-05-20 21:16:10 +02:00
SChernykh
a3cb74f29b Removed old AstroBWT algorithm
It's not used anywhere now.
2022-04-15 10:59:31 +02:00
SChernykh
b5da73389f Dero HE fork support (astrobwt/v2 algorithm) 2022-03-05 00:31:18 +01:00
SChernykh
644f4cc017 Fixed unaligned memory accesses 2022-01-26 17:18:18 +01:00
SChernykh
7f2f50a8d9 RandomX: don't restart mining threads when the seed changes
It helps to not loose huge pages when the seed changes (every 2048 blocks, ~2.8 days).
2021-12-25 13:39:15 +01:00
SChernykh
93081eb1f6 GhostRidere: set correct priority for helper threads
Fixes #2825
2021-12-20 12:05:17 +01:00
SChernykh
a39ab89236 Fixed "READY threads X/X" display after algo switching 2021-12-03 07:44:23 +01:00
SChernykh
e87d5111a2 Compiler fix 2021-12-01 17:08:40 +01:00
SChernykh
1a9eaaad8f VAES crash fixes 2021-11-29 21:05:51 +01:00
SChernykh
a4d5d0a75a Added VAES support for Cryptonight variants 2021-11-28 20:49:54 +01:00
Tony Butler
02240eff8c Slash and burn EOL whitespace everywhere 2021-11-27 17:59:40 -07:00