Driver for GTX 1080 doesn't work on guest when using KVM PCI Passthrough











up vote
3
down vote

favorite












I believe we are running into a possible bug with the GTX 1080 (driver) and PCI Passthrough.



My host is an Ubuntu 14.04 system.
My guest is an Ubuntu 14.04/16.04 system (both do the same thing).



I can see device inside the guest VM:



lspci -vnn | grep VGA



00:05.0 VGA compatible controller: NVIDIA Corporation Device 1b80 (rev
a1)




I was able to successfully install the driver (370.2, latest driver). It installs, but is not recognized by nvidia-smi:



nvidia-smi 



Unable to determine the device handle for GPU 0000:00:05.0: Unknown
Error




Looking in dmesg I see the following error message




[ 29.535583] nvidia 0000:00:05.0: irq 45 for MSI/MSI-X [

29.577727] NVRM: RmInitAdapter failed! (0x23:0x56:458) [ 29.577807] NVRM: rm_init_adapter failed for device bearing minor number 0




I can switch out the GTX 1080 for a different card (M4000, do passthrough and install drivers on guest) and it works. I am going to try tomorrow with another Geforce card.



Another person on the NVidia forums had the SAME exact issue as me (but no answer).



https://devtalk.nvidia.com/default/topic/957757/gtx-1080-amp-kvm-pci-passthrough-to-guest/?offset=2#5033118



Is there anyway to debug this further?










share|improve this question


























    up vote
    3
    down vote

    favorite












    I believe we are running into a possible bug with the GTX 1080 (driver) and PCI Passthrough.



    My host is an Ubuntu 14.04 system.
    My guest is an Ubuntu 14.04/16.04 system (both do the same thing).



    I can see device inside the guest VM:



    lspci -vnn | grep VGA



    00:05.0 VGA compatible controller: NVIDIA Corporation Device 1b80 (rev
    a1)




    I was able to successfully install the driver (370.2, latest driver). It installs, but is not recognized by nvidia-smi:



    nvidia-smi 



    Unable to determine the device handle for GPU 0000:00:05.0: Unknown
    Error




    Looking in dmesg I see the following error message




    [ 29.535583] nvidia 0000:00:05.0: irq 45 for MSI/MSI-X [

    29.577727] NVRM: RmInitAdapter failed! (0x23:0x56:458) [ 29.577807] NVRM: rm_init_adapter failed for device bearing minor number 0




    I can switch out the GTX 1080 for a different card (M4000, do passthrough and install drivers on guest) and it works. I am going to try tomorrow with another Geforce card.



    Another person on the NVidia forums had the SAME exact issue as me (but no answer).



    https://devtalk.nvidia.com/default/topic/957757/gtx-1080-amp-kvm-pci-passthrough-to-guest/?offset=2#5033118



    Is there anyway to debug this further?










    share|improve this question
























      up vote
      3
      down vote

      favorite









      up vote
      3
      down vote

      favorite











      I believe we are running into a possible bug with the GTX 1080 (driver) and PCI Passthrough.



      My host is an Ubuntu 14.04 system.
      My guest is an Ubuntu 14.04/16.04 system (both do the same thing).



      I can see device inside the guest VM:



      lspci -vnn | grep VGA



      00:05.0 VGA compatible controller: NVIDIA Corporation Device 1b80 (rev
      a1)




      I was able to successfully install the driver (370.2, latest driver). It installs, but is not recognized by nvidia-smi:



      nvidia-smi 



      Unable to determine the device handle for GPU 0000:00:05.0: Unknown
      Error




      Looking in dmesg I see the following error message




      [ 29.535583] nvidia 0000:00:05.0: irq 45 for MSI/MSI-X [

      29.577727] NVRM: RmInitAdapter failed! (0x23:0x56:458) [ 29.577807] NVRM: rm_init_adapter failed for device bearing minor number 0




      I can switch out the GTX 1080 for a different card (M4000, do passthrough and install drivers on guest) and it works. I am going to try tomorrow with another Geforce card.



      Another person on the NVidia forums had the SAME exact issue as me (but no answer).



      https://devtalk.nvidia.com/default/topic/957757/gtx-1080-amp-kvm-pci-passthrough-to-guest/?offset=2#5033118



      Is there anyway to debug this further?










      share|improve this question













      I believe we are running into a possible bug with the GTX 1080 (driver) and PCI Passthrough.



      My host is an Ubuntu 14.04 system.
      My guest is an Ubuntu 14.04/16.04 system (both do the same thing).



      I can see device inside the guest VM:



      lspci -vnn | grep VGA



      00:05.0 VGA compatible controller: NVIDIA Corporation Device 1b80 (rev
      a1)




      I was able to successfully install the driver (370.2, latest driver). It installs, but is not recognized by nvidia-smi:



      nvidia-smi 



      Unable to determine the device handle for GPU 0000:00:05.0: Unknown
      Error




      Looking in dmesg I see the following error message




      [ 29.535583] nvidia 0000:00:05.0: irq 45 for MSI/MSI-X [

      29.577727] NVRM: RmInitAdapter failed! (0x23:0x56:458) [ 29.577807] NVRM: rm_init_adapter failed for device bearing minor number 0




      I can switch out the GTX 1080 for a different card (M4000, do passthrough and install drivers on guest) and it works. I am going to try tomorrow with another Geforce card.



      Another person on the NVidia forums had the SAME exact issue as me (but no answer).



      https://devtalk.nvidia.com/default/topic/957757/gtx-1080-amp-kvm-pci-passthrough-to-guest/?offset=2#5033118



      Is there anyway to debug this further?







      linux debugging gpu pci-passthrough






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 6 '16 at 23:15









      Kevin Vasko

      1859




      1859






















          3 Answers
          3






          active

          oldest

          votes

















          up vote
          1
          down vote



          accepted










          I had the same problem, I found the answer at https://www.evonide.com/non-root-gpu-passthrough-setup/. You need to add -cpu host,kvm=off to the qemu command line. I'm using ganeti, so the following fixed the problem:



          gnt-instance modify -H cpu_type="host,kvm=off"


          If I understand correctly this flag does not switch off KVM acceleration for the guest, that's switched on with -machine pc,accel=kvm. But it switches off nested KVM acceleration for the guest (so you won't be able to run a KVM virtual machine inside the guest).






          share|improve this answer





















          • This solved the issue.
            – Kevin Vasko
            Feb 10 '17 at 15:02


















          up vote
          1
          down vote













          I don't know if I have much to contribute, it seems to me that nvidia is actively sabotaging pci passthrough attempts (you are supposed to buy a Quadro card).



          Try faking the pci device ids by adding x-pci-vendor-id=0x10DE,x-pci-device-id=0x11BA,x-pci-sub-vendor-id=0x10DE,x-pci-sub-device-id=0x0965 to the -device vfio-pci, argument. This will make it pretend to be a Quadro K5000.






          share|improve this answer




























            up vote
            0
            down vote













            I fought this for a while, if the gpu is the only one in your system, you need to get grub and linux to leave it alone.
            I boot my machine with a serial console, BUT the key part is video=efifb:off



            GRUB_CMDLINE_LINUX="console=tty1 console=ttyS0,115200"
            GRUB_TERMINAL="console serial"
            GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"
            GRUB_CMDLINE_LINUX="quiet splash video=efifb:off intel_iommu=on console=ttyS0,115200"



            https://unix.stackexchange.com/questions/328534/driver-for-gtx-1080-doesnt-work-on-guest-when-using-kvm-pci-passthrough





            share|improve this answer








            New contributor




            Ben is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.


















              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "106"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              convertImagesToLinks: false,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: null,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














               

              draft saved


              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f328534%2fdriver-for-gtx-1080-doesnt-work-on-guest-when-using-kvm-pci-passthrough%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              1
              down vote



              accepted










              I had the same problem, I found the answer at https://www.evonide.com/non-root-gpu-passthrough-setup/. You need to add -cpu host,kvm=off to the qemu command line. I'm using ganeti, so the following fixed the problem:



              gnt-instance modify -H cpu_type="host,kvm=off"


              If I understand correctly this flag does not switch off KVM acceleration for the guest, that's switched on with -machine pc,accel=kvm. But it switches off nested KVM acceleration for the guest (so you won't be able to run a KVM virtual machine inside the guest).






              share|improve this answer





















              • This solved the issue.
                – Kevin Vasko
                Feb 10 '17 at 15:02















              up vote
              1
              down vote



              accepted










              I had the same problem, I found the answer at https://www.evonide.com/non-root-gpu-passthrough-setup/. You need to add -cpu host,kvm=off to the qemu command line. I'm using ganeti, so the following fixed the problem:



              gnt-instance modify -H cpu_type="host,kvm=off"


              If I understand correctly this flag does not switch off KVM acceleration for the guest, that's switched on with -machine pc,accel=kvm. But it switches off nested KVM acceleration for the guest (so you won't be able to run a KVM virtual machine inside the guest).






              share|improve this answer





















              • This solved the issue.
                – Kevin Vasko
                Feb 10 '17 at 15:02













              up vote
              1
              down vote



              accepted







              up vote
              1
              down vote



              accepted






              I had the same problem, I found the answer at https://www.evonide.com/non-root-gpu-passthrough-setup/. You need to add -cpu host,kvm=off to the qemu command line. I'm using ganeti, so the following fixed the problem:



              gnt-instance modify -H cpu_type="host,kvm=off"


              If I understand correctly this flag does not switch off KVM acceleration for the guest, that's switched on with -machine pc,accel=kvm. But it switches off nested KVM acceleration for the guest (so you won't be able to run a KVM virtual machine inside the guest).






              share|improve this answer












              I had the same problem, I found the answer at https://www.evonide.com/non-root-gpu-passthrough-setup/. You need to add -cpu host,kvm=off to the qemu command line. I'm using ganeti, so the following fixed the problem:



              gnt-instance modify -H cpu_type="host,kvm=off"


              If I understand correctly this flag does not switch off KVM acceleration for the guest, that's switched on with -machine pc,accel=kvm. But it switches off nested KVM acceleration for the guest (so you won't be able to run a KVM virtual machine inside the guest).







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Jan 18 '17 at 12:51









              Paul Tobias

              23524




              23524












              • This solved the issue.
                – Kevin Vasko
                Feb 10 '17 at 15:02


















              • This solved the issue.
                – Kevin Vasko
                Feb 10 '17 at 15:02
















              This solved the issue.
              – Kevin Vasko
              Feb 10 '17 at 15:02




              This solved the issue.
              – Kevin Vasko
              Feb 10 '17 at 15:02












              up vote
              1
              down vote













              I don't know if I have much to contribute, it seems to me that nvidia is actively sabotaging pci passthrough attempts (you are supposed to buy a Quadro card).



              Try faking the pci device ids by adding x-pci-vendor-id=0x10DE,x-pci-device-id=0x11BA,x-pci-sub-vendor-id=0x10DE,x-pci-sub-device-id=0x0965 to the -device vfio-pci, argument. This will make it pretend to be a Quadro K5000.






              share|improve this answer

























                up vote
                1
                down vote













                I don't know if I have much to contribute, it seems to me that nvidia is actively sabotaging pci passthrough attempts (you are supposed to buy a Quadro card).



                Try faking the pci device ids by adding x-pci-vendor-id=0x10DE,x-pci-device-id=0x11BA,x-pci-sub-vendor-id=0x10DE,x-pci-sub-device-id=0x0965 to the -device vfio-pci, argument. This will make it pretend to be a Quadro K5000.






                share|improve this answer























                  up vote
                  1
                  down vote










                  up vote
                  1
                  down vote









                  I don't know if I have much to contribute, it seems to me that nvidia is actively sabotaging pci passthrough attempts (you are supposed to buy a Quadro card).



                  Try faking the pci device ids by adding x-pci-vendor-id=0x10DE,x-pci-device-id=0x11BA,x-pci-sub-vendor-id=0x10DE,x-pci-sub-device-id=0x0965 to the -device vfio-pci, argument. This will make it pretend to be a Quadro K5000.






                  share|improve this answer












                  I don't know if I have much to contribute, it seems to me that nvidia is actively sabotaging pci passthrough attempts (you are supposed to buy a Quadro card).



                  Try faking the pci device ids by adding x-pci-vendor-id=0x10DE,x-pci-device-id=0x11BA,x-pci-sub-vendor-id=0x10DE,x-pci-sub-device-id=0x0965 to the -device vfio-pci, argument. This will make it pretend to be a Quadro K5000.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Jan 7 '17 at 0:37









                  krt0

                  111




                  111






















                      up vote
                      0
                      down vote













                      I fought this for a while, if the gpu is the only one in your system, you need to get grub and linux to leave it alone.
                      I boot my machine with a serial console, BUT the key part is video=efifb:off



                      GRUB_CMDLINE_LINUX="console=tty1 console=ttyS0,115200"
                      GRUB_TERMINAL="console serial"
                      GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"
                      GRUB_CMDLINE_LINUX="quiet splash video=efifb:off intel_iommu=on console=ttyS0,115200"



                      https://unix.stackexchange.com/questions/328534/driver-for-gtx-1080-doesnt-work-on-guest-when-using-kvm-pci-passthrough





                      share|improve this answer








                      New contributor




                      Ben is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                      Check out our Code of Conduct.






















                        up vote
                        0
                        down vote













                        I fought this for a while, if the gpu is the only one in your system, you need to get grub and linux to leave it alone.
                        I boot my machine with a serial console, BUT the key part is video=efifb:off



                        GRUB_CMDLINE_LINUX="console=tty1 console=ttyS0,115200"
                        GRUB_TERMINAL="console serial"
                        GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"
                        GRUB_CMDLINE_LINUX="quiet splash video=efifb:off intel_iommu=on console=ttyS0,115200"



                        https://unix.stackexchange.com/questions/328534/driver-for-gtx-1080-doesnt-work-on-guest-when-using-kvm-pci-passthrough





                        share|improve this answer








                        New contributor




                        Ben is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                        Check out our Code of Conduct.




















                          up vote
                          0
                          down vote










                          up vote
                          0
                          down vote









                          I fought this for a while, if the gpu is the only one in your system, you need to get grub and linux to leave it alone.
                          I boot my machine with a serial console, BUT the key part is video=efifb:off



                          GRUB_CMDLINE_LINUX="console=tty1 console=ttyS0,115200"
                          GRUB_TERMINAL="console serial"
                          GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"
                          GRUB_CMDLINE_LINUX="quiet splash video=efifb:off intel_iommu=on console=ttyS0,115200"



                          https://unix.stackexchange.com/questions/328534/driver-for-gtx-1080-doesnt-work-on-guest-when-using-kvm-pci-passthrough





                          share|improve this answer








                          New contributor




                          Ben is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.









                          I fought this for a while, if the gpu is the only one in your system, you need to get grub and linux to leave it alone.
                          I boot my machine with a serial console, BUT the key part is video=efifb:off



                          GRUB_CMDLINE_LINUX="console=tty1 console=ttyS0,115200"
                          GRUB_TERMINAL="console serial"
                          GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"
                          GRUB_CMDLINE_LINUX="quiet splash video=efifb:off intel_iommu=on console=ttyS0,115200"



                          https://unix.stackexchange.com/questions/328534/driver-for-gtx-1080-doesnt-work-on-guest-when-using-kvm-pci-passthrough






                          share|improve this answer








                          New contributor




                          Ben is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.









                          share|improve this answer



                          share|improve this answer






                          New contributor




                          Ben is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.









                          answered Nov 14 at 10:20









                          Ben

                          1




                          1




                          New contributor




                          Ben is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.





                          New contributor





                          Ben is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.






                          Ben is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                          Check out our Code of Conduct.






























                               

                              draft saved


                              draft discarded



















































                               


                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f328534%2fdriver-for-gtx-1080-doesnt-work-on-guest-when-using-kvm-pci-passthrough%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Morgemoulin

                              Scott Moir

                              Souastre