update for 2x mi50
This commit is contained in:
parent
6d767271f3
commit
9a1d3d301f
38
main.cpp
38
main.cpp
@ -69,33 +69,35 @@ double fan_curve(double temperature, double min_fan, double max_fan, double low_
|
|||||||
|
|
||||||
double gpu_fan_zone(const std::vector<Sensor>& sensors)
|
double gpu_fan_zone(const std::vector<Sensor>& sensors)
|
||||||
{
|
{
|
||||||
const char mi50Chip[] = "amdgpu-pci-2300";
|
std::vector<std::pair<std::string, bool>> gpus = {{"amdgpu-pci-0300", false}, {"amdgpu-pci-c300", false}};
|
||||||
const char mi25Chip[] = "amdgpu-pci-4300";
|
|
||||||
bool hitMi25 = false;
|
|
||||||
bool hitMi50 = false;
|
|
||||||
const char monitored_sensor_name[] = "edge";
|
const char monitored_sensor_name[] = "edge";
|
||||||
|
|
||||||
double max_temp = std::numeric_limits<double>::min();
|
double max_temp = std::numeric_limits<double>::min();
|
||||||
for(const Sensor& sensor : sensors)
|
for(const Sensor& sensor : sensors)
|
||||||
{
|
{
|
||||||
if((sensor.chip == mi50Chip || sensor.chip == mi25Chip) && sensor.name == monitored_sensor_name)
|
if(sensor.name == monitored_sensor_name)
|
||||||
{
|
{
|
||||||
if(sensor.chip == mi50Chip)
|
for(std::pair<std::string, bool>& gpu : gpus)
|
||||||
hitMi50 = true;
|
{
|
||||||
else
|
if(sensor.chip == gpu.first)
|
||||||
hitMi25 = true;
|
{
|
||||||
if(max_temp < sensor.reading)
|
gpu.second = true;
|
||||||
max_temp = sensor.reading;
|
}
|
||||||
|
if(max_temp < sensor.reading)
|
||||||
|
max_temp = sensor.reading;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for(std::pair<std::string, bool>& gpu : gpus)
|
||||||
|
{
|
||||||
|
if(!gpu.second)
|
||||||
|
{
|
||||||
|
std::cerr<<"Could not get temperature from "<<gpu.first<<" ramping fans to maximum\n";
|
||||||
|
return 1.0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!hitMi50 || !hitMi25)
|
return fan_curve(max_temp, 0.10, 1.0, 45, 75);
|
||||||
{
|
|
||||||
std::cerr<<"Could not get temperature from MI25 or MI50! Ramping fans to maximum\n";
|
|
||||||
return 1.0;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
return fan_curve(max_temp, 0.10, 1.0, 45, 75);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
double system_fan_zone(const std::vector<Sensor>& sensors)
|
double system_fan_zone(const std::vector<Sensor>& sensors)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user