Я просто оставлю это здесь
import re
import argparse
def parse_msi_afterburner_profile(profile_path):
"""Parses an MSI Afterburner profile and extracts the VF curve data."""
try:
with open(profile_path, 'r') as f:
profile_content = f.read()
except FileNotFoundError:
print(f"Error: Profile file not found at {profile_path}")
return None
# Regex to find VF points (adjust regex if needed for your profile format)
vf_point_regex = r"\[VF Curve Point (\d+)\]\nVoltage=(\d+)\nFrequency=(\d+)"
vf_points = []
for match in re.finditer(vf_point_regex, profile_content):
index = int(match.group(1))
voltage = int(match.group(2))
frequency = int(match.group(3))
vf_points.append((index, voltage, frequency))
# Sort by index to ensure correct order
vf_points.sort(key=lambda x: x[0]) # Important to keep the order!
return vf_points
def generate_nvidia_settings_script(vf_points, device_id=0): # device_id is usually 0
"""Generates an nvidia-settings script to set the VF curve."""
script = "#!/bin/bash\n\n"
for _, voltage, frequency in vf_points:
# Important: Nvidia-settings uses millivolts and MHz. Afterburner is sometimes different
mv = voltage # Afterburner voltage may already be in mV, if not, adjust here.
mhz = frequency
# Important: You must set the coolbits option to allow adjusting the voltage.
script += f"nvidia-settings -a '[gpu:{device_id}]/GPUVoltageOffset[0]={mv}'\n" # Offset voltage
script += f"nvidia-settings -a '[gpu:{device_id}]/GPUMemoryOffset[0]=0'\n" # Memory offset - optional
script += f"nvidia-settings -a '[gpu:{device_id}]/GPUTargetFanSpeed[0]=70'\n" # Fan speed - optional
script += f"nvidia-settings -a '[gpu:{device_id}]/GpuClockOffset[0]={mhz}'\n" # Clock offset
# Alternative method for setting voltage (less common):
# script += f"nvidia-settings -a '[gpu:{device_id}]/GPUVoltage[0]={mv}'\n" # Absolute voltage
return script
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Convert MSI Afterburner profile to nvidia-settings script.")
parser.add_argument("profile_path", help="Path to the MSI Afterburner profile file.")
parser.add_argument("-o", "--output", help="Output script file (default: vf_curve.sh)", default="vf_curve.sh")
parser.add_argument("-d", "--device", type=int, help="GPU device ID (default: 0)", default=0)
args = parser.parse_args()
vf_points = parse_msi_afterburner_profile(args.profile_path)
if vf_points:
script = generate_nvidia_settings_script(vf_points, args.device)
try:
with open(args.output, 'w') as outfile:
outfile.write(script)
print(f"Script saved to {args.output}")
print(f"Don't forget to make it executable: chmod +x {args.output}")
except Exception as e:
print(f"Error writing script to file: {e}")
Под оффтопиком в MSI Afterburner делаете понижение напруги, потом запускаете это. Оно вам выдаст скрипт который в онтопике нарисует ту же курву