تتسبب مكتبة AMD في ضعف أداء وحدة المعالجة المركزية AMD في Cyberpunk 2077







بعد إصدار Cyberpunk 2077 ، لاحظ مستخدمو معالج AMD أن اللعبة لم تكن تستخدم جميع النوى المنطقية بالكامل . بدا الأمر هكذا:













« » , 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!



, , .







, :







المشاريع كبيرة جدًا لدرجة أنه غالبًا ما يُفقد الكثير ولا يتحكم المطورون فيها. يرتكب المطورون مثل هذه الأخطاء لأن الشركة لا يمكن أن يكون لديها سوى تكوينين أو ثلاثة تكوينات كمبيوتر نموذجية لاختبار لعبة ، وهم ، كما نفهم ، لا يغطيون جميع التكوينات الممكنة. بالإضافة إلى ذلك ، هناك ما يسمى بمتلازمة "أنا فقط أقوم بعملي (على قطعة صغيرة ، لكني لا أهتم بالباقي)" من الناحية النظرية ، يمكن تصحيح جميع "المياه الضحلة" من خلال أنظمة تحكم مختصة ، ولكن في سياق المتطلبات المتغيرة باستمرار والسوق ، لدينا ما لدينا.



All Articles