echo 'device_specific' >"/sys/bus/pci/devices/0000:1c:00.0/reset_method"
only works (and is only necessary for) kernel 5.15. If you are using 5.13, you can ignore this line and/or this error.
Your error aboutecho "0000:1c:00.0" > "/sys/bus/pci/devices/0000:1c:00.0/driver/unbind"
indicated that amdgpu is not loaded for the GPU, which is essential for my solution. This indicates that you are not doing the same thing as I do. You can check is amdgpu is loaded for the GPU usinglspci -ks 1c:00.0
.
Please note that my setup fixed a different error thanFailed to mmap 0000:1c:00.0 BAR 0. Performance may be slow
. For me, it fixedBAR 0 cannot reserve memory
(or something), which only occurs with kernel 5.15. Maybe I misunderstood your question and/or original problem, and my solution won't help you at all. Or you need to switch to the latest pve-kernel-5.15 and make sure amdgpu is used before running the script (and vendor-reset needs to be installed).
amdgpu seems to be loading and I am on kernel 5.15. See below:
Code:
root@pve:~# lspci -ks 1c:00.0
1c:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Ellesmere [Radeon RX 470/480/570/570X/580/580X/590] (rev e7)
Subsystem: Micro-Star International Co., Ltd. [MSI] Radeon RX 580 Armor 4G OC
Kernel modules: amdgpu
root@pve:~# sh /var/lib/vz/snippets/gpu-hookscript.sh
/var/lib/vz/snippets/gpu-hookscript.sh: 4: echo: echo: I/O error
/var/lib/vz/snippets/gpu-hookscript.sh: 6: cannot create /sys/bus/pci/devices/0000:1c:00.0/driver/unbind: Directory nonexistent
root@pve:~# uname -a
Linux pve 5.15.35-1-pve #1 SMP PVE 5.15.35-3 (Wed, 11 May 2022 07:57:51 +0200) x86_64 GNU/Linux
root@pve:~#
I guess its different for the RX580. I can revert the changes and go back to 5.13 if necessary. I wonder if they will fix this for 5.15+