All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tao Wu <lepton@google.com>
To: qemu-devel@nongnu.org
Cc: Tao Wu <lepton@google.com>
Subject: [Qemu-devel] Proof of concept for GPU forwarding for Linux guest on Linux host
Date: Wed,  3 Apr 2019 20:39:11 -0700	[thread overview]
Message-ID: <20190404033912.47006-1-lepton@google.com> (raw)

Hi,

This is a proof of concept of GPU forwarding for Linux guest on Linux host.
I'd like to get comments and suggestions from community before I put more
time on it. To summarize what it is:

1. It's a solution to bring GPU acceleration for Linux vm guest on Linux host.
It could works with different GPU although the current proof of concept only
works with Intel GPU.

2. This shows as a kernel patch. The actual qemu diff is nested in 
tools/forward/qemu.diff

3. The basic idea is: under Linux, most applications use GPU acceleration with
help of MESA library. And MESA library interacts with kernel GPU driver by
operating on some special character device file exported by kernel GPU driver.
MESA library opens some special files in system and operations on GPU are done
by ioctl/mmap system call and regular memory operations.

We just write a kernel driver for guest Linux kernel and let it exports same
interface to user space like the real Linux GPU kernel driver. So it's an API proxy
between host and VM guest. We just proxy API at system call level. 

4. Some nasty things was done in guest kernel as a quick dirty hack so we don't need
to touch user space (wayland/mesa etc) now.

5. You can check tools/forward/README for instructions.

Thanks!

Tao Wu (1):
  proof of concept for GPU forwarding

 arch/x86/configs/x86_64_defconfig      |    5 +
 drivers/char/Makefile                  |    1 +
 drivers/char/forwarder/Makefile        |    8 +
 drivers/char/forwarder/forwarder.h     |  103 ++
 drivers/char/forwarder/forwarder_drv.c | 2104 ++++++++++++++++++++++++
 fs/open.c                              |   18 +
 include/uapi/linux/virtwl.h            |   64 +
 tools/forward/Makefile                 |    2 +
 tools/forward/README                   |   58 +
 tools/forward/qemu.diff                | 1117 +++++++++++++
 tools/forward/wayland-proxy-main.c     |   58 +
 tools/forward/wayland-proxy.c          |  297 ++++
 12 files changed, 3835 insertions(+)
 create mode 100644 drivers/char/forwarder/Makefile
 create mode 100644 drivers/char/forwarder/forwarder.h
 create mode 100644 drivers/char/forwarder/forwarder_drv.c
 create mode 100644 include/uapi/linux/virtwl.h
 create mode 100644 tools/forward/Makefile
 create mode 100644 tools/forward/README
 create mode 100644 tools/forward/qemu.diff
 create mode 100644 tools/forward/wayland-proxy-main.c
 create mode 100644 tools/forward/wayland-proxy.c

-- 
2.21.0.392.gf8f6787159e-goog

             reply	other threads:[~2019-04-04  3:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-04  3:39 Tao Wu [this message]
2019-04-04  3:39 ` [Qemu-devel] [PATCH 1/1] proof of concept for GPU forwarding Tao Wu
  -- strict thread matches above, loose matches on Subject: below --
2019-04-04  7:10 [Qemu-devel] Proof of concept for GPU forwarding for Linux guest on Linux host Andrew Randrianasulu
2019-04-04  7:33 ` Tao Wu(吴涛@Eng)
2019-04-04  7:44   ` Andrew Randrianasulu
2019-04-04  8:21     ` Tao Wu(吴涛@Eng)
2019-04-04 16:44     ` Dr. David Alan Gilbert

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=20190404033912.47006-1-lepton@google.com \
    --to=lepton@google.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.