Support hotplug PCIe in q35#2410
Conversation
|
Thanks for raising @Jimmy-Xu, but the build is failing: Also, please note that we require commits in a particular format which includes a "Fixes: #XXX" reference to a GitHub issue - see: |
|
@Jimmy-Xu thanks for raising this but there is something that doesn't make sense to me
did you enable |
@devimc Test 1: Test 2: Then I checked the following documents So I want to add |
@amshinde |
@jodh-intel I will create a issue for this. |
|
@Jimmy-Xu thanks for answering |
|
@Jimmy-Xu kata-containers/govmm#116 was merged |
devimc
left a comment
There was a problem hiding this comment.
thanks @Jimmy-Xu , two things:
- I guess you forgot to re-vendor govmm (please do it in a separate commit and include a shortlog, see [a])
- please fix your commit messages, see [b]
[a] - https://github.com/kata-containers/community/blob/master/CONTRIBUTING.md#re-vendor-prs
[b] - https://github.com/kata-containers/community/blob/master/CONTRIBUTING.md#examples
bbdb8d6 to
c08acaf
Compare
Update github.com/intel/govmm.
shortlog:
cab4709 qemu: Add pcie-root-port device support.
Fixes: kata-containers#2432
Signed-off-by: Jimmy Xu <junming.xjm@antfin.com>
|
@Jimmy-Xu I havent looked at the PR yet too closely, but see the need for supporting hotplug of pcie root ports. |
7b6284b to
95aa4f9
Compare
@devimc Done. Thanks for review! |
@amshinde OK, I will update the doc. |
37b233b to
01e251f
Compare
b100cd8 to
0087853
Compare
|
@devimc updated again. travis-ci/pr passed. |
devimc
left a comment
There was a problem hiding this comment.
thanks @Jimmy-Xu , lgtm, I'd like to wait for @jodh-intel 's review
|
/test |
|
@Jimmy-Xu Since you have recently gone through the exercise about adding support for Nvidia GPUs, can you add documentation for it, similar to what we have here: |
|
@Jimmy-Xu I think it is caused from "IsPCIe":false returned from isPCIeDevice. It looks like /sys/bus/pci/slots/ enumerates the "hotplug" slot, but in my case, it wasn't created. Below is my Host machine status. |
@wansuyoo The above error you are seeing is because the hotplug is being done on the pcie root bus. If you want to go with PCIe hotplug, you need to set runtime/cli/config/configuration-qemu.toml.in Line 232 in ee01fa8 so that the hotplug happens on the pcie root port instead. You would need the above steps in case you are interested in PCIe hotplug. In case PCI hotplug suits your use case you can go the the default |
|
@amshinde Show kata-collect-data.sh details
Meta detailsRunning Runtime is
|
|
@wansuyoo I think the pcie hotplug driver |
|
@amshinde. Below is from my system. |
|
@wansuyoo If the directory @wansuyoo We now have a wip PR for hotplugging Nvidia GPUs for your reference: kata-containers/documentation#615 |
|
Thank you for your kindly documentation for using Nvidia GPU with Kata-containers. But, I have another problem. Is there anything I missed that I should do? |
|
@amshinde @Jimmy-Xu Please guide me how to apply this in Kata-containers. |
|
@wansuyoo here documented how it works: kata-containers/documentation#615 this doc PR has been approved and will be merged once the CI passed |
|
@amshinde I think you are right. @wansuyoo I think we can try to add runtime/virtcontainers/qemu_amd64.go Line 130 in 2d89766 |
|
Yes, Nvidia GeForce GT 1030 card is not a large BAR device. So, I have configured like as you mentioned above. Also, for set KVM hidden option at qemu of kata, I tested with runtime added #2547 PR. runtime/virtcontainers/qemu_amd64.go Line 132 in 2d89766 Is there additional configure to enable this nestedRun option? |
|
@wansuyoo I had updated the PR, nestedRun is not required. Please try again. |
|
@Jimmy-Xu |
|
@wansuyoo Because Kata runtime will parse the devices info in iommu group for VFIO devices. FYI: |
|
@Jimmy-Xu But, for installing nvidia module in container, I have to set privileged option when create container. |
|
@Jimmy-Xu |
|
@wansuyoo You are seeing all vfio devices being passed to the container, as in privileged case all host devices are passed to the container. We have addressed this behaviour in CRI runtimes(containerd and crio) to not pass host devices to the container in case of privileged, but a similar PR to do this is still pending in docker: moby/moby#39702 Meanwhile, can you try running the container with "--cap-add all" as : to install the nvidia driver. I suspect you would need just elevated capabilities and not a full blown privielged container. Let me know if that works for you. Also, as the documentation provided by @Jimmy-Xu says, you can build a guest kernel with all the Nvidia drivers. Any reason why that doesnt work for you? |
Yes, it is working when adding capabilities to container with "--cap-add=ALL" option.
You are right. I can install Nvidia driver on container created within guest(os and kernel). |
Do you want to load the Nvidia driver when starting the Kata container? I think when building the guest rootfs, the Nvidia driver( Then you need to run
To load Nvidia driver when starting Kata container:
Other reference: I hope it is helpful for you. |
|
@wansuyoo let us know if you cannot load the kernel modules using annotations, maybe you will see this issue kata-containers/agent#709 |
Issue
Some Nvidia GPUs (such as the Tesla P100) are Large BAR Space (>4GB) PCIe devices.
I can passthrough it to the kata container by adding
--device=/dev/vfio/xxx.When I use machine_type
pc, then I runlspciin a kata container:So I use machine_type
q35, but when I run the kata container, the following error occurs:Bus 'pcie.0' does not support hotplugging: unknown"Solution
This PR is used to append pcie-root-port device to the qemu command line, then the PCIe device can be hot-plugged into pcie-root-port.
Fix Issue : #2432
Rely to PR: kata-containers/govmm#116
REF: https://github.com/qemu/qemu/blob/master/docs/pcie.txt