AMD library causes poor AMD CPU performance in Cyberpunk 2077







After the release of Cyberpunk 2077, AMD processor users noticed that the game was not fully utilizing all logical cores. It looked like this:













« » , Intel C++, , (AMD) - SIMD. Visual Studio. , , AMD — , AMD , Bulldozer, .







AMD GPUOpen cpu-core-counts, :







// This advice is specific to AMD processors and is
// not general guidance for all processor
// manufacturers. Remember to profile!
DWORD getDefaultThreadCount() {
    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;
        }
    }
    return count;
}
      
      





, AMD, , , , . , ( ):







Ryzen SMT , . , , - .



Bulldozer . (Intel) .



, , . [ ], Ryzen : getDefaultThreadCount()



, , .


For today’s Ryzen processors with SMT enabled, we’ve found that the vast majority of multithreaded games and applications work and scale really well when managing an active thread pool up to the number of logical cores that the processor supports. However, our experience with a small number of games is that driving a hardware thread pool with more than the number of physical cores can reduce performance, primarily due to contention for available per-core resources by the multiple running hardware threads.







However, for our own prior generation of Bulldozer-based processors designs, we recommend a default thread count equal to the number of logical processor cores. Other processor vendors are encouraged to provide their own guidance to software developers. AMD does not provide guidance for other processor vendors.







Therefore no matter the processor or processor vendor, we strongly recommend that you profile your games extensively to make a decision on how to manage your thread pool for the processor designs you’ll find your game code running on. Our sample code, linked below, errs on the side of caution for our Ryzen processors and encourages you to profile: the getDefaultThreadCount() function draws attention to that fact, returning a starting default count equal to the number of physical processor cores on Ryzen.







, . , , , . , SMT , TLB, . , « », SMT, .







AMD . , , , . , (CDPR) , .







, , , , SMT . AMD , SMT . , , , .







getDefaultThreadCount()



Ryzen 5 1600 60% 85%, Ryzen 5 1400 60% 90%.







, AMD - Intel. "" AMD. , getDefaultThreadCount()



1



, AMD, Remember to profile!



, , .







, :







Projects are so large that often a lot is lost and no longer controlled by developers. Developers make such mistakes because a company can only have two or three typical computer configurations for testing a game, and they, as we understand, do not cover all the variety of possible configurations. In addition, there is a so-called syndrome “I just do my job (on a small piece, but I don’t care about the rest)”. Theoretically, all the "shoals" can be corrected by competent control schemes, but in the context of constantly changing requirements and the market, we have what we have.



All Articles