I just wanted to note this down for reference, it may help some of you also.
Adding some NVME drives to a VM using the 'Add PCI Device' option can crash Proxmox.
For example the Samsung 960 Pro drive I had this problem with, other drives were fine.
With help from chatgpt it seemed to indicate the issue was with the drive not supporting FLR (Function Level Reset).
I also saw sometimes in the log "Unable to read tail got zero bytes" when trying to start the VM.
These are the steps which resolved it for me to allow the Samsung 960 Pro to be used with the 'Add PCI Option'.
VFIO override quirk to tell VFIO not to reset the device
Blacklist the normal NVMe driver so VFIO grabs the device early:
Bind the device to VFIO:

Adding some NVME drives to a VM using the 'Add PCI Device' option can crash Proxmox.
For example the Samsung 960 Pro drive I had this problem with, other drives were fine.
With help from chatgpt it seemed to indicate the issue was with the drive not supporting FLR (Function Level Reset).
I also saw sometimes in the log "Unable to read tail got zero bytes" when trying to start the VM.
These are the steps which resolved it for me to allow the Samsung 960 Pro to be used with the 'Add PCI Option'.
VFIO override quirk to tell VFIO not to reset the device
Code:
nano /etc/modprobe.d/vfio.conf
# Add
options vfio-pci disable_vga=1 disable_idle_d3=1
Blacklist the normal NVMe driver so VFIO grabs the device early:
Code:
nano /etc/modprobe.d/blacklist.conf
# Add
blacklist nvme
Bind the device to VFIO:
Code:
lspci -nn | grep -i nvme
# 01:00.0 Non-Volatile memory controller [0108]: Samsung Electronics Co Ltd NVMe SSD Controller SM961/PM961/SM963
# [144d:a804]
nano /etc/modprobe.d/vfio-pci.conf
# Add YOUR OWN VID:PID
options vfio-pci ids=144d:a804
Code:
update-initramfs -u
reboot

Last edited: