2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Proxmox VE 7でPCIeのパススルーをする(覚書)

Posted at

ProxmoxVEでVM上のWindows10でNVEncを使う必要ができたのでGPUをパススルーした時の覚書。
個人でネット調べながらやったことなので参考程度に
ちなみに私自身はIntelのCPUでやっているのでAMDの人はごめんなさい自分で調べてみて。

VT-Dの有効化

こればっかりはマザーのベンダーによって違うので何とも言えない。
そもそも使おうとしているマザーやCPUがVT-Dに対応しているかどうかを確認したほうがいい。

ついでにSATAのホットプラグをできるようにしておいた。サーバーとして使っているPCなので一応

grubにIOMMUの記述を描く

まずはgrubを編集してintel VT-dを有効にする。

$nano /etc/default/grug

おそらく中には下記のようなことが書いてあるので

# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
#   info -f grub -n 'Simple configuration'

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet "
GRUB_CMDLINE_LINUX=""

# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
# GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"

GRUB_CMDLINE_LINUX_DEFAULT="quiet "の行にintel_iommu=on iommu=pt video=efifb:offを追記する

# 変更前
GRUB_CMDLINE_LINUX_DEFAULT="quiet "

# 変更後
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on iommu=pt video=efifb:off"

詳細

intel_iommu=onは言うまでもなくiommuを有効化する記述
iommu=onはLinux側からアクセスしないようにする記述
video=efifb:offはNvidiaのグラボでよく起きるError43を起きないようにするためのおまじない

モジュールの記述

/etc/modulesにひモジュールを書いていく

vfio
vfio_iommu_type1
vfio_pcie
vfio_virqfd

ブラックリストに記述

/etc/modprobe.d/にLinuxから読み込まないモジュールを書いていく

blacklist pcspkr
blacklist radeon
blacklist nvidia
blacklist nvidiafb
blacklist amdgpu
blacklist vfio

ほかにもサウンドカードなどパススルーするにあたってLinuxに読み込んでほしくないモジュールを書いていく。

grubの更新とinitramfsの再生成

# grubの更新
$update-grub

# initramfsの再生成
$update-initramfs -u

終了

これで再起動した後web上のUIからPCIeのデバイスを追加したら起動できるはず

2
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?