3 ms·
this may not be an error. i’m doing high performance gamedev on a 7950x with smt off. 16 cores. i can only use 8 to run the game. mutex and other synchroniza
by nathants 3y ago
this may not be an error.
i’m doing high performance gamedev on a 7950x with smt off. 16 cores.
i can only use 8 to run the game.
mutex and other synchronization gets highly variable latency if the first 8 cores try to talk to the second 8.
i hadn’t heard of this before i started this game, but apparently it’s well known, and nobody makes a chip with more than 8 cores that can have low variability synchronization.
linux running on 8 cores seems like a potentially good idea. one wants the kernel to have low latency with low variability.
- dannyw 3y agoYou’re describing behaviour with AMD’s Infinity Fabric, which groups cores into CCDs of 8 on 7000 series chips. Essentially, a 16 core AMD CPU is actually two separate 8 core CPUs glued together with a link. Intel does not have this limitation.
- nathants 3y agoyeah? a xeon with 16 cores might have to be my next pc. pricey though.
- archi42 3y agoYou can try to make your code aware of the situation and distribute the tasks accordingly. IIRC that's what people do on NUMA systems.
- nathants 3y agoafaik not for my use case. i need low latency with no variability. you only get that staying within a single cpu cluster.
- archi42 3y agoIt's not possible for every workload, and sometimes the necessary effort makes it infeasible. Getting a Xeon might be the cheaper option then ;-) Edit: Though I'd still recommend heeding menaerus excellent sibling answer. Maybe not for this project, but it is great knowledge to have in your domain and I'd expect it to be relevant for the future.
- menaerus 3y agoThis all comes down to the cache coherency protocols. And it's not surprising that you see increased latency with zen4 microarchitecture because, as one of the parent commenters already said, it's almost as if you're running a NUMA architecture within a single physical chip. When dealing with NUMA we know that cross-socket, or in this case cross-CCD, latencies are always higher than the ones within the same socket or same CCD. Usually multi-fold. This article nicely lists the core-to-core latencies between the Intel and AMD microarchitectures: https://chipsandcheese.com/2023/07/17/genoa-x-server-v-cache-round-2/ https://chipsandcheese.com/2023/07/17/genoa-x-server-v-cache... So, if you're able to somehow take advantage of this knowledge in your code (e.g. by scheduling less latency-sensitive tasks to the other CCD), you may be able to improve your overall performance.
- mwpmaybe 3y agoIt makes Ryzen 9 processers great for budget VFIO workstations because you can run an OS (either host and guest or two guests) on each CCD.
- sliken 3y agoI have the 7900 (non-x), I find it helpful to think of it as a dual socket 6 core system. For latency sensitive things like many games, it's best to pin it to a single socket/half the cores. Once you do that the other half can handle everything else. That way jitter stays low, performance is consistent, caches are warm, etc.
- nathants 3y agoi’m pleased with 7950x, it was just a surprise. when benchmarking the game engine, massive latency variance due to background jobs using all cores. when i compile, all 16 cores are used. when playing, core0 is main thread, core1 is physx, core2 is network, core3-7 are background jobs used by main thread. i’m not sure more than 8 cpu cores can be meaningfully used by any current game engine tech. when i run the server locally, i reduce usage to 4 cores so client and server don’t contend. not much impact.