XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login
    1. Home
    2. ravenet
    3. Posts
    R Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 1
    • Posts 52
    • Groups 0

    Posts

    Recent Best Controversial
    • RE: RDNA 4 GPU Passthrough

      @PessimistTech You can try disabling ARI in your bios as a quick next step. I'm out for a few days so will attempt to assist further when I'm back if issues continue

      posted in Compute
      R
      ravenet
    • RE: RDNA 4 GPU Passthrough

      @pessimisttech interesting development — before you chase the interrupt angle any further, here's the same grep from my working rig (same GPU, xcp-ng 8.3, 38 t/s inference):

       92:          0          0          0          0          0          0          0          0 xen-pirq    -msi       amdgpu
      

      Zero. My card has never received an interrupt either. So scratch next thoughts on chasing ARI and nopv — zero GPU interrupts appears to be the normal (if ugly) state for these cards under 8.3 HVM passthrough, and everything runs on polling instead: ROCm compute completion is handled in userspace via HSA signals, and the kernel fences ride the fallback timer. That's why I see the same "Fence fallback timer expired" spam you do, permanently and harmlessly.

      The difference between our rigs is in what happens next. On mine, the fences complete and polling just notices them late. On yours, they genuinely never complete — your dmesg shows signaled seq=52, emitted seq=54 and a failed ring reset before the MODE1 reset wipes VRAM (that "VRAM is lost" line is your model evaporating while llama-server waits). Your SDMA engine is actually stalling mid-transfer, which is a different beast from a missed notification.

      With interrupts eliminated as the difference, the biggest remaining gap between our setups is the guest software stack, and it's a big one. I'm on Slowroll's stock 7.0.12 kernel with the in-tree amdgpu driver and current firmware. You're on Ubuntu's 6.8.0-134 — a kernel base from before this card existed — with AMD's DKMS 6.16.13 driver layered on top, and your boot log shows the seams: "SMU driver if version not matched" and a MES firmware version workaround note. That's roughly two years of RDNA4 enablement between our guests. I'd suspect that long before the hardware or the hypervisor.
      Two ways to test it cheaply:

      Close the gap in place: update the amdgpu firmware in your guest to current (the /lib/firmware/amdgpu files in a 6.8-era package predate this card's tuning) and move to the newest HWE kernel available. Fair warning that Ubuntu's HWE channel seems to top out well short of what I'm running, so this narrows the gap rather than closes it — but firmware alone might be enough if that's where the stall lives.

      Cleaner and probably faster: spin up a throwaway openSUSE Slowroll (or Tumbleweed) VM, attach one GPU, install docker + the same lemonade container, and run the same load. That's my exact known-good recipe, and it's a proper controlled test — same host, same BIOS, same GPU, same container, only the guest stack changes. If it works there, you've found your answer and can decide whether to migrate or keep fighting Ubuntu. If it still fails on Slowroll, then it's genuinely host-side and we've got a much sharper bug report for the Vates folks.

      @teddyastie separate from the above, a standing question whenever you have a minute: is it expected that passthrough GPU MSIs are never delivered at all on 8.3? Both my working rig and PessimistTech's broken one show the amdgpu xen-pirq MSI vector at zero on all CPUs, forever — everything survives on driver-side polling. It works, but it means any driver path that hard-depends on an interrupt has no safety net, and I suspect it's why the amdgpu ring resets in his log keep failing. Curious whether that's a known limitation of the pirq MSI path for passthrough devices or something worth a ticket.

      R

      posted in Compute
      R
      ravenet
    • RE: RDNA 4 GPU Passthrough

      @PessimistTech said:

      @ravenet
      Thanks for the ideas!

      Here's the outcome of the tests
      ps -eo pid,stat,wchan:32,cmd | grep llama:

      62 Rl   -                                /root/.cache/lemonade/bin/llamacpp/rocm-nightly/llama-server -m /root/.cache/huggingface/hub/models--unsloth--Qwen3.6-35B-A3B-GGUF/snapshots/a483e9e6cbd595906af30beda3187c2663a1118c/Qwen3.6-35B-A3B-UD-Q4_K_XL.gguf --ctx-size 262144 --port 8001 --jinja --metrics --mmproj /root/.cache/huggingface/hub/models--unsloth--Qwen3.6-35B-A3B-GGUF/snapshots/a483e9e6cbd595906af30beda3187c2663a1118c/mmproj-F16.gguf --reasoning-format auto --no-webui --temp 1.0 --top-p 0.95 --top-k 20 --min-p 0.00 --repeat-penalty 1.0 --chat-template-kwargs {"preserve_thinking":true}
      

      sudo dmesg -w | grep -iE "amdgpu|sdma|ring|fence":
      dmesgout.txt

      Same overall results... I even re-ran the same tests after removing the 2nd GPU from the PCI passthrough settings and still the same...

      I also seem to run into an issue where the GPU tends to get stuck after some of these tests. Even rebooting gets stuck waiting for llama server processes to stop and I end up having to force power off. Not sure if that is related as I get the same output on the first test, but it may be worth noting.

      found it — or at least found a very large problem. Your kernel command line has amdgpu.msi=0:

      Command line: BOOT_IMAGE=/vmlinuz-6.8.0-134-generic root=... ro amdgpu.msi=0 console=tty1 console=ttyS0
      

      That disables MSI interrupts for the GPU driver entirely, and your dmesg shows exactly what that costs: fence fallback timer messages every half-second on both cards from the moment the driver loads, before any workload runs. The driver is surviving on a polling fallback instead of interrupts. My card throws those messages in occasional bursts under load (lost interrupts); yours throws them constantly (no interrupts). Under load that degrades into what's in your log: sdma0 ring timeout → ring reset fails → full MODE1 GPU reset → "VRAM is lost" → your loaded model evaporates while llama-server keeps waiting. It also explains your stuck reboots — the traces at the end show unkillable fence waits in the reset path.
      Remove amdgpu.msi=0 from grub, update-grub, reboot the VM, then verify interrupts are actually flowing:

      grep -i amdgpu /proc/interrupts
      

      You should see MSI/MSI-X vectors for the amdgpu devices with counts that climb while a model loads. Then watch dmesg during a load — occasional fence fallback bursts are survivable (I get them too under Xen), but the constant 0.5s drumbeat should be gone.

      Out of curiosity — did you add msi=0 while chasing the "no interrupts registered" issue from your first post? If you re-enable MSI and interrupts still don't flow, that's the real bug and exactly what the Vates folks will want to see, especially since you still have the debug Xen + iommu=debug boot — xl dmesg from dom0 while the VM is loading a model would show whether MSIs are being injected.

      One more thing for after interrupts are fixed: your llama-server command shows --ctx-size 262144. A 256K context KV cache on top of that model is a huge allocation for a 32GB card and can silently spill into GTT and crawl. I'd validate at something modest first (8192), confirm it serves, then step the context up while watching VRAM. That's the approach I'm using on mine.

      R

      posted in Compute
      R
      ravenet
    • RE: RDNA 4 GPU Passthrough

      @pessimisttech one thing I realized we never actually confirmed — we've only seen BAR info for one of your cards (you ran -s 00:08.0). Can you run it against all AMD devices in the guest:

      sudo lspci -vv -d 1002: | grep -E "Region 0|LnkSta:"
      

      and check that both GPUs show Region 0 at [size=32G]?

      Reason I ask: hvmloader sizes the guest MMIO space automatically, and it clearly handles one 32GB BAR fine (both our single-card outputs prove that). But two cards need 64GB+ of BAR space and I've never seen anyone confirm the auto-sizing copes with that. If your second GPU got squeezed down to 256M, that's the exact failure mode I originally had on my single card before enabling Resizable BAR — driver wedges in D-state with no error, model appears to load, llama-server never comes up. It would also explain the "some workloads fine, some not" pattern: anything that only touches GPU1 (like ollama, which apparently defaults to a single card when the model fits) works, anything that splits across both hangs.

      If GPU2 does show a small Region 0, there's a VM param worth trying:

      xe vm-param-set uuid=<vm-uuid> platform:mmio_hole_size=137438953472
      

      (128GB, needs the VM fully shut down and cold booted, not rebooted). Fair warning that I haven't tested this myself — my single card worked with host BIOS ReBAR alone and hvmloader did the rest — so treat it as an experiment. It's also historically a below-4GB hole setting and these BARs live in high address space, so it may turn out to be the wrong knob entirely. If it doesn't change anything, that's useful info too.

      If both GPUs already show 32G, then BAR sizing is ruled out and it's back to the cross-GPU angle — in which case the single-GPU test result (HIP_VISIBLE_DEVICES=0) plus the ps/wchan output while hung would be the thing to look at, and probably worth summoning @teddyastie with the findings since P2P DMA between two passthrough devices under Xen is hypervisor territory, not config.

      R

      posted in Compute
      R
      ravenet
    • RE: RDNA 4 GPU Passthrough

      @PessimistTech
      Try pass through just 1 gpu. See where that gets you

      Edit:
      actually, possibly faster way to test the single-GPU theory without touching passthrough — just hide one card from ROCm:

      docker run -d \
          --name lemonade-server \
          --init \
          -e HIP_VISIBLE_DEVICES=0 \
          -p 13305:13305 \
          -v lemonade-cache:/root/.cache/huggingface \
          -v lemonade-llama:/opt/lemonade/llama \
          -v lemonade-recipe:/root/.cache/lemonade \
          --device=/dev/kfd \
          --device=/dev/dri \
          ghcr.io/lemonade-sdk/lemonade-server:latest
      

      If it loads and serves with one GPU visible, the problem is apparently cross-GPU peer-to-peer under Xen. With two passed-through devices, llama.cpp splits the model and the first cross-device sync tries P2P DMA through the virtual root complex — ROCm reports peer access as available but the transaction never completes, so the fence waits forever. Model in VRAM, llama-server alive but frozen. That would explain why it dies after the memory is allocated rather than during load. (Related: even on my single card I get bursts of sdma0 fence fallback messages under Xen from lost interrupts — harmless for me, but on a P2P path a lost fence is fatal.)

      Two things to grab while it's hung, so we know for sure where it's stuck:

      
      docker exec lemonade-server ps -eo pid,stat,wchan:32,cmd | grep llama
      

      If llama-server shows state D with a wchan in amdgpu fence/ring wait, it's wedged in the kernel driver, not userspace. Also check guest dmesg during the hang for ring timeout / fence messages:

      sudo dmesg -w | grep -iE "amdgpu|sdma|ring|fence"
      

      If single-GPU works and you want both cards back, a couple of things to try before giving up on dual:

      • -e HSA_ENABLE_SDMA=0 — routes copies through shader blits instead of the SDMA engines; it's the standard workaround for ROCm fence hangs inside VMs

      • keep the split on one device via lemonade: docker exec lemonade-server lemonade config set llamacpp.args="--split-mode none" then restart — both GPUs visible but no cross-device traffic

      Worst case, two VMs with one GPU each works around the P2P problem entirely and you can load-balance in front.

      Fingers crossed

      R

      posted in Compute
      R
      ravenet
    • RE: RDNA 4 GPU Passthrough

      @PessimistTech

      switch to rocm-nightly, as that's required to bring support for our ai pro 9700

      docker exec lemonade-server lemonade config set llamacpp.backend=rocm
      docker exec lemonade-server lemonade config set rocm_channel=nightly
      docker restart lemonade-server
      

      The second line is important. This GPU is gfx1201 and the rocm-stable channel doesn't have HIP kernels for it yet. If you switch to rocm backend without setting the channel to nightly, it silently falls back to CPU with no error — you'll just see terrible speeds and an idle GPU. Ask me how I know.

      Restart is needed for the backend change to take effect, and the config survives restarts since the docs' run command already mounts the lemonade-recipe volume where it lives.

      One more thing I'd add to your docker run: the --init flag, right after docker run -d. Without an init process in the container, a failed/hung model load can leave the container wedged in D-state and you end up force-killing it. I keep it permanently in my compose (init: true) after learning this the hard way.

      Good news is your lspci output looks healthy — Region 0 at 32G in the guest and AtomicOpsCtl ReqEn+ means your BAR and atomics are fine, which was the failure mode on my end originally. So this is likely just backend/kernel config, not the passthrough itself.

      After the restart you can confirm it's actually on GPU by watching VRAM fill during model load:

      watch -n1 'cat /sys/class/drm/card*/device/mem_info_vram_used'
      

      If that stays flat while a model loads, you're on CPU fallback.

      R

      posted in Compute
      R
      ravenet
    • RE: RDNA 4 GPU Passthrough

      @PessimistTech make sure lemonade is set to use rocm as backend. It was slow and unusable from vulkan

      docker compose exec lemonade lemonade config set llamacpp.backend=rocm
      

      does it finish loading model then just respond horribly slowly, or does it not complete the model load?
      did you setup as straight docker, or as a docker compose? I did mine as a compose, but shouldn't matter outside of how the config is laid out

      is your guest seeing the whole mem on gpu and the PCIE link speed?

      sudo lspci -vv -d 1002: | grep -E "Region [0-9]|LnkSta:"
              Region 0: Memory at 1000000000 (64-bit, prefetchable) [size=32G]
              Region 2: Memory at 1800000000 (64-bit, prefetchable) [size=256M]
              Region 4: I/O ports at c100 [size=256]
              Region 5: Memory at f0800000 (32-bit, non-prefetchable) [size=512K]
                      LnkSta: Speed 32GT/s, Width x16
              Region 0: Memory at f08c0000 (32-bit, non-prefetchable) [size=16K]
                      LnkSta: Speed 32GT/s, Width x16]
      

      You'll also want to make sure AtomicOP is working, below is example command and result

      sudo lspci -vv -d 1002: | grep -iE "AtomicOp"
      
                               AtomicOpsCap: 32bit+ 64bit+ 128bitCAS-
                               AtomicOpsCtl: ReqEn-
                               AtomicOpsCap: 32bit- 64bit- 128bitCAS-
                               AtomicOpsCtl: ReqEn-
      
      posted in Compute
      R
      ravenet
    • RE: RDNA 4 GPU Passthrough

      @PessimistTech said:

      Well thanks everyone for the responses! After some more trial and error I got it working. I dug through the bios on my board and enabled ARI Support, PCIe AER, and ACS. After reboot the VM was able to run workloads without issue.

      EDIT: at least partially working. Some workloads seem fine, other workloads seem to behave the same as before...

      Do you have examples of workloads that are struggling still?
      and no, didn't do anything special on the xcp host that I'm aware of. Was already using it to passthrough a radeon pro 7500 to a windows vm for revit clarity automation server. It's been a year so I'll triple check if anything special was done back then.

      posted in Compute
      R
      ravenet
    • RE: RDNA 4 GPU Passthrough

      @PessimistTech

      I am running a radeon ai Pro 9700 on xcp-ng 8.3 passed through to an opensuse Slowroll, with rocm and lemonade docker. Gemma 4 31B-it-MTP gets 38tps

      did you pass through as pcie passthrough with both the video and audio, or just the 'gpu passthrough' option in xoa? I did the 2 devices pcie passthrough
      Make sure you have Resizable BAR enabled in bios or it just will not work

      R

      posted in Compute
      R
      ravenet
    • RE: Need FeedBack: New version of the File level restore

      @florent

      Any plans for ReFS?

      posted in Backup
      R
      ravenet
    • RE: XCP-ng 8.3 updates announcements and testing

      One thing I noticed was manually copying a qcow2 disk to an sr, with a properly generated UUID, would lock up the sr from scanning disks and updating its inventory db.
      Running VMs seemed fine.

      Deleting that manually copied disk from sr released the lock.

      Rodney

      posted in News
      R
      ravenet
    • RE: XOA 5.107.2 Backup Failure via SMB and S3 (Backblaze)

      @planedrop I was getting a lot of NBD errors as well. so I'm not positive on if it was fully just ignoring the concurrency, or just moving onto next backup because of nbd communication error then just leaving the previous backups under active attempt. Either way, there's a bug if it leaves backup 'active' and then starts another one beyond set concurrent limit.

      posted in Backup
      R
      ravenet
    • RE: XOA 5.107.2 Backup Failure via SMB and S3 (Backblaze)

      @olivierlambert

      @florent already jumped in on our case and submitted a fix for "_removeUnusedSnapshots don t handle vdi related to multiple VMs" that we were seeing.
      We have a vdi that won't coalesce, so I need to reopen that case. I think this above error was triggered from this angry vdi and my previous attempt to fix it.

      It was also noted that 5.107 was ignoring our backup setting for concurrent backups and was running all 24vms at once instead of the 3 we had set. Reverting to 5.106.4 resolved this. Waiting for an update on what's broken in 5.107 to ignore this setting. Different timezone so assume I'll hear tonight.

      I'm on 8.3 as well and fully updated with latest patches

      posted in Backup
      R
      ravenet
    • RE: XOA 5.107.2 Backup Failure via SMB and S3 (Backblaze)

      I was seeing similar broken backups in 5.107. Reverting to 5.106.4 seems to have resolved so far. Have a case open with logs submitted

      posted in Backup
      R
      ravenet
    • RE: XCP-ng 8.3 updates announcements and testing

      @dthenot said in XCP-ng 8.3 updates announcements and testing:

      For people testing the QCOW2 preview, please be informed that you need to update with the QCOW2 repo enabled, if you install the new non QCOW2 version, you risk QCOW2 VDI being dropped from XAPI database until you have installed it and re-scanned the SR.
      Dropping from XAPI means losing name-label, description and worse, the links to a VM for these VDI.
      There should be a blktap, sm and sm-fairlock update of the same version as above in the QCOW2 repo.

      If you have correctly added the QCOW2 repo linked here: https://xcp-ng.org/forum/post/90287

      You can update like this:

      yum clean metadata --enablerepo=xcp-ng-testing,xcp-ng-qcow2
      yum update --enablerepo=xcp-ng-testing,xcp-ng-qcow2
      reboot
      

      Versions:

      • blktap: 3.55.4-1.1.0.qcow2.1.xcpng8.3
      • sm: 3.2.12-3.1.0.qcow2.1.xcpng8.3

      So far so good on Ryzen 1700x host.

      posted in News
      R
      ravenet
    • RE: XCP-NG 9, Dom0 considerations

      @mnv said in XCP-NG 9, Dom0 considerations:

      @olivierlambert said in XCP-NG 9, Dom0 considerations:

      @mnv For local SR, just use Local ext SR type and you will be thin already.

      Hi Olivier,

      Sorry for my late reply.

      Yes, I am aware of that, however using LVM (like using ZVOL) would offer the disk as a block device directly, thin ext4 ought to be ext4 + the virtual disk + the VM filesystem, ZVOL/LVM should be block device + VM filesystem. There seems to be way less overhead.

      ZVOL doesn't play nice with all SSDs, not mines for sure, LVM Thin seems to play much better, write less and take longer to have the same wear as ext4-thin or ZVOL.

      I understand this isn't a problem in an Enterprise environment, though...

      Larger issue is the existing block storage code is thick only, so rolls across to local lvm, HBA and iscsi. And fiber channel/SAS multipath HBA and iscsi are what are more commonly used in many enterprises, blocking many from migrating from competing products.
      LVM has supported thin provisioning since release 2.02.89 back in 2012, with redhat 6.4 I believe.
      This should also solve the initial vhd sparse file growth write performance penalty

      posted in Development
      R
      ravenet
    • RE: XCP-NG 9, Dom0 considerations

      @mnv said in XCP-NG 9, Dom0 considerations:

      Thanks for your heads up, Olivier, and I hope your internal tests and developements go in the best direction! I can't wait for the next big thing! Only thing I could hope for that is missing (AFAIK) in XCP-NG 8.x is support for LVM Thin storage, that's so good when you have crappy consumer SSDs... 🙂

      I've actually been puttering with LVM thin patches for awhile as it's always bothered me that we didn't have. I think I finally have my head around the code. , but I'm sure I'm missing something obvious that will be pointed out when I submit.
      It's been a very-very-very-side project.

      posted in Development
      R
      ravenet
    • RE: Gpu passthrough on Asrock rack B650D4U3-2L2Q will not work

      @steff22 said in Gpu passthrough on Asrock rack B650D4U3-2L2Q will not work:

      @ravenet Ok I think the pro gpu's work better without so many bugs.

      I switched to Nvidia RTX 4070. With the Nvidia gpu and this works as it should and gets an image on the screen on the first try.

      So there must be something wrong with the amd drivers plus that error with the amd reset bug

      I've setup a test system with a ryzen 7700x and a regular radeon 7600xt, non-pro gpu. Will let you know results. Shouldn't be an issue, it's same hardware and even the drivers work across them. Though they do have different bios on cards

      posted in Hardware
      R
      ravenet
    • RE: XCP-ng 8.3 updates announcements and testing

      @gduperrey
      Tested on 4 systems in production

      Ryzen 1700x, on asrock rack mb w radeon pro GPU pass through
      Threadripper 5975wx on asrock rack mb w radeon pro GPU pass through
      Epyc 9224 on Asus
      Epyc 7313P on Asus

      posted in News
      R
      ravenet
    • RE: XCP-ng 8.3 updates announcements and testing

      @gduperrey

      Tested on Multiple systems. Ryzen 1700x andThreadripper 5975. fine so far

      posted in News
      R
      ravenet