-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgpu_load_test.py
More file actions
38 lines (26 loc) · 969 Bytes
/
Copy pathgpu_load_test.py
File metadata and controls
38 lines (26 loc) · 969 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
"""
Simple GPU load generator to test monitoring
"""
import numpy as np
import time
def generate_gpu_load():
"""Generate some computational load to test GPU monitoring"""
print("🔥 Generating CPU/GPU load for testing...")
print(" (This will make your fans spin up!)")
# Generate large matrices for computation
size = 5000
for i in range(10):
print(f" Load iteration {i+1}/10...")
# Create large random matrices
a = np.random.rand(size, size).astype(np.float32)
b = np.random.rand(size, size).astype(np.float32)
# Perform matrix multiplication (CPU intensive)
c = np.dot(a, b)
# Add some additional operations
d = np.sin(c) + np.cos(c)
result = np.sum(d)
print(f" Result sum: {result:.2e}")
time.sleep(1)
print("✅ Load test completed!")
if __name__ == "__main__":
generate_gpu_load()