How can I detect the current RAM config? I need to ask windows about if the RAM is currently running in single, dual or quad channel.
I have searched a lot, and not found any similar questions on this or other sites, which is quite surprising to me.
I'm working with C++
, but this question really applies to all programming languages the same way since it's about what windows function or powershell
/cmd
command will give me the info I need.
You would want your RAM modules on the same number which should also be the same color. For example, installing RAM modules on A1 and B1 will enable dual-channel mode as well as A2 and B2. However, installing them in A1 and A2 will make them run in single-channel mode.
InterleavePosition
is what you're looking for though. One came up as 2,2,2
because it's running 3 sticks in dual channel. What you need to find out is how to identify a machine running single-channel so that you can use the output of this command:
wmic memorychip get InterleavePosition
Edit: Actually not sure about the dual channel with 3 sticks. Some research suggests most motherboard nowadays will make the odd one out single channel.
So from the MSDN, this is what we have to work with in terms of digging up system info about interleaved memory.
Position of the physical memory in an interleave. For example, in a 2:1 interleave, a value of "1" indicates that the memory is in the "even" position.
This property is inherited from CIM_PhysicalMemory.
0 - Noninterleaved
1 - First position
2 - Second position
Plus InterleaveDataDepth
which says this:
InterleaveDataDepth
Unsigned 16-bit integer maximum number of consecutive rows of data that are accessed in a single interleaved transfer from the memory device. If the value is 0 (zero), the memory is not interleaved.
Mind you, interleave is a fancy word for "share mutually" which is similar to multi-channel nowadays but it's not the same thing. From wiki on interleaved memory:
It is different from multi-channel memory architectures, primarily as interleaved memory is not adding more channels between the main memory and the memory controller. However, channel interleaving is also possible...[]
Using this, I'll share what it looks like to have 4 RAM sticks in dual channel using cmd.exe:
Edit: Several people have confirmed these values work just fine on some machines but too often return puzzling/nonsense values.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With