Потенциальное поднятие FPS в Cyberpunk 2077 для владельцев Ryzen

Игра не использует мультитрейдинг на процессорах не от Интел, из-за чего происходит недозагрузка процессора и появляются боттлнеки процессором там, где их не должно.

66 показов
23K23K открытий
11 репост

Копипаста u/patx35.

Вкратце: ошибка появилась из-за маркетинга АМД, которая позиционировала свои 4-х-ядерные процессоры с 8 потоками как 8-ми-ядерные и пыталась скрыть это от проверок программами.

Код пытается вычислить точное количество потоков и делает поправку на эту особенность АМД. Но в новой серии Ryzen, они это поправили, что и приводит к ошибке.
 
Original:

Here's an ELI15 version of this: Below is the original core thread count check

DWORD cores, logical;
getProcessorCount(cores, logical);
DWORD count = cores;
char vendor[13];
getCpuidVendor(vendor);
if ((0 == strcmp(vendor, "AuthenticAMD")) && (0x15 == getCpuidFamily())) {
// AMD "Bulldozer" family microarchitecture
count = logical;
Here's a bit of background. Back when AMD used to sell FX series CPUs, they have come under fire for mismarketing their products. The issue was that their "8-core" CPUs is very misleading and should've been marketed as 4-core 8 thread CPUs, or 4-core with hyperthreading CPUs. Same with other core count variations. The other issue was that they tried to hide the fact from software, which meant that when programs tried to check how many cores and threads the CPU has, it would misreport as having "8-cores 8-threads" instead of "4-cores 8-threads" (assuming our "8-core" CPU example). The code check is a lazy way to see if an AMD CPU is installed and to adjust the core count accordingly. However, AMD remedied the issue on the Ryzen series CPUs.

However, on Sep 27, 2017, the following changes was implemented

DWORD cores, logical;
getProcessorCount(cores, logical);
DWORD count = logical;
char vendor[13];
getCpuidVendor(vendor);
if (0 == strcmp(vendor, "AuthenticAMD")) {
if (0x15 == getCpuidFamily()) {
// AMD "Bulldozer" family microarchitecture
count = logical;
}
else {
count = cores;
}
}
Basically, instead of treating all AMD CPUs as a FX CPU, it would first check if an AMD CPU is installed, then check if a FX CPU is installed if an AMD CPU is detected, and adjust the core count calculation if a FX CPU is detected.

EDIT: I'm pretty tired, and both the original and updated code seems mostly fine at first glance, but now looks weird and very wrong now that I've reread it. So the original code first calculates the number of threads by checking how many cores the CPU reports. Then if it detects an AMD CPU, and it detects that it's a FX CPU, it would calculate the number of threads by how many threads the CPU reports. So if a 4-core 8-thread Intel CPU is installed, then it would report "4" as the number of threads. If a 4-core 8-thread AMD Ryzen CPU is installed, then it would report "4" as the number of threads. If an "8-core" AMD FX CPU is installed, it would report "8" as the number of threads.

Now here's the weirder part. The new code calculates the number of threads by checking the reported thread count. Then it would check if an AMD CPU is installed. If an AMD CPU is installed, it would then check if a FX CPU is installed. If it's both an AMD and FX, it would use the thread count that the CPU reports (which is identical to Intel, despite FX CPUs misreporting) If it's an AMD CPU, but not a FX CPU (so CPUs like Ryzen), it use the reported core count to count the number of threads (which is also incorrect because Ryzen properly reports thread count if I am correct). So on the new code, if a 4-core 8-thread Intel CPU is installed, then it would report "8" as the number of threads. if a 4-core 8-thread AMD Ryzen CPU is installed, then it would report "4" as the number of threads. If an "8-core" AMD FX CPU is installed, it would report "8" as the number of threads.

Now, I don't know if CD Projekt used the updated code. I'm also not saying that OP's proposed fix would hurt or improve performance. I'm giving a simpler explanation of what /u/CookiePLMonster explained.

Ответить