win amd GPU passtrough
This commit is contained in:
96
portainer-compose-stacks/windows/verify-gpu-passthrough.sh
Normal file
96
portainer-compose-stacks/windows/verify-gpu-passthrough.sh
Normal file
@@ -0,0 +1,96 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Verification script for GPU Passthrough Setup
|
||||
# Run this after reboot to verify IOMMU and VFIO configuration
|
||||
|
||||
echo "=== GPU Passthrough Verification ==="
|
||||
echo ""
|
||||
|
||||
# Check 1: IOMMU enabled
|
||||
echo "1. Checking IOMMU status..."
|
||||
if dmesg | grep -qi "AMD-Vi: AMD IOMMUv2 loaded"; then
|
||||
echo " ✓ IOMMU is enabled"
|
||||
else
|
||||
echo " ✗ IOMMU not detected in dmesg"
|
||||
echo " Boot parameters: $(cat /proc/cmdline | grep -o 'amd_iommu=[^ ]*\|iommu=[^ ]*')"
|
||||
fi
|
||||
echo ""
|
||||
|
||||
# Check 2: VFIO module loaded
|
||||
echo "2. Checking VFIO modules..."
|
||||
if lsmod | grep -q vfio_pci; then
|
||||
echo " ✓ vfio_pci module loaded"
|
||||
else
|
||||
echo " ✗ vfio_pci module not loaded"
|
||||
echo " Try: modprobe vfio-pci"
|
||||
fi
|
||||
echo ""
|
||||
|
||||
# Check 3: GPU bound to VFIO
|
||||
echo "3. Checking GPU (c5:00.0) driver binding..."
|
||||
GPU_DRIVER=$(lspci -nnk -s c5:00.0 | grep "Kernel driver in use" | awk '{print $5}')
|
||||
if [ "$GPU_DRIVER" = "vfio-pci" ]; then
|
||||
echo " ✓ GPU bound to vfio-pci"
|
||||
else
|
||||
echo " ✗ GPU bound to: ${GPU_DRIVER:-none}"
|
||||
echo " Expected: vfio-pci"
|
||||
fi
|
||||
|
||||
lspci -nnk -s c5:00.0 | head -5
|
||||
echo ""
|
||||
|
||||
# Check 4: Audio bound to VFIO
|
||||
echo "4. Checking GPU Audio (c5:00.1) driver binding..."
|
||||
AUDIO_DRIVER=$(lspci -nnk -s c5:00.1 | grep "Kernel driver in use" | awk '{print $5}')
|
||||
if [ "$AUDIO_DRIVER" = "vfio-pci" ]; then
|
||||
echo " ✓ Audio bound to vfio-pci"
|
||||
else
|
||||
echo " ✗ Audio bound to: ${AUDIO_DRIVER:-none}"
|
||||
echo " Expected: vfio-pci"
|
||||
fi
|
||||
|
||||
lspci -nnk -s c5:00.1 | head -5
|
||||
echo ""
|
||||
|
||||
# Check 5: IOMMU groups
|
||||
echo "5. Checking IOMMU groups..."
|
||||
if [ -e /sys/bus/pci/devices/0000:c5:00.0/iommu_group ]; then
|
||||
GPU_GROUP=$(basename $(readlink /sys/bus/pci/devices/0000:c5:00.0/iommu_group))
|
||||
echo " ✓ GPU IOMMU group: $GPU_GROUP"
|
||||
echo " Devices in group:"
|
||||
ls -1 /sys/bus/pci/devices/0000:c5:00.0/iommu_group/devices/ | sed 's/^/ - /'
|
||||
else
|
||||
echo " ✗ IOMMU group not found for GPU"
|
||||
fi
|
||||
echo ""
|
||||
|
||||
# Check 6: VFIO devices
|
||||
echo "6. Checking /dev/vfio devices..."
|
||||
if [ -e /dev/vfio/vfio ]; then
|
||||
echo " ✓ /dev/vfio/vfio exists"
|
||||
ls -la /dev/vfio/ | sed 's/^/ /'
|
||||
else
|
||||
echo " ✗ /dev/vfio/vfio not found"
|
||||
fi
|
||||
echo ""
|
||||
|
||||
# Summary
|
||||
echo "=== Summary ==="
|
||||
if [ "$GPU_DRIVER" = "vfio-pci" ] && [ "$AUDIO_DRIVER" = "vfio-pci" ] && [ -e /dev/vfio/vfio ]; then
|
||||
echo "✓ GPU passthrough is configured correctly!"
|
||||
echo ""
|
||||
echo "Next steps:"
|
||||
echo " 1. Start the Windows container: cd /mnt/shared/DEV/repos/d-popov.com/scripts/portainer-compose-stacks/windows && docker-compose up -d"
|
||||
echo " 2. Connect to Windows via RDP: localhost:3389"
|
||||
echo " 3. Install AMD Radeon drivers in Windows"
|
||||
echo " 4. GPU should appear as 'AMD Strix Halo' in Device Manager"
|
||||
else
|
||||
echo "✗ GPU passthrough configuration needs attention"
|
||||
echo ""
|
||||
echo "If GPU is not bound to vfio-pci:"
|
||||
echo " - Check /etc/modprobe.d/vfio.conf"
|
||||
echo " - Run: sudo update-initramfs -u"
|
||||
echo " - Reboot again"
|
||||
fi
|
||||
|
||||
|
||||
Reference in New Issue
Block a user