forked from WhiteyCookie/Bitaxe-Hashrate-Benchmark
-
Notifications
You must be signed in to change notification settings - Fork 39
Active thermal monitoring, boundary checks, and merged community fixes #9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
cerebrux
wants to merge
29
commits into
mrv777:main
Choose a base branch
from
cerebrux:main
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
484f186
Update bitaxe_hashrate_benchmark.py
Co1nB3e f7d6d6d
Update bitaxe_hashrate_benchmark.py
Co1nB3e ea3a2b3
Update bitaxe_hashrate_benchmark.py
Co1nB3e 32cdcae
feat(benchmark): Enhance data collection with power and fan speed; Re…
zorgoros 99f8323
feat(cli): Add option to apply specific settings without benchmarking
zorgoros 6b60b33
refactor(cli): Improve command-line help output
zorgoros 6d19eb6
add new readme based on latest changes
zorgoros 36c4fc1
add new readme based on latest changes
zorgoros 44b2992
add new readme based on latest changes
zorgoros 0604fac
add new readme based on latest changes
zorgoros 7d4da38
fix(docs): Correct README argument inline code formatting
zorgoros 9033a22
fix(docs): Correct README argument inline code formatting
zorgoros 77a3cda
refining readme
zorgoros 2edbeb4
refining readme
zorgoros fd3d302
refining readme
zorgoros 394cf79
Add stdev and running stdev
pwschattenberg a500e86
Fix formatting so width remains more constant
pwschattenberg faff91c
Merge pull request #3 from mrv777/Bitaxe-Hashrate-Benchmark
cerebrux 4fec6c8
Merge pull request #5 from mrv777/Bitaxe-Hashrate-Benchmark
cerebrux e95a22a
Merge pull request #8 from mrv777/Bitaxe-Hashrate-Benchmark
cerebrux 75fbff2
Fix potential negative variance in running_stddev calculation
cerebrux 7c8700d
Enhance safety: Monitor stabilization period and warn about max settings
cerebrux 49d7b21
Fix potential frequency underflow when adjusting settings
cerebrux cfdaa1a
Prevent voltage increase after overheat at initial frequency
cerebrux 80f6153
Add max-temp argument to command line options and update configuration
cerebrux eda6922
Add VR temperature check during stabilization to enhance safety
cerebrux b07d06e
Remove redundant restart_system calls in exception handling
cerebrux e280cbe
enforce args for set-values, validate IP, check return values, and cl…
cerebrux af906ff
removing unnecessary bold styling for features and output descriptions
cerebrux File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,167 +1,200 @@ | ||
| # Bitaxe Hashrate Benchmark | ||
| # **Bitaxe Hashrate Benchmark** | ||
|
|
||
| A Python-based benchmarking tool for optimizing Bitaxe mining performance by testing different voltage and frequency combinations while monitoring hashrate, temperature, and power efficiency. | ||
|
|
||
| ## Features | ||
| ## **Features** | ||
|
|
||
| - Automated benchmarking of different voltage/frequency combinations | ||
| - Temperature monitoring and safety cutoffs | ||
| - Power efficiency calculations (J/TH) | ||
| - Automatic saving of benchmark results | ||
| - Graceful shutdown with best settings retention | ||
| - Docker support for easy deployment | ||
| * Automated benchmarking of different voltage/frequency combinations | ||
| * Direct setting of specific voltage and frequency from command line | ||
| * Temperature monitoring and safety cutoffs | ||
| * Power consumption monitoring and reporting (Watts) | ||
| * Fan speed monitoring and reporting (Percentage) | ||
| * Power efficiency calculations (J/TH) | ||
| * Automatic saving of benchmark results | ||
| * Graceful shutdown with best settings retention | ||
| * Docker support for easy deployment | ||
|
|
||
| ## Prerequisites | ||
| ## **Prerequisites** | ||
|
|
||
| - Python 3.11 or higher | ||
| - Access to a Bitaxe miner on your network | ||
| - Docker (optional, for containerized deployment) | ||
| - Git (optional, for cloning the repository) | ||
| * Python 3.11 or higher | ||
| * Access to a Bitaxe miner on your network | ||
| * Docker (optional, for containerized deployment) | ||
| * Git (optional, for cloning the repository) | ||
|
|
||
| ## Installation | ||
| ## **Installation** | ||
|
|
||
| ### Standard Installation | ||
| ### **Standard Installation** | ||
|
|
||
| 1. Clone the repository: | ||
| ```bash | ||
| git clone https://github.com/mrv777/Bitaxe-Hashrate-Benchmark.git | ||
| cd Bitaxe-Hashrate-Benchmark | ||
| ``` | ||
| 1. Clone the repository: | ||
| ```bash | ||
| git clone https://github.com/mrv777/Bitaxe-Hashrate-Benchmark.git | ||
| cd Bitaxe-Hashrate-Benchmark | ||
| ``` | ||
|
|
||
| 2. Create and activate a virtual environment: | ||
| ```bash | ||
| python -m venv venv | ||
| # On Windows | ||
| venv\Scripts\activate | ||
| # On Linux/Mac | ||
| source venv/bin/activate | ||
| ``` | ||
| 2. Create and activate a virtual environment: | ||
| ```bash | ||
| python -m venv venv | ||
| # On Windows | ||
| venv\Scripts\activate | ||
| # On Linux/Mac | ||
| source venv/bin/activate | ||
| ``` | ||
|
|
||
| 3. Install dependencies: | ||
| ```bash | ||
| pip install -r requirements.txt | ||
| ``` | ||
| 3. Install dependencies: | ||
| ```bash | ||
| pip install -r requirements.txt | ||
| ``` | ||
|
|
||
| ### **Docker Installation** | ||
|
|
||
| 1. Build the Docker image: | ||
| `docker build -t bitaxe-benchmark .` | ||
|
|
||
| ### Docker Installation | ||
| ## **Usage** | ||
|
|
||
| 1. Build the Docker image: | ||
| ### **Standard Usage (Run Full Benchmark)** | ||
|
|
||
| Run the benchmark tool by providing your Bitaxe's IP address and initial settings: | ||
| ```bash | ||
| docker build -t bitaxe-benchmark . | ||
| python bitaxe_hashrate_benchmark.py <bitaxe_ip> -v <initial_voltage> -f <initial_frequency> | ||
| ``` | ||
|
|
||
| ## Usage | ||
|
|
||
| ### Standard Usage | ||
| **Arguments:** | ||
|
|
||
| Run the benchmark tool by providing your Bitaxe's IP address: | ||
| * `<bitaxe_ip>`: **Required.** IP address of your Bitaxe miner (e.g., `192.168.2.26`). | ||
| * `-v, --voltage:` **Optional.** Initial voltage in mV for testing (default: `1150`). | ||
| * `-f, --frequency:` **Optional.** Initial frequency in MHz for testing (default: `500`). | ||
|
|
||
| **Example:** | ||
| ```bash | ||
| python bitaxe_hashrate_benchmark.py <bitaxe_ip> | ||
| python bitaxe_hashrate_benchmark.py 192.168.1.136 -v 1150 -f 550 | ||
| ``` | ||
|
|
||
| Optional parameters: | ||
| - `-v, --voltage`: Initial voltage in mV (default: 1150) | ||
| - `-f, --frequency`: Initial frequency in MHz (default: 500) | ||
| ### **Apply Specific Settings (Without Benchmarking)** | ||
|
|
||
| Example: | ||
| To quickly apply specific voltage and frequency settings to your Bitaxe without running the full benchmark: | ||
| ```bash | ||
| python bitaxe_hashrate_benchmark.py 192.168.2.29 -v 1175 -f 775 | ||
| python bitaxe_hashrate_benchmark.py <bitaxe_ip> --set-values -v <desired_voltage_mv> -f <desired_frequency_mhz> | ||
| ``` | ||
|
|
||
| ### Docker Usage (Optional) | ||
| **Arguments:** | ||
|
|
||
| Run the container with your Bitaxe's IP address: | ||
| * `<bitaxe_ip>`: **Required.** IP address of your Bitaxe miner. | ||
| * `-s, --set-values`: **Flag.** Activates this mode to only set values and exit. | ||
| * `-v, --voltage`: **Required.** The exact voltage in mV to apply. | ||
| * `-f, --frequency`: **Required.** The exact frequency in MHz to apply. | ||
|
|
||
| **Example:** | ||
| ```bash | ||
| python bitaxe_hashrate_benchmark.py 192.168.1.136 --set-values -v 1150 -f 780 | ||
| ``` | ||
|
|
||
| ### **Docker Usage (Optional)** | ||
|
|
||
| Run the container with your Bitaxe's IP address (add --set-values for that mode): | ||
| ```bash | ||
| docker run --rm bitaxe-benchmark <bitaxe_ip> [options] | ||
| ``` | ||
|
|
||
| Example: | ||
| Example (Full Benchmark): | ||
| ```bash | ||
| docker run --rm bitaxe-benchmark 192.168.2.26 -v 1200 -f 550 | ||
| ``` | ||
|
|
||
| ## Configuration | ||
|
|
||
| The script includes several configurable parameters: | ||
|
|
||
| - Maximum chip temperature: 66°C | ||
| - Maximum VR temperature: 86°C | ||
| - Maximum allowed voltage: 1400mV | ||
| - Minimum allowed voltage: 1000mV | ||
| - Maximum allowed frequency: 1200MHz | ||
| - Maximum power consumption: 40W | ||
| - Minimum allowed frequency: 400MHz | ||
| - Minimum input voltage: 4800mV | ||
| - Maximum input voltage: 5500mV | ||
| - Benchmark duration: 10 minutes | ||
| - Sample interval: 15 seconds | ||
| - Sleep time before benchmark: 90 seconds | ||
| - **Minimum required samples: 7** (for valid data processing) | ||
| - Voltage increment: 20mV | ||
| - Frequency increment: 25MHz | ||
|
|
||
| ## Output | ||
|
|
||
| The benchmark results are saved to `bitaxe_benchmark_results_<ip_address>.json`, containing: | ||
| - Complete test results for all combinations | ||
| - Top 5 performing configurations ranked by hashrate | ||
| - Top 5 most efficient configurations ranked by J/TH | ||
| - For each configuration: | ||
| - Average hashrate (with outlier removal) | ||
| - Temperature readings (excluding initial warmup period) | ||
| - VR temperature readings (when available) | ||
| - Power efficiency metrics (J/TH) | ||
| - Input voltage measurements | ||
| - Voltage/frequency combinations tested | ||
|
|
||
| ## Safety Features | ||
|
|
||
| - Automatic temperature monitoring with safety cutoff (66°C chip temp) | ||
| - Voltage regulator (VR) temperature monitoring with safety cutoff (86°C) | ||
| - Input voltage monitoring with minimum threshold (4800mV) and maximum threshold (5500mV) | ||
| - Power consumption monitoring with safety cutoff (40W) | ||
| - Temperature validation (must be above 5°C) | ||
| - Graceful shutdown on interruption (Ctrl+C) | ||
| - Automatic reset to best performing settings after benchmarking | ||
| - Input validation for safe voltage and frequency ranges | ||
| - Hashrate validation to ensure stability | ||
| - Protection against invalid system data | ||
| - Outlier removal from benchmark results | ||
|
|
||
| ## Benchmarking Process | ||
| Example (Set Settings Only): | ||
| ```bash | ||
| docker run --rm bitaxe-benchmark 192.168.2.26 --set-values -v 1150 -f 780 | ||
| ``` | ||
|
|
||
| ## **Configuration** | ||
|
|
||
| The script includes several configurable parameters. These can be adjusted in the bitaxe_hashrate_benchmark.py file: | ||
|
|
||
| * Maximum chip temperature: 66°C | ||
| * Maximum VR temperature: 86°C | ||
| * Maximum allowed voltage: 1400mV | ||
| * Minimum allowed voltage: 1000mV | ||
| * Maximum allowed frequency: 1200MHz | ||
| * Maximum power consumption: 30W | ||
| * Minimum allowed frequency: 400MHz | ||
| * Minimum input voltage: 4800mV | ||
| * Maximum input voltage: 5500mV | ||
| * Benchmark duration: 600 seconds (10 minutes per combination) | ||
| * Sample interval: 15 seconds | ||
| * Sleep time before benchmark: 90 seconds | ||
| * Minimum required samples: 7 (for valid data processing) | ||
| * Voltage increment: 15mV | ||
| * Frequency increment: 20MHz | ||
| * ASIC Configuration: asic_count is hardcoded to 1 as it's not always provided by the API. small_core_count is fetched from the Bitaxe. | ||
|
|
||
| ## **Output** | ||
|
|
||
| The benchmark results are saved to bitaxe_benchmark_results_<ip_address>.json, containing: | ||
|
|
||
| * Complete test results for all combinations | ||
| * Top 5 performing configurations ranked by hashrate | ||
| * Top 5 most efficient configurations ranked by J/TH | ||
| * For each configuration: | ||
| * Average hashrate (with outlier removal) | ||
| * Temperature readings (excluding initial warmup period) | ||
| * VR temperature readings (when available) | ||
| * Power efficiency metrics (J/TH) | ||
| * Average Power (Watts) | ||
| * Average Fan Speed (Percentage or RPM, if available from API) | ||
| * Input voltage measurements | ||
| * Voltage/frequency combinations tested | ||
| * Error reason (if any) for a specific iteration | ||
|
|
||
| ## **Safety Features** | ||
|
|
||
| * Automatic temperature monitoring with safety cutoff (66°C chip temp) | ||
| * Voltage regulator (VR) temperature monitoring with safety cutoff (86°C) | ||
| * Input voltage monitoring with minimum threshold (4800mV) and maximum threshold (5500mV) | ||
| * Power consumption monitoring with safety cutoff (30W) | ||
| * Temperature validation (must be above 5°C) | ||
| * Graceful shutdown on interruption (Ctrl+C) | ||
| * Automatic reset to best performing settings after benchmarking | ||
| * Input validation for safe voltage and frequency ranges | ||
| * Hashrate validation to ensure stability | ||
| * Protection against invalid system data | ||
| * Outlier removal from benchmark results | ||
|
|
||
| ## **Benchmarking Process** | ||
|
|
||
| The tool follows this process: | ||
| 1. Starts with user-specified or default voltage/frequency | ||
| 2. Tests each combination for 20 minutes | ||
| 3. Validates hashrate is within 8% of theoretical maximum | ||
| 4. Incrementally adjusts settings: | ||
| - Increases frequency if stable | ||
| - Increases voltage if unstable | ||
| - Stops at thermal or stability limits | ||
| 5. Records and ranks all successful configurations | ||
| 6. Automatically applies the best performing stable settings | ||
| 7. Restarts system after each test for stability | ||
|
|
||
| 1. Starts with user-specified or default voltage/frequency | ||
| 2. Tests each combination for 10 minutes | ||
| 3. Validates hashrate is within 6% of theoretical maximum | ||
| 4. Incrementally adjusts settings: | ||
| * Increases frequency if stable | ||
| * Increases voltage if unstable | ||
| * Stops at thermal or stability limits | ||
| 5. Records and ranks all successful configurations | ||
| 6. Automatically applies the best performing stable settings | ||
| 7. Restarts system after each test for stability | ||
| 8. Allows 90-second stabilization period between tests | ||
|
|
||
| ## Data Processing | ||
| ## **Data Processing** | ||
|
|
||
| The tool implements several data processing techniques to ensure accurate results: | ||
| - Removes 3 highest and 3 lowest hashrate readings to eliminate outliers | ||
| - Excludes first 6 temperature readings during warmup period | ||
| - Validates hashrate is within 6% of theoretical maximum | ||
| - Averages power consumption across entire test period | ||
| - Monitors VR temperature when available | ||
| - Calculates efficiency in Joules per Terahash (J/TH) | ||
|
|
||
| ## Contributing | ||
| * Removes 3 highest and 3 lowest hashrate readings to eliminate outliers | ||
| * Excludes first 6 temperature readings during warmup period | ||
| * Validates hashrate is within 6% of theoretical maximum | ||
| * Averages power consumption across entire test period | ||
| * Monitors VR temperature when available | ||
| * Calculates efficiency in Joules per Terahash (J/TH) | ||
| * Averages fan speed across entire test period | ||
|
|
||
| ## **Contributing** | ||
|
|
||
| Contributions are welcome! Please feel free to submit a Pull Request. | ||
|
|
||
| ## License | ||
| ## **License** | ||
|
|
||
| This project is licensed under the GNU General Public License v3.0 - see the [LICENSE](LICENSE) file for details. | ||
|
|
||
| ## Disclaimer | ||
| ## **Disclaimer** | ||
|
|
||
| Please use this tool responsibly. Overclocking and voltage modifications can potentially damage your hardware if not done carefully. Always ensure proper cooling and monitor your device during benchmarking. | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.