Skip to content
View in the app

A better way to browse. Learn more.

Unraid

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

VM GPU passthrough resizable BAR support in 6.1 kernel

Featured Replies

i have Clever Access Memory enabled in bios and have done all the steps outlined in this post, but still in my VM it says that reBAR is not enabled in bios. I'm stumped.

 

image.thumb.png.3047070924d8cb1e313fe39ac81c85b4.png

On 6/6/2024 at 1:50 PM, Salty2011 said:

Howdy All

 

After reading all the posts, I now have my 6900XT passing through and in GPU-Z it says resize bar is enabled. With that said there are the following issues i am getting:

  • For AMD if you open up the AMD Driver console and view the Smart Access Memory status under "Smart Technology" it says unsupported. Not sure if this is just an AMD / VM bug and its safe to ignore
  • For the user script that creates the resizebar resource (in this guide below) i get the following error
    image.thumb.png.abd357c562095e359241370e7f7040f8.png
    Not sure why when rebinding the device its saying it exist despite it being unbound in the beginning. If anyone can shed some like on this will be appreciated and I will update this post

 

Now for everyone else, this is what I did in order to get it working to this point

 

PreRequisits

  • In the BIOS make sure you have these enabled
    • AMD-V or Intel VT-d
    • SR-IOV
    • Enable Above 4G Decoding
    • Do not enable Resize BAR
  • Unraid
    • Ensure you have community app installed
    • Ensure you have the user scripts plugin

In the UNRAID WebUI you will need to ensure that you have bound the gfx card to vfio so that unraid doesnt reserve it preventing the card from being used. (I am using UNRAID 6.12.10) To do this:

  1. Goto Tools > System Devices
  2. Check all the PCI devices that are you graphics card. Not a Graphics card can be listed as multiple devices, In the example below the 6900XT has 4 devices
    image.thumb.png.f7d4a6c61586356b2d908e06ce491be9.png

In the pic above I have highlighted two things that you will need to note for later

- GPU Address ( thats the 0a:00.0)

- GPU ID ( thats the 1002:73bf)

Yours will be different to the ones I have listed so make sure to note your down.

 

Additionally note i ticked serval devices that all share the same address space of 0a:00.x, x being .0 /1 /2/3. For your setup make sure you have ticked all other devices in the same address space. Youll notice the descriptions will also loosely correlate.

 

When done scroll to the bottom and click "BIND SELECTED DEVICES TO VFIO AT BOOT", you will then need to reboot the server before continuing.

 

Initial Steps

  1. Create a normal Windows 11 VM, do not pass any additional hardware
  2. Go through the standard Windows Install
  3. Perform all updates as Microsoft suck and don't update there ISO and AMD and Likely NVIDIA drivers will need some of the latest updates for these to even install
  4. Download the latest full install of either nvidia or amd (do not use the autodetect installed, this can act weird). do not install at this time. that will come later
  5. Show down the machine when done

GPU Passthrough - No Resize BAR

Do this first just to ensure its all working without ReSize BAR enabled on the VM

  1. In Unraid now go edit your VM
  2. In Form view make the following changes, 
  3. Add a second GPU, set the sound card to be the GPU
  4. For AMD and maybe NVIDIA check "other pci deivces" and attached the additional devices related to the card. For example the 6900XT with show as 4 devices, the GPU, Sound and two USB device/controller.
  5. Save configuration
  6. Boot up VM and use the VNC console. Check that you see you gpu in device manager (it may have error 43, this is ok ignore it)
  7. Now install your GPU drivers and restart the vm
  8. Load up some games and test card is working within expectations (not its a VM so wont get exact performance.. well at least not without some additional tuning)
  9. If this all working, congrats you have working GPU passthrough and now for the fun of getting ReSize bar working

Getting ResizeBAR Working
 

Switch back to the unraid webui for now

  1. Reboot unraid server and enable ReSize BAR and Above 4G decode in BIOS
  2. Now open the unraid console
  3. Open up user scripts
  4. Create a new User Script and schedule it to run on array start.
  5. Add the following script, take note that you will need to alter the GPU, GPU_ID and VRAM for the card your passing through. As the beginning of this post these were the values we noted down.

    ##### NOTE #####
    The script I have written below will select the correct bit size for your card vram, determine which GPU (AMD/NVIDIA) based on the gpu address and then set the resize values accordingly. For AMD cards resource2_resize needs to be less than 8MB for windows to boot, else you get black screen, this doesnt seem to apply to nvidia gpu's based on what I could find. I discovered the AMD resource2_resize trick over here and they have a good article explaining the setup.
     VFIO: How to enable Resizeable BAR (ReBAR) in your VFIO Virtual Machine

    REPO: https://github.com/salty2011/unraid-userscsripts
     
    #!/bin/bash
    
    # User-configurable variables
    GPU=0000:0a:00.0                    # GPU PCI address
    GPU_ID="1002 73bf"                  # GPU ID for re-binding
    VRAM_SIZE="16GB"                    # Set VRAM size based on your GPU
    
    # Define a function to determine the bit size for rebar based on VRAM size
    function get_rebar_size {
        local vram_size=$1
        case $vram_size in
            "2MB") echo 1 ;;
            "4MB") echo 2 ;;
            "8MB") echo 3 ;;
            "16MB") echo 4 ;;
            "32MB") echo 5 ;;
            "64MB") echo 6 ;;
            "128MB") echo 7 ;;
            "256MB") echo 8 ;;
            "512MB") echo 9 ;;
            "1GB") echo 10 ;;
            "2GB") echo 11 ;;
            "4GB") echo 12 ;;
            "8GB") echo 13 ;;
            "16GB") echo 14 ;;
            "32GB") echo 15 ;;
            *) echo "Unsupported VRAM size: $vram_size"; exit 1 ;;
        esac
    }
    
    # Use lspci to check the GPU manufacturer
    MANUFACTURER=$(lspci -v -s ${GPU} | grep 'VGA compatible controller')
    
    # Unbind GPU from vfio-pci driver
    echo "Unbinding GPU from vfio-pci driver..."
    echo ${GPU} > /sys/bus/pci/drivers/vfio-pci/unbind
    sleep 1
    
    # Get the correct rebar size bit value
    REBAR_SIZE=$(get_rebar_size $VRAM_SIZE)
    
    # Check if the GPU is from AMD or NVIDIA and apply settings accordingly
    if echo "${MANUFACTURER}" | grep -q "NVIDIA"; then
        echo "Detected NVIDIA GPU. Applying NVIDIA-specific settings..."
        echo "Setting the rebar size to $VRAM_SIZE"
        if ! echo $REBAR_SIZE > /sys/bus/pci/devices/${GPU}/resource1_resize; then
            echo "Failed to set rebar size. Please check if the VRAM size variable ($VRAM_SIZE) is correct for your GPU."
            exit 1
        fi
    elif echo "${MANUFACTURER}" | grep -q "AMD"; then
        echo "Detected AMD GPU. Applying AMD-specific settings..."
        echo "Setting the rebar 0 size to $VRAM_SIZE"
        if ! echo $REBAR_SIZE > /sys/bus/pci/devices/${GPU}/resource0_resize; then
            echo "Failed to set rebar 0 size. Please check if the VRAM size variable ($VRAM_SIZE) is correct for your GPU."
            exit 1
        fi
        echo "Setting the rebar 2 size to 8MB"
        if ! echo 3 > /sys/bus/pci/devices/${GPU}/resource2_resize; then
            echo "Failed to set rebar 2 size to 8MB."
            exit 1
        fi
    else
        echo "GPU manufacturer not recognized. Exiting script."
        exit 1
    fi
    
    # Wait for settings to apply
    sleep 2
    
    # Re-bind GPU
    echo ${GPU_ID} > /sys/bus/pci/drivers/vfio-pci/new_id || echo -n "${GPU}" > /sys/bus/pci/drivers/vfio-pci/bind
    echo "Configuration complete."
    sleep 1
    

     

  6. Restart your UNRAID Server so that this script runs and were ready for next step
  7. To check if the script applied the setting you can lspci -vvvs  GPU (eg 0a:00.0) | grep "BAR"
    image.png.73b123f2e4283fe7a9f3a51021feb208.png
    Importantly for AMD card BAR2 is 8MB, for me it was defaulting to 265MB and this stops windows from booting.
     
  8. Edit the VM and remove the Virtual Graphics card and ensure the only gpu is the card you are wanting to pass through
  9. switch to XML View. At the top, line 2 you will need to edit <domain type='kvm'> to be
    <domain type='kvm' xmlns:qemu='http://libvirt.org/schemas/domain/qemu/1.0'>
  10. Scroll to the bottom of the XML code and above where it says </domain> insert:
      <qemu:commandline>
        <qemu:arg value='-fw_cfg'/>
        <qemu:arg value='opt/ovmf/X-PciMmio64Mb,string=65536'/>
      </qemu:commandline>
  11. Click update configuration
  12. Boot the VM (make sure a Monitor is connected to the passthrough GPU), you should see Windows boot up to the desktop
  13. Download GPU-Z, run it and on the main screen ResizeBAR should say enabled. or check the GPU in device manager and you see large memory allocation

 

NOTES

For the AMD card I have both Device Manager and GPU-Z say resize bar is enabled. However in the AMD Driver under Smart Technology I am seeing Smart Access Memory as unsupported. Not sure if this a quirk or something else. but if anyone knows let me know.

As for the script.. i take no responsibility for any issues it causes, ive tested on my setup and it works. happy to make some amendments if other bugs occurs.

image.png

 

  • Replies 81
  • Views 62.8k
  • Created
  • Last Reply

Top Posters In This Topic

Most Popular Posts

  • I was curious so I did a few benchmarks passing all 32 cores/threads to the VM.   Forza Horizon 5 1440p Extreme (No DLSS) VM Rebar OFF 20cpu: 116 fps VM Rebar ON 20cpu: 129 fps

  • The patch allows you to manipulate the bar size through sysfs. See the example how to use it in this reddit post.   This is the User Script I created to set the bar size to 16GB. You would o

  • I back ported the resizable bar patch to unraid 6.11.5 (kernel 5.19.17). It applies and builds cleanly with the other unraid patches and unraid .config file. I attached the patch and a precompiled ker

Posted Images

nevermind im an idiot. I forgot to update the gpu firmware.

  • 6 months later...

Does this work with the intel arc cards? Tried searching around and I dont see or am missing the threads on intel arc.

GPU-Z Shows everything is enabled but the gpu is unsupported for resize bar.

  • 1 month later...
On 9/4/2025 at 2:58 AM, zac_ary said:

Does this work with the intel arc cards? Tried searching around and I dont see or am missing the threads on intel arc.

GPU-Z Shows everything is enabled but the gpu is unsupported for resize bar.

I too would like to know. I have an Intel Arc A310 Omni.

  • 1 month later...

Thanks to @Salty2011 's script, I am happy to report ReBAR is successfully enabled in Win11 VM.

@Salty2011 , for linux VM, does it need the xml edits? Or those edits are only for Windows VM?

Platform:

Unraid: 7.2

CPU: AMD Ryzen 9 5900x

Motherboard: MSI B550 Gaming Plus

GPU: AMD RX 6800 XT

Edited by jfoxwoosh

  • 2 months later...

I'm also running with a Windows 11 VM with Intel Arc B580 and unable to get resizeable BAR working. proper settings and latest motherboard BIOS. i unplugged my array, cache drives and unraid stick and booted from a blank hard drive and did a new windows install and it did work, so not a hardware or bios issue, just something i'm missing in unraid. screenshot below from windows 11 VM.

image.png

On 2/13/2026 at 11:42 PM, Goulag said:

I'm also running with a Windows 11 VM with Intel Arc B580 and unable to get resizeable BAR working. proper settings and latest motherboard BIOS. i unplugged my array, cache drives and unraid stick and booted from a blank hard drive and did a new windows install and it did work, so not a hardware or bios issue, just something i'm missing in unraid. screenshot below from windows 11 VM.

image.png

i'm running Unraid 7.2.3 and not using the script

image.png

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...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.