"use client" import React, { useState } from "react" import Link from "next/link" import { Cpu, ArrowLeft, Copy, Check, Terminal } from "lucide-react" import { Button } from "@/components/ui/button" import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table" import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "@/components/ui/accordion" export default function GPUPassthroughPage() { const [viewMode, setViewMode] = useState<"table" | "accordion">("table") // Group commands by category for better organization const commandGroups = [ { title: "Device Identification", commands: [ { command: "lspci -nn | grep -i nvidia", description: "List NVIDIA PCI devices" }, { command: "lspci -nn | grep -i vga", description: "List all VGA compatible devices" }, { command: "lspci -nn | grep -i amd", description: "List AMD PCI devices" }, { command: "lspci -nnk | grep -A3 VGA", description: "List VGA devices with kernel drivers" }, { command: "lspci -v -s ", description: "Show detailed info for specific PCI device" }, ], }, { title: "VFIO Configuration", commands: [ { command: "dmesg | grep -i vfio", description: "Check VFIO module messages" }, { command: "cat /etc/modprobe.d/vfio.conf", description: "Review VFIO passthrough configuration" }, { command: "ls -la /etc/modprobe.d/", description: "List all modprobe configuration files" }, { command: "cat /etc/modules", description: "Show modules loaded at boot time" }, { command: "lsmod | grep vfio", description: "Check if VFIO modules are loaded" }, ], }, { title: "IOMMU Configuration", commands: [ { command: "cat /etc/default/grub", description: "Review GRUB options for IOMMU" }, { command: "update-grub", description: "Apply GRUB changes" }, { command: "dmesg | grep -i iommu", description: "Check IOMMU messages in kernel log" }, { command: "dmesg | grep -e DMAR -e IOMMU", description: "Check DMAR and IOMMU messages" }, { command: "find /sys/kernel/iommu_groups/ -type l | sort -V", description: "List IOMMU groups" }, ], }, { title: "System Updates", commands: [ { command: "update-initramfs -u", description: "Apply initramfs changes (VFIO)" }, { command: "update-initramfs -u -k all", description: "Update initramfs for all kernels" }, { command: "cat /proc/cmdline", description: "Show current kernel boot parameters" }, ], }, { title: "VM Configuration", commands: [ { command: "qm config | grep hostpci", description: "Show PCI passthrough config for a VM" }, { command: "qm set -hostpci0 ,pcie=1,x-vga=1", description: "Add GPU passthrough to a VM", }, { command: "cat /etc/pve/qemu-server/.conf", description: "View VM configuration file" }, { command: "qm set -machine q35", description: "Set VM to use Q35 chipset (recommended for passthrough)", }, { command: "qm set -bios ovmf", description: "Set VM to use UEFI/OVMF (required for GPU passthrough)", }, ], }, ] return (
Back to Help and Info

GPU Passthrough Commands

This section provides commands for configuring and managing GPU passthrough in Proxmox VE. Learn how to identify GPU devices, configure VFIO and IOMMU, and set up VMs for GPU passthrough.

{viewMode === "table" ? (
{commandGroups.map((group, index) => (

{group.title}

Command Description Action {group.commands.map((cmd, cmdIndex) => ( {cmd.command} {cmd.description} ))}
))}
) : (
{commandGroups.map((group, index) => (

{group.title}

{group.commands.map((cmd, cmdIndex) => (
{cmd.command}
{cmd.command}

{cmd.description}

))}
))}
)}

GPU Passthrough Tips

  • Replace <PCI_ID> with your GPU's PCI ID (e.g., 01:00.0)
  • Replace <vmid> with your VM's ID
  • For IOMMU to work, you need to enable it in BIOS/UEFI (look for settings like "VT-d", "AMD-Vi", or "IOMMU")
  • Common GRUB parameters for IOMMU:
    • For Intel: intel_iommu=on
    • For AMD: amd_iommu=on
    • Additional options:{" "} iommu=pt video=efifb:off video=vesa:off
  • After making changes to GRUB or modprobe configurations, run{" "} update-grub and{" "} update-initramfs -u, then reboot
) } interface CopyButtonProps { text: string } function CopyButton({ text }: CopyButtonProps) { const [copied, setCopied] = React.useState(false) const copyToClipboard = () => { navigator.clipboard.writeText(text) setCopied(true) setTimeout(() => setCopied(false), 2000) } return ( ) }