Skip to content

Instantly share code, notes, and snippets.

@nissel
Last active November 12, 2024 04:36
Show Gist options
  • Save nissel/48ac68a245c4f3e80ff2257f869ac8f6 to your computer and use it in GitHub Desktop.
Save nissel/48ac68a245c4f3e80ff2257f869ac8f6 to your computer and use it in GitHub Desktop.
Windows 11 Reg fix for SN770, SN580 (and other) HMB force to 64M
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorPort]
"HMBAllocationPolicy"=dword:00000002
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\stornvme\Parameters\Device]
"HostMemoryBufferBytes"=hex(7):56,00,45,00,4e,00,5f,00,31,00,35,00,42,00,37,00,\
26,00,44,00,45,00,56,00,5f,00,35,00,30,00,31,00,37,00,26,00,52,00,45,00,56,\
00,5f,00,3f,00,3f,00,20,00,36,00,37,00,31,00,30,00,38,00,38,00,36,00,34,00,\
00,00,56,00,45,00,4e,00,5f,00,31,00,35,00,42,00,37,00,26,00,44,00,45,00,56,\
00,5f,00,35,00,30,00,34,00,31,00,26,00,52,00,45,00,56,00,5f,00,3f,00,3f,00,\
20,00,36,00,37,00,31,00,30,00,38,00,38,00,36,00,34,00,00,00,00,00
@SarpeTronic
Copy link

I use the WD 2 TB (NVMe____WD_Blue_SN580_2T4) device as replikation targret on Hyper-V. After Windows report a cotroller error and IO problem it switches the storage of, to prevent further damage. After reboot the drive worked normal for several hours.
I testet before dword "0", it was stable for ca. 2 days, than I switched to "2"
It kept my drive stabil for 2 or 3 days. Than it appeared once again, since reboot 20h stable.

@nissel
Copy link
Author

nissel commented Oct 16, 2024

@SarpeTronic Did you actually use this file? You need the HostMemoryBufferBytes entry too if you are using HMBAllocationPolicy 2

@SarpeTronic
Copy link

SarpeTronic commented Oct 16, 2024

Did you actually use this file? You need the HostMemoryBufferBytes entry too if you are using HMBAllocationPolicy 2
No, I made the entry a few days before maually
image

@nissel
Copy link
Author

nissel commented Oct 16, 2024

@SarpeTronic did you make the HostMemoryBufferBytes entry too? Did you check your device id is DEV_5041?

@SarpeTronic
Copy link

I hadn't set HostMemoryBufferBytes, I set it today at noon.

This should be the right ID: PCI\VEN_15B7&DEV_5041&SUBSYS_504115B7&REV_01
Hardware ID: SCSI\DiskNVMe___________________________WD_Blue_SN580_2TB281040WD

@nissel
Copy link
Author

nissel commented Oct 16, 2024

Ok not surprised it was still crashing then. HMBAllocationPolicy 2 just means maximum size, the HostMemoryBufferBytes sets the max to 64MB for the sn770 and sn580 device IDs.

@SarpeTronic
Copy link

At least HostMemoryBufferByte =2 it kept the system stable for a few days.

I had the Information that:

0=off
1= 8
2 = 64
3 = firmware controled

NVME Host Memory Buffer reporting?? | HWiNFO® Forum

Now I'll watch what happens the next days

@nissel
Copy link
Author

nissel commented Oct 16, 2024

No that's not the case, at least not anymore in 24H2

0 = disabled
1 = minimum (specified by device firmware)
2 = maximum (specified by device firmware, up to 1GB or 1/16 of system ram. In older version of windows 64MB was the max)
3 = some kind of automatic device demand mode, it's not very clear.

You can check the min and max your drives firmware is requesting as well as the actual buffer size with the "NVME HMB info” tool from http://vlo.name:3000/ssdtool/

For my sn770 the minimum is 3MB and max is 200MB, but it looks like the max doesn't actually work. So this reg file reinstates the old 64MB limit.

@SarpeTronic
Copy link

NVME SSD HMB Info v0.21a by Ochkin Vadim
0: (SanDisk SD9SB8W128G1001
1: (WD Blue SN580 2TB
Please select drive number:1
DiskName: \.\PhysicalDrive1
ScsiName: \.\SCSI2:
Disk: WD Blue SN580 2TB
FW : 281040WD

Idenify info:
Namespaces : 1
HMB Preffered Size: 204800 KB
HMB Minimum Size : 3292 KB
Unalloc capacity : 0 MB

HMB info:
HMB : Enabled
HMB Size : 64 M
DescriptorListAdr: 0x00000001:377fa000
Entries : 1

@nissel
Copy link
Author

nissel commented Oct 16, 2024

At 64MB you should be fine then, if you still have issues I guess you have a different problem. This patch is to help people on 24H2 and 200MB allocated.

@SarpeTronic
Copy link

I run Server 2025, it's affectet too, as it's also 24/H2

@nissel
Copy link
Author

nissel commented Oct 17, 2024

Western Digital has released a firmware update that limits HMB to 64MB and potentially other fixes, that should be used and not this anymore.

@ZolKush
Copy link

ZolKush commented Oct 17, 2024

Western Digital has released a firmware update that limits HMB to 64MB and potentially other fixes, that should be used and not this anymore.

Can you tell me if I need to delete the registry entry before putting this update?

@nissel
Copy link
Author

nissel commented Oct 17, 2024

I applied the firmware update, then removed the reg changes with https://gist.github.com/nissel/a20a6ca5f8aeb8802554f239a28833bd then rebooted

But they aren't going to interact in any strange way, the firmware patch appears to just limit the buffer to 64MB so fixes the issue in exactly the same way.

I wouldn't want to install a firmware update in a system that's crashing randomly, as if it did crash during the update that would probably be very bad. So id say it's best to leave the reg changes there until you update the firmware.

@ZolKush
Copy link

ZolKush commented Oct 17, 2024

I applied the firmware update, then removed the reg changes with https://gist.github.com/nissel/a20a6ca5f8aeb8802554f239a28833bd then rebooted

But they aren't going to interact in any strange way, the firmware patch appears to just limit the buffer to 64MB so fixes the issue in exactly the same way.

I wouldn't want to install a firmware update in a system that's crashing randomly, as if it did crash during the update that would probably be very bad. So id say it's best to leave the reg changes there until you update the firmware.

Well I wouldn't install an update on a system that could shut down at any moment either :). If you modify the registry, the changes are applied only after a reboot. But I'll do as you said anyway. Thanks!

@flowerdealer
Copy link

Anyone know what these values should be for an sn550 drive? I've also been affected by BSOD but no firmware update. New HWinfo update reports 200mb hmb even if it set all variables.

@ZolKush
Copy link

ZolKush commented Oct 22, 2024

Anyone know what these values should be for an sn550 drive? I've also been affected by BSOD but no firmware update. New HWinfo update reports 200mb hmb even if it set all variables.

Just try to disable HMB, setting the limit didn't help me initially either, although I have an SN770

@DemoJameson
Copy link

Anyone know what these values should be for an sn550 drive? I've also been affected by BSOD but no firmware update. New HWinfo update reports 200mb hmb even if it set all variables.

check the device manager
image

@flowerdealer
Copy link

Thanks, value that worked for the sn550 if anyone else is interested is:
VEN_15B7&DEV_5009&REV_?? 67108864

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment