[SOLVED] GPU Passthrough issue: BAR 0: can't reserve


Go to solution Solved by BastiArts,

Recommended Posts

Hey guys,

since I've tried passingthrough my primary GPU (Saphire R9 280) my log gets spammed by this error:

Quote

Tower kernel: vfio-pci 0000:07:00.0: BAR 0: can't reserve [mem 0xe0000000-0xefffffff 64bit pref]

But everything is working as expected (Win10 VMs & Docker Container).
Somehow my log is getting filled up 100% and a majority of the entries are like:

Quote

Nov 27 15:53:37 Tower kernel: vfio-pci 0000:07:00.0: BAR 0: can't reserve [mem 0xe0000000-0xefffffff 64bit pref]
### [PREVIOUS LINE REPEATED 900803 TIMES] ###

And if I try to view the syslog via the 'tools' navigation, this error showed up:

Quote

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 4096 bytes) in /usr/local/emhttp/plugins/dynamix/include/Syslog.php on line 20

 

Does anyone have an idea how I could fix this issue(s)?

I tried adding 'video=efifb:off' to the flash's syslinux.cfg but it still occurs.

Unraid Version: 6.9.0-beta35


Diagnostics are attached below.


Kind regards,
Basti

tower-diagnostics-20201128-1721.zip

Link to comment
  • 2 weeks later...
  • Solution

I finally found a fix, that works with my machine!

I added the following code to the /flash/config/go file:

#fix video for VM
echo 0 > /sys/class/vtconsole/vtcon0/bind
echo 0 > /sys/class/vtconsole/vtcon1/bind
echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind

Those lines unbind the console & by adding it to /flash/config/go will execute this piece of code on every boot of the system.

  • Like 4
  • Thanks 9
Link to comment
  • JorgeB changed the title to [SOLVED] GPU Passthrough issue: BAR 0: can't reserve
  • 3 months later...
On 12/13/2020 at 3:16 PM, BastiArts said:

I finally found a fix, that works with my machine!

tx, with this fix I was able to make passthrough work my AMD R9 280X, even used as primary GPU without any additional GPU in my system

  • Like 1
Link to comment
  • 2 months later...
52 minutes ago, anthem221 said:

like that?

#!/bin/bash
# Start the Management Utility
/usr/local/sbin/emhttp &
#fix video for VM
echo 0 > /sys/class/vtconsole/vtcon0/bind
echo 0 > /sys/class/vtconsole/vtcon1/bind
echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind

 

Exactly :)

Link to comment
  • 2 months later...
echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind

 

effectively unbinds efifb from being loaded and stealing the memory at the time of issuing the command, preventing the gpu to be active for the vm to which the gpu is passed through.

An alternative is to not load at all efifb with the boot arg:

video=efifb:off

 

But this will prevent you from reading the output when the host is loading.

 

In real this is not a general solution for the error:

kernel: vfio-pci 0000:07:00.0: BAR 0: can't reserve [mem 0xaaaaaaaaa-0xbbbbbbbb 64bit pref]

 

This is valid for oses booting with uefi, however, for example, if the os is booted with legacy bios efifb will not load, instead vesafb will be loaded.

 

A general approach to this is to look at what is preventing the memory to be mapped: we can do this in the host terminal, by looking at the output of:

cat /proc/iomem

 

We will see the memory regions together with what is using that range (0xaaaaaaaaa-0xbbbbbbbb in this example), so we can disable what is needed.

Edited by ghost82
  • Like 2
Link to comment
  • 2 months later...
On 12/13/2020 at 4:16 PM, BastiArts said:

I finally found a fix, that works with my machine!

I added the following code to the /flash/config/go file:

#fix video for VM
echo 0 > /sys/class/vtconsole/vtcon0/bind
echo 0 > /sys/class/vtconsole/vtcon1/bind
echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind

Those lines unbind the console & by adding it to /flash/config/go will execute this piece of code on every boot of the system.

 

2 days of retracing all of my steps, swapping out GPUs and dumping ROMs, and it was 3 simple lines of code which didn't appear in any of the 

Spaceinvader One tutorials I watched.  I don't mean to necro, but I created an account so that I could sign in, thank you, and increase visibility for this solution.

 

x570 Aorus Pro, 5900X, 2 and ONLY 2 GTX 1080s in the system each in their own Win10 VM.

  • Like 1
Link to comment
  • 2 months later...

Well call me a necromancer, because this thread's alive!  ALIVE!  ....

to thank the solution's author.  Thank you.  I know I chose the path of pain despite Unraid being an excellent product, but it was discouraging to have extracted the rom, done this & that, and periodically get stuck with a resolution that would have wowed me only in my childhood.

  • Like 1
Link to comment
  • 1 month later...

I'm just another lost soul who found your post and it worked perfectly, i wanted to say thank you! Add me to the list of fools who spent HOURS trying to fix this themselves - unsuccessfully.

 

 

On 3/26/2022 at 8:00 PM, nerbonne said:

First, thank you.

 

Secondly, I would like to point out that this file is now at /boot/config/go

depends how you're getting to it i think.

 

On 2/21/2022 at 1:07 PM, theone said:

Thanks adding these line work !!!

 

What do they actually do?

 

@ghost82 broke it down pretty well right there, i think.  

  • Thanks 1
Link to comment
  • 1 month later...
  • 1 month later...
  • 1 month later...
On 12/13/2020 at 6:16 AM, BastiArts said:

I finally found a fix, that works with my machine!

I added the following code to the /flash/config/go file:

#fix video for VM
echo 0 > /sys/class/vtconsole/vtcon0/bind
echo 0 > /sys/class/vtconsole/vtcon1/bind
echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind

Those lines unbind the console & by adding it to /flash/config/go will execute this piece of code on every boot of the system.

This saved me after countless hours of searching for a fix and tinkering... My VM's stopped working out of nowhere and this was the solution to get them back up and running. I would get errors when trying to start my VM's and my log was 100% full (due to the VM errors spamming the syslog).

 

I know this is a fix, but what is the underlying issue that is causing this? Something seems very broken for this to just happen randomly...

Link to comment
  • 3 months later...
On 12/13/2020 at 4:16 PM, BastiArts said:

I finally found a fix, that works with my machine!

I added the following code to the /flash/config/go file:

#fix video for VM
echo 0 > /sys/class/vtconsole/vtcon0/bind
echo 0 > /sys/class/vtconsole/vtcon1/bind
echo efi-framebuffer.0 > /sys/bus/platform/drivers/efi-framebuffer/unbind

Those lines unbind the console & by adding it to /flash/config/go will execute this piece of code on every boot of the system.

Many many thanks @BastiArts !!!

I am trying Unraid on an MSI B450 Tomahawk w a Ryzen 3600, and GPU passthrough of an GTX 1080Ti Founders Ed. was a nightmate, so much that I was on my way to Proxmox. I found your tip just as a last attempt.

 

And I have literraly tried any other solution and video for days... One at a time, combined...

In Proxmox it took me like 4-5 mins to Passthrough a Win10 system complete w NVME & GPU. Yet Unraid has other goodies...

 

again Many many Thanks!!!, may you be blessed for eternity :D

 

I come to add that XML editing has not been necessary for me since the fix. I checked the XML file and I don't use the extra code. Then again after passing through another audio card (extra) all worked nice and smoothly :)

Edited by apostolos55
  • Like 1
Link to comment
  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.