fastfetch icon indicating copy to clipboard operation
fastfetch copied to clipboard

[FEAT] Detect more information about RAM memory.

Open Null-Ping opened this issue 1 year ago • 2 comments

Wanted features:

Detect and add more information about RAM memory, like:

  • Memory type: DDR3, LPDDR3, DDR4, LPDDR4, DDR5, LPDDR5, and others,
  • Configured speed: for example, 2400 MHz, 3200 MHz,
  • Form factor: DIMM, SODIMM, MiniDIMM, MicroDIMM, soldered to the motherboard,
  • Brand(s)/manufacturer(s): Samsung, SK Hynix, Micron, Crucial, Corasair, others and mixed configurations,
  • Rank: single, dual, or quad,
  • Is ECC available,
  • Is dual channel being used,
  • Number of slots available,
  • Number of slots used and capacities for each of them,
  • Voltage,
  • Part number,
  • Other info.

The list is sorted from the most to the least important ones, in my opinion.

Motivation:

Fastfetch displays a lot of useful and interesting information about the CPU, GPU(s), display(s), and other hardware, but it feels to me like it is missing basic information about memory, like its speed and DDR type. Adding it would make Fastfetch more complete and its output more useful (since, for example, 16 GB of RAM can differ as much as DDR3 1600MHz and DDR5 4800MHz).

Null-Ping avatar Apr 30 '24 12:04 Null-Ping

It's possible to grab these physical memory information from SMBIOS. However reading SMBIOS data requires root privileges other than on Windows, which make it mostly useless.

CarterLi avatar Apr 30 '24 13:04 CarterLi

Windows only is better than nothing, I believe. I'm not an expert but there might be some other ways to get the info on Linux? An alternative option would to to allow running fastfetch as admin/root for the extra info (and then optionally cache it for future non-admin runs).

ghost avatar May 05 '24 15:05 ghost

Done. Please test it with the dev build.

CarterLi avatar May 12 '24 12:05 CarterLi

Thank you! Here's the result from my machine:

{
  "type": "PhysicalMemory",
  "result": [
    {
      "size": 8589934592,
      "maxSpeed": 3200,
      "runningSpeed": 3200,
      "type": "DDR4",
      "locator": "BANK 0/DIMM 1",
      "formFactor": "SODIMM",
      "vendor": "80AD000080AD",
      "serial": "2579E6A1",
      "partNumber": "HMAA1GS6CJR6N-XN",
      "ecc": false
    },
    {
      "size": 8589934592,
      "maxSpeed": 3200,
      "runningSpeed": 3200,
      "type": "DDR4",
      "locator": "BANK 0/DIMM 2",
      "formFactor": "SODIMM",
      "vendor": "80AD000080AD",
      "serial": "24F7824B",
      "partNumber": "HMAA1GS6CJR6N-XN",
      "ecc": false
    }
  ]
}

Everything looks correct, but the vendor is displayed as this long code, is it possible to change it to the company name? (My RAM is from SK Hynix.)

ghost avatar May 12 '24 15:05 ghost

It is a string filled by OEM. For some reason they filled this code instead of SK Hynix. In my laptop the OEM did fill its name Samsung.

CarterLi avatar May 12 '24 15:05 CarterLi

Fastfetch queries the same data of https://github.com/fastfetch-cli/fastfetch/issues/812#issuecomment-2079288469

So does wmic memorychip

CarterLi avatar May 12 '24 15:05 CarterLi

I've found the meaning of the vendor codes, 0AD indeed stands for SK Hynix.

codes.json (I can send a version with 'Co. Ltd.', 'Inc.' and similar strings removed from the names for simplicity if you prefer.) I've got those from this pdf: https://www.jedec.org/standards-documents/docs/jep-106ab JEP106BJ.pdf

It looks like in '80AD000080AD':

  • I don't know what '8' stands for.
  • '0AD' stands for whole ram module brand/manufacturer - 'SK Hynix'.
  • I don't know what '00008' stands for.
  • The second '0AD' stands for ram dies manufacturer - in this case, also 'SK Hynix'.

From what I have seen on the internet, sometimes the ram manufacturer can be filled in a format like '0416', where the code is the next three digits after the first one (after the 0 in this case) (again, I don't know what the first digit stands for). Feel free to check out: https://github.com/glpi-project/glpi-inventory-plugin/issues/190 https://github.com/glpi-project/glpi/issues/12202

Also, this node.js module has some different codes, some of which have an entirely different format and are not in the codes.json file I sent (I've got no idea where did those come from): https://github.com/sebhildebrandt/systeminformation/blob/master/lib/memory.js

Feel free to use them to improve the memory manufacturers printed in fastfetch, ask for more information, or ignore this.

ghost avatar May 13 '24 09:05 ghost

https://github.com/fastfetch-cli/fastfetch/commit/56403bab5c893808f844e7797664afde90a447ec

Please test it.

CarterLi avatar May 13 '24 12:05 CarterLi

Thanks!

{
  "type": "PhysicalMemory",
  "result": [
    {
      "size": 8589934592,
      "maxSpeed": 3200,
      "runningSpeed": 3200,
      "type": "DDR4",
      "locator": "BANK 0/DIMM 1",
      "formFactor": "SODIMM",
      "vendor": "Hynix",
      "serial": "2579E6A1",
      "partNumber": "HMAA1GS6CJR6N-XN",
      "ecc": false
    },
    {
      "size": 8589934592,
      "maxSpeed": 3200,
      "runningSpeed": 3200,
      "type": "DDR4",
      "locator": "BANK 0/DIMM 2",
      "formFactor": "SODIMM",
      "vendor": "Hynix",
      "serial": "24F7824B",
      "partNumber": "HMAA1GS6CJR6N-XN",
      "ecc": false
    }
  ]
}

It is working, but I checked your code and added 3 improvements in the names, I've sent you a PR.

ghost avatar May 13 '24 13:05 ghost