Upload files to "/"

This commit is contained in:
karlji 2024-08-12 15:54:49 +00:00
parent 64d6e5c94e
commit 6bbd3d0954
2 changed files with 124 additions and 0 deletions

11
LICENSE Normal file
View File

@ -0,0 +1,11 @@
Proprietary License
This project and the accompanying materials are made available under the terms of this Proprietary License which accompanies this distribution.
NO WARRANTY
ANY USE OF THE PROVIDED SOFTWARE IS AT YOUR OWN RISK. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT ANY WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE, AND NON-INFRINGEMENT.
LIMITATION OF LIABILITY
IN NO EVENT AND UNDER NO LEGAL THEORY, WHETHER IN TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, UNLESS REQUIRED BY APPLICABLE LAW (SUCH AS DELIBERATE AND GROSSLY NEGLIGENT ACTS) OR AGREED TO IN WRITING, SHALL THE AUTHORS BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER ARISING AS A RESULT OF THIS LICENSE OR THE USE OF THE SOFTWARE INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF THE AUTHORS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

113
README.md Normal file
View File

@ -0,0 +1,113 @@
# CudaStresser
**CudaStresser** is a Python-based tool designed to stress test CUDA-enabled GPUs. It performs various operations to measure GPU memory bandwidth, stress the device, and log GPU utilization metrics. This tool is useful for developers, researchers, and system administrators who want to benchmark or stress test their GPU hardware.
## Features
- **CUDA Core Stress Testing**: Create and manipulate tensors on the GPU to stress test the CUDA cores.
- **VRAM Load and Unload**: Simulate heavy memory operations to test GPU memory bandwidth and consistency.
- **Real-time GPU Monitoring**: Log GPU utilization, memory usage, and temperature during the stress test.
- **Multiprocessing**: Efficiently utilize multiple CPU cores for concurrent GPU stress testing.
## Requirements
- Python 3.7+
- PyTorch 1.7+
- CUDA-enabled GPU(s)
- NVIDIA drivers with `nvidia-smi` available
## Installation
1. **Clone the repository:**
```bash
git clone https://github.com/your-username/cuda-stresser.git
cd cuda-stresser
```
2. **Create and activate a virtual environment (optional but recommended):**
```bash
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
```
3. **Install the required Python packages:**
```bash
pip install torch
```
4. **Ensure `nvidia-smi` is available:**
Make sure `nvidia-smi` is accessible in your system's PATH. This is usually installed with the NVIDIA drivers.
## Usage
### Basic Stress Test
To perform a basic CUDA stress test:
```bash
python cuda_stresser.py
```
This command will:
- Detect available CUDA devices.
- Stress test the CUDA cores by creating and manipulating tensors for 60 seconds.
- Log GPU utilization, memory usage, and temperature every 5 seconds.
- Display the progress and results in the console.
### Custom Stress Test
You can customize the test parameters using the `CudaStresser` class:
```python
from cuda_stresser import CudaStresser
# Initialize the stresser with 99% VRAM load
stresser = CudaStresser(load_perc=0.99)
# Perform a stress test for 60 seconds with 15 tensors
results = stresser.cuda_stress(timing=60, tensor_num=15)
print(results)
# Perform a VRAM load/unload test for 60 seconds
vram_results = stresser.cuda_load_unload(timing=60)
print(vram_results)
```
### Logging GPU Information
During the stress test, the script logs GPU utilization, memory usage, and temperature data. The logs can be accessed from the console or modified to save to a file.
## Customization
### Parameters
- **`load_perc`**: Percentage of VRAM to load (default: `0.99`).
- **`timing`**: Duration of the stress test in seconds (default: `60`).
- **`tensor_num`**: Number of tensors to create for the stress test (default: `1000`).
- **`poll_time`**: Interval for logging GPU data in seconds (default: `5`).
### Example with Custom Parameters
```python
stresser = CudaStresser(load_perc=0.90)
gpu_log = stresser.cuda_stress(timing=120, tensor_num=20, poll_time=10)
print("GPU Log:", gpu_log)
```
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
## Acknowledgements
Special thanks to the developers and contributors of [PyTorch](https://pytorch.org) for providing an excellent framework for machine learning and GPU computing.
---
**Note**: This tool is intended for testing and benchmarking purposes. Use it responsibly, especially on production systems, as it can put significant load on your hardware.