All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bob Chen <a175818323@gmail.com>
To: "Michael S. Tsirkin" <mst@redhat.com>
Cc: "Alex Williamson" <alex.williamson@redhat.com>,
	"Marcel Apfelbaum" <marcel@redhat.com>, 陈博 <chenbo02@meituan.com>,
	qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] About virtio device hotplug in Q35! 【外域邮件.谨慎查阅】
Date: Tue, 22 Aug 2017 15:04:55 +0800	[thread overview]
Message-ID: <CAMxP3BR=WHKJxcWKH27dcC7DTKGD2y7r12teAUSmMkwp1VDafA@mail.gmail.com> (raw)
In-Reply-To: <20170808230043-mutt-send-email-mst@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 2804 bytes --]

Hi,

I got a spec from Nvidia which illustrates how to enable GPU p2p in
virtualization environment. (See attached)

The key is to append the legacy pci capabilities list when setting up the
hypervisor, with a Nvidia customized capability config.

I added some hack in hw/vfio/pci.c and managed to implement that.

Then I found the GPU was able to recognize its peer, and the latency has
dropped. ✅

However the bandwidth didn't improve, but decreased instead. ❌

Any suggestions?


# p2pBandwidthLatencyTest in VM

[P2P (Peer-to-Peer) GPU Bandwidth Latency Test]

Device: 0, Tesla M60, pciBusID: 0, pciDeviceID: 15, pciDomainID:0

Device: 1, Tesla M60, pciBusID: 0, pciDeviceID: 16, pciDomainID:0

Device=0 CAN Access Peer Device=1

Device=1 CAN Access Peer Device=0

P2P Connectivity Matrix

     D\D     0     1

     0     1     1

     1     1     1

Unidirectional P2P=Disabled Bandwidth Matrix (GB/s)

   D\D     0      1

     0 114.04   5.33

     1   5.42 113.91

Unidirectional P2P=Enabled Bandwidth Matrix (GB/s)

   D\D     0      1

     0 113.93   4.13

     1   4.13 119.65

Bidirectional P2P=Disabled Bandwidth Matrix (GB/s)

   D\D     0      1

     0 120.50   5.55

     1   5.55 134.98

Bidirectional P2P=Enabled Bandwidth Matrix (GB/s)

   D\D     0      1

     0 135.45   5.03   # Even worse, used to be 10

     1   5.02 135.30

P2P=Disabled Latency Matrix (us)

   D\D     0      1

     0   5.74  15.61

     1  16.05   5.75

P2P=Enabled Latency Matrix (us)

   D\D     0      1

     0   5.47   8.23   # Improved, used to be 18

     1   8.06   5.46

2017-08-09 4:07 GMT+08:00 Michael S. Tsirkin <mst@redhat.com>:

> On Mon, Aug 07, 2017 at 09:52:24AM -0600, Alex Williamson wrote:
> > I wonder if it has something to do
> > with the link speed/width advertised on the switch port.  I don't think
> > the endpoint can actually downshift the physical link, so lspci on the
> > host should probably still show the full bandwidth capability, but
> > maybe the driver is somehow doing rate limiting.  PCIe gets a little
> > more complicated as we go to newer versions, so it's not quite as
> > simple as exposing a different bit configuration to advertise 8GT/s,
> > x16. Last I tried to do link matching it was deemed too complicated
> > for something I couldn't prove at the time had measurable value.  This
> > might be a good way to prove that value if it makes a difference here.
> > I can't think why else you'd see such a performance difference, but
> > testing to see if the KVM exit rate is significantly different could
> > still be an interesting verification.
>
> It might be easiest to just dust off that patch and see whether it
> helps.
>
> --
> MST
>

[-- Attachment #2: NVIDIAGPUDirectwithPCIPass-ThroughVirtualization.pdf --]
[-- Type: application/pdf, Size: 349330 bytes --]

  reply	other threads:[~2017-08-22  7:05 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4E0AFA5F-44D6-4624-A99F-68A7FE52F397@meituan.com>
     [not found] ` <4b31a711-a52e-25d3-4a7c-1be8521097d9@redhat.com>
     [not found]   ` <F99BFE80-FC15-40A0-BB3E-1B53B6CF9B05@meituan.com>
2017-07-26  6:21     ` [Qemu-devel] About virtio device hotplug in Q35! 【外域邮件.谨慎查阅】 Marcel Apfelbaum
2017-07-26 15:29       ` Alex Williamson
2017-07-26 16:06         ` Michael S. Tsirkin
2017-07-26 17:32           ` Alex Williamson
2017-08-01  5:04             ` Bob Chen
2017-08-01  5:46               ` Alex Williamson
2017-08-01  9:35                 ` Bob Chen
2017-08-01 14:39                   ` Michael S. Tsirkin
2017-08-01 15:01                   ` Alex Williamson
2017-08-07 13:00                     ` Bob Chen
2017-08-07 15:52                       ` Alex Williamson
2017-08-08  1:44                         ` Bob Chen
2017-08-08  8:06                           ` Bob Chen
2017-08-08 16:53                           ` Alex Williamson
2017-08-08 20:07                         ` Michael S. Tsirkin
2017-08-22  7:04                           ` Bob Chen [this message]
2017-08-22 16:56                             ` Alex Williamson
2017-08-22 18:06                               ` Michael S. Tsirkin
2017-08-29 10:41                                 ` Bob Chen
2017-08-29 14:13                                   ` Alex Williamson
2017-08-30  9:41                                     ` Bob Chen
2017-08-30 16:43                                       ` Alex Williamson
2017-09-01  9:58                                         ` Bob Chen
2017-11-30  8:06                                           ` Bob Chen
2017-08-07 13:04                     ` Bob Chen
2017-08-07 16:00                       ` Alex Williamson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMxP3BR=WHKJxcWKH27dcC7DTKGD2y7r12teAUSmMkwp1VDafA@mail.gmail.com' \
    --to=a175818323@gmail.com \
    --cc=alex.williamson@redhat.com \
    --cc=chenbo02@meituan.com \
    --cc=marcel@redhat.com \
    --cc=mst@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.