This commit is contained in:
rawhide kobayashi 2025-04-09 00:29:46 -05:00
commit b38dc16cc1
2 changed files with 31 additions and 10 deletions

View File

@ -146,6 +146,11 @@ namespace ryzen_smu_cli
{
Dictionary<int, int> mappedCores = [];
int maxTries = 3;
for (int currentTry = 1; currentTry <= maxTries; currentTry++)
{
mappedCores.Clear();
int logicalCoreIter = 0;
for (var i = 0; i < ryzen.info.topology.physicalCores; i++)
@ -154,7 +159,22 @@ namespace ryzen_smu_cli
if (ryzen.GetPsmMarginSingleCore((uint) (((mapIndex << 8) | ((i % 8) & 0xF)) << 20)) != null)
{
mappedCores.Add(logicalCoreIter, i);
logicalCoreIter += 1;
logicalCoreIter++;
}
}
// The mapped cores should match the amount of physical cores
if (mappedCores.Count == ryzen.info.topology.cores)
{
break;
}
// Something weird is happening if we cannot find the logical cores for all the physical ones even after three attempts
if (currentTry >= maxTries)
{
Console.Error.WriteLine($"Did not find the expected amount of cores for mapping ({ryzen.info.topology.cores} expected but found only {mappedCores.Count})!");
Environment.Exit(8);
}
}
@ -236,6 +256,7 @@ namespace ryzen_smu_cli
Environment.Exit(3);
}
string validArgFormat = @"^(-?\d{1,2}(,-?\d{1,2})*|\d{1,2}:-?\d{1,2}(,\d{1,2}:-?\d{1,2})*)$";
if (!Regex.IsMatch(offsetArgs, validArgFormat))

View File

@ -6,7 +6,7 @@
<RootNamespace>ryzen_smu_cli</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<Version>0.1.2</Version>
<Version>0.0.3</Version>
</PropertyGroup>
<PropertyGroup>