{"id":683,"date":"2020-05-02T08:30:11","date_gmt":"2020-05-01T23:30:11","guid":{"rendered":"https:\/\/www.alprovs.com\/wordpress\/?p=683"},"modified":"2021-08-19T08:30:54","modified_gmt":"2021-08-18T23:30:54","slug":"centos8kvm%e3%82%b2%e3%82%b9%e3%83%88%e3%83%9e%e3%82%b7%e3%83%b3%e3%81%b8gpu-passthrough%e3%82%92%e8%a1%8c%e3%81%86","status":"publish","type":"post","link":"https:\/\/www.alprovs.com\/wordpress\/?p=683","title":{"rendered":"[CentOS8]KVM\u30b2\u30b9\u30c8\u30de\u30b7\u30f3\u3078GPU passthrough\u3092\u884c\u3046"},"content":{"rendered":"<p>\u3053\u3061\u3089\u306e\u30da\u30fc\u30b8\u3092\u53c2\u8003\u306bGPU\u30d1\u30b9\u30b9\u30eb\u30fc\u306e\u8a2d\u5b9a\u3092\u884c\u3063\u305f\u304c\u3001\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u305f\u3081\u5099\u5fd8\u9332\u3068\u3057\u3066\u6b8b\u3057\u3066\u304a\u304f\u3002<\/p>\n<p><a href=\"https:\/\/www.server-world.info\/query?os=CentOS_8&amp;p=kvm&amp;f=12\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/www.server-world.info\/query?os=CentOS_8&amp;p=kvm&amp;f=12<\/a><\/p>\n<h2>1. \u74b0\u5883<\/h2>\n<p>\u30db\u30b9\u30c8\uff1aCentOS8<\/p>\n<ul>\n<li>libvirt\uff1a4.5.0<\/li>\n<\/ul>\n<p>\u30b2\u30b9\u30c8\uff1aCentOS8 \u203b\u3059\u3067\u306b\u69cb\u7bc9\u6e08\u307f\u306e\u3082\u306e\u3092\u4f7f\u7528<\/p>\n<h2>2. \u767a\u751f\u3057\u305f\u554f\u984c\uff081\uff09<\/h2>\n<p>\u4ee5\u4e0b\u306e\u753b\u50cf\u306e\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u3001\u4eee\u60f3\u30de\u30b7\u30f3\u306e\u8d77\u52d5\u306b\u5931\u6557\u3057\u305f\u3002<a href=\"https:\/\/www.alprovs.com\/wordpress\/wp-content\/uploads\/2020\/05\/Screenshot_20200502_075403.png\"><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"wp-image-685 aligncenter\" src=\"https:\/\/www.alprovs.com\/wordpress\/wp-content\/uploads\/2020\/05\/Screenshot_20200502_075403.png\" alt=\"\" width=\"340\" height=\"297\" srcset=\"https:\/\/www.alprovs.com\/wordpress\/wp-content\/uploads\/2020\/05\/Screenshot_20200502_075403.png 511w, https:\/\/www.alprovs.com\/wordpress\/wp-content\/uploads\/2020\/05\/Screenshot_20200502_075403-300x262.png 300w\" sizes=\"auto, (max-width: 340px) 100vw, 340px\" \/><\/a><\/p>\n<h3>2-1. \u89e3\u6c7a\u65b9\u6cd5<\/h3>\n<p>\u3044\u308d\u3044\u308d\u8abf\u3079\u3066\u3044\u305f\u3068\u3053\u308d <span class=\"lang:default decode:true crayon-inline \">vfio_iommu_type1<\/span>\u00a0 \u3068\u3044\u3046\u30e2\u30b8\u30e5\u30fc\u30eb\u304c\u8aad\u307f\u8fbc\u307e\u308c\u3066\u3044\u306a\u3044\u3053\u3068\u304c\u5206\u304b\u308a\u3001\u3053\u308c\u3092\u8aad\u307f\u8fbc\u307e\u305b\u308b\u3053\u3068\u3067\u8d77\u52d5\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308b\u3002<\/p>\n<p>\u30fb\u4e00\u6642\u7684\u306b\u306f<br \/>\n<code class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\"># modprobe vfio_iommu_type1<\/code><br \/>\n\u30fb\u6c38\u7d9a\u7684\u306b\u306f\uff08\u30db\u30b9\u30c8\u306e\u518d\u8d77\u52d5\u304c\u5fc5\u8981\uff09<br \/>\n<code class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\"># echo 'vfio_iommu_type1' &gt; \/etc\/modules-load.d\/vfio_iommu_type1.conf<\/code><\/p>\n<h2>3. \u6b21\u306b\u767a\u751f\u3057\u305f\u554f\u984c\uff082\uff09<\/h2>\n<p>\u554f\u984c\uff081\uff09\u3092\u89e3\u6c7a\u5f8c\u3001Nvidia driver\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3092\u884c\u3044\u3001nvidia-smi\u3092\u5b9f\u884c\u3057\u305f\u3068\u3053\u308d\u4ee5\u4e0b\u306e\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u3002<br \/>\n<code class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">$ nvidia-smi<br \/>\nUnable to determine the device handle for GPU 0000:07:00.0: Unknown Error<\/code><br \/>\ndmesg\u3092\u5b9f\u884c\u3059\u308b\u3068\u3053\u306e\u3088\u3046\u306a\u30ed\u30b0\u304c\u8907\u6570\u6b8b\u3063\u3066\u3044\u305f\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">$ dmesg\r\n\u30fb\u30fb\u30fb\r\n[   26.907855] NVRM: GPU 0000:07:00.0: RmInitAdapter failed! (0x23:0x56:498)\r\n[   26.908054] NVRM: GPU 0000:07:00.0: rm_init_adapter failed, device minor number 0\r\n\u30fb\u30fb\u30fb<\/pre>\n<h3>3-1. \u89e3\u6c7a\u65b9\u6cd5<\/h3>\n<p>Nvidia driver\u306f\u30cf\u30a4\u30d1\u30fc\u30d0\u30a4\u30b6\u306e\u52d5\u4f5c\u3092\u78ba\u8a8d\u3057\u52d5\u4f5c\u3092\u505c\u6b62\u3055\u305b\u308b\u3089\u3057\u3044\u3002\u3053\u308c\u3092\u56de\u907f\u3059\u308b\u305f\u3081\u306b\u306f\u3001VM\u8a2d\u5b9aXML\u306efeatures\u30bf\u30b0\u5185\u306b\u4ee5\u4e0b\u306ehyperv\u3068kvm\u30bf\u30b0\u3092\u8ffd\u52a0\u3059\u308b\u3002<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\"># virsh edit [vmname]\r\n\u30fb\u30fb\u30fb\r\n  &lt;features&gt;\r\n  \u30fb\u30fb\u30fb\r\n    &lt;hyperv&gt;\r\n      &lt;vendor_id state='on' value='whatever'\/&gt;\r\n    &lt;\/hyperv&gt;\r\n    &lt;kvm&gt;\r\n      &lt;hidden state='on'\/&gt;\r\n    &lt;\/kvm&gt;\r\n  \u30fb\u30fb\u30fb\r\n  &lt;\/features&gt;\r\n\u30fb\u30fb\u30fb<\/pre>\n<h4>3-1-1. \u53c2\u8003\u30b5\u30a4\u30c8<\/h4>\n<p><a href=\"https:\/\/wiki.archlinux.jp\/index.php\/OVMF_%E3%81%AB%E3%82%88%E3%82%8B_PCI_%E3%83%91%E3%82%B9%E3%82%B9%E3%83%AB%E3%83%BC#Windows_.E3.81.AE.E4.BB.AE.E6.83.B3.E3.83.9E.E3.82.B7.E3.83.B3.E3.81.AB_NVIDIA_.E3.81.AE_GPU_.E3.82.92.E3.83.91.E3.82.B9.E3.82.B9.E3.83.AB.E3.83.BC.E3.81.97.E3.81.9F.E5.A0.B4.E5.90.88.E3.81.AB_.22Error_43_:_Driver_failed_to_load.22\" target=\"_blank\" rel=\"noopener noreferrer\"><span id=\"Windows_.E3.81.AE.E4.BB.AE.E6.83.B3.E3.83.9E.E3.82.B7.E3.83.B3.E3.81.AB_NVIDIA_.E3.81.AE_GPU_.E3.82.92.E3.83.91.E3.82.B9.E3.82.B9.E3.83.AB.E3.83.BC.E3.81.97.E3.81.9F.E5.A0.B4.E5.90.88.E3.81.AB_.22Error_43_:_Driver_failed_to_load.22\">Windows \u306e\u4eee\u60f3\u30de\u30b7\u30f3\u306b NVIDIA \u306e GPU \u3092\u30d1\u30b9\u30b9\u30eb\u30fc\u3057\u305f\u5834\u5408\u306b &#8220;Error 43\u00a0: Driver failed to load&#8221;<\/span><\/a><\/p>\n<p class=\"it-Header_title\"><a href=\"https:\/\/qiita.com\/rarudonet\/items\/dfab399812ab9d748c07\" target=\"_blank\" rel=\"noopener noreferrer\">Ubuntu19.10 KVM\u3067GPU\u306e\u30d1\u30b9\u30b9\u30eb\u30fc\u304c\u3067\u304d\u306a\u3044\u554f\u984c\u306e\u89e3\u6c7a\u7b56<\/a><br \/>\n\u203b\u79c1\u306e\u74b0\u5883\u3067\u306f\u3053\u306e\u8a2d\u5b9a\u306f\u4e0d\u8981\u3060\u3063\u305f<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3053\u3061\u3089\u306e\u30da\u30fc\u30b8\u3092\u53c2\u8003\u306bGPU\u30d1\u30b9\u30b9\u30eb\u30fc\u306e\u8a2d\u5b9a\u3092\u884c\u3063\u305f\u304c\u3001\u30a8\u30e9\u30fc\u304c\u767a\u751f\u3057\u305f\u305f\u3081\u5099\u5fd8\u9332\u3068\u3057\u3066\u6b8b\u3057\u3066\u304a\u304f\u3002 https:\/\/www.server-world.info\/query?os=CentOS_8&amp;p=kvm&#038;a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,6,10],"tags":[],"class_list":["post-683","post","type-post","status-publish","format-standard","hentry","category-linux","category-6","category-10"],"_links":{"self":[{"href":"https:\/\/www.alprovs.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/683","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.alprovs.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.alprovs.com\/wordpress\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.alprovs.com\/wordpress\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.alprovs.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=683"}],"version-history":[{"count":7,"href":"https:\/\/www.alprovs.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/683\/revisions"}],"predecessor-version":[{"id":786,"href":"https:\/\/www.alprovs.com\/wordpress\/index.php?rest_route=\/wp\/v2\/posts\/683\/revisions\/786"}],"wp:attachment":[{"href":"https:\/\/www.alprovs.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=683"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.alprovs.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=683"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.alprovs.com\/wordpress\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=683"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}