mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-01-13 14:19:12 +00:00
Thanks to Benedani on Discord this should be correct way to get physical cores on linux now
This commit is contained in:
parent
0f255d9ada
commit
d684e380a1
1 changed files with 12 additions and 2 deletions
|
@ -94,8 +94,18 @@ namespace Ryujinx.Common.SystemInfo
|
||||||
}
|
}
|
||||||
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
else if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
|
||||||
{
|
{
|
||||||
coreCount = File.ReadLines("/proc/cpuinfo")
|
string cpuCoresLine = File.ReadLines("/proc/cpuinfo")
|
||||||
.Count(line => line.Contains("cpu cores"));
|
.FirstOrDefault(line => line.Contains("cpu cores"));
|
||||||
|
|
||||||
|
if (cpuCoresLine != null)
|
||||||
|
{
|
||||||
|
string[] parts = cpuCoresLine.Split(':');
|
||||||
|
if (parts.Length == 2 && int.TryParse(parts[1].Trim(), out int cores))
|
||||||
|
{
|
||||||
|
coreCount = cores;
|
||||||
|
Console.WriteLine("Number of physical cores: " + coreCount);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
|
else if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue