general high-level discussion about spectrum
 help / color / mirror / Atom feed
From: Thomas Leonard <talex5@gmail.com>
To: Alyssa Ross <hi@alyssa.is>
Cc: discuss@spectrum-os.org
Subject: Using virtio-gpu instead of virtwl
Date: Wed, 16 Mar 2022 16:18:52 +0000	[thread overview]
Message-ID: <CAG4opy8-WAJb2ZNbnhr8RpTw_V=up_zdOn3Hd-s=R5gKB91WBA@mail.gmail.com> (raw)
In-Reply-To: <20220315202339.6bqrzsf4yjkggbup@eve>

On Tue, 15 Mar 2022 at 20:23, Alyssa Ross <hi@alyssa.is> wrote:
>
> On Tue, Mar 15, 2022 at 02:06:04PM +0000, Alyssa Ross wrote:
> > On Sun, Mar 13, 2022 at 03:08:04PM +0000, Thomas Leonard wrote:
[ virtio-gpu ]
> > > I'm happy to test it now with Linux 5.16, but I think I need a newer
> > > crosvm too. Looks like support got added in
> > > https://github.com/google/crosvm/commit/231a54f36fbfb90ebac152d66f937af3644f6676,
> > > so it should be in 94.14150.
> > >
> > > Is there a new-enough package for crosvm available somewhere? NixOS
> > > only has 81.12871.0.0-rc1, and spectrum seems to be on
> > > 91.13904.0.0-rc2.
> >
> > I don't know of one.  I haven't been keeping it up to date since we've
> > mostly switched over to cloud-hypervisor for Spectrum, but it doesn't
> > have any way of doing virtio-gpu (yet, porting crosvm's vhost-user-gpu
> > implementation is on my list).
> >
> > I'll have a go at updating it in Nixpkgs and report back.
>
> Okay, here's a package for crosvm 99.14468.0.0-rc1:
> https://github.com/NixOS/nixpkgs/pull/164306

Thanks - that's very useful!

Testing it from NixOS stable, it crashed with

[ERROR:src/linux.rs:3264] child pcivirtio-block (pid 47933) died:
signo 17, status 11, code 2

In the journal, I saw:

[src/panic_hook.rs:90] thread 'virtio_blk' panicked at 'Failed to
create an executor: Uring(CreatingContext(Setup(12)))',
devices/src/virtio/block/asynchronous.rs:767:50

From a brief look at the code, it looks like crosvm sees that the host
is running Linux >= 5.10 and creates a test uring, which works. Then
it tries to create a real one, and that fails. I fixed it by
increasing the limit on locked memory in configuration.nix:

  security.pam.loginLimits = [
    {
      domain = "*";
      type = "-";
      item = "memlock";
      value = "64000";
    }
  ];

Then my VM booted and worked as before.

> I've tested some basic stuff, but haven't tested virtio-gpu.  I don't
> see any reason it wouldn't work, though.

I tried running with `crosvm --gpu`, but after `modprobe virtio-gpu`,
crosvm crashed with:

[   31.326763] Invalid ELF header magic: != ELF
[   31.331450] [drm] pci: virtio-gpu-pci detected at 0000:00:07.0
[   31.333020] [drm] Host memory window: 0x200000000 +0x200000000
[   31.333983] [drm] features: +virgl -edid +resource_blob +host_visible
[   31.333984] [drm] features: +context_init
[   31.337289] [drm] number of scanouts: 1
[   31.337938] [drm] number of cap sets: 1
[ERROR:src/linux.rs:3264] child pcivirtio-gpu (pid 63446) died: signo
17, status 11, code 2
[ERROR:devices/src/proxy.rs:212] failed write to child device process
pcivirtio-gpu: failed to send packet: Broken pipe (os error 32)

Then I tried with `--gpu=backend=2d` and that didn't crash, but
instead opened a window showing some bootloader stuff. I now have
/dev/dri/{card0, renderD128} devices, so I guess the next step is
figuring out what they do!

> Good luck!  Let me know if I can help with anything else.

If you happen to know of any documentation, that would be great. But I
guess I probably just need to spend a load of time reading crosvm,
Linux, and Sommelier source code.


-- 
talex5 (GitHub/Twitter)
http://roscidus.com/blog/

  reply	other threads:[~2022-03-16 16:19 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-05 19:27 New user getting started questions Thomas Leonard
2021-01-05 20:09 ` Michael Raskin
2021-01-06  7:04   ` Alyssa's break Alyssa Ross
2021-01-06  9:11     ` Michał "rysiek" Woźniak
2021-01-06  7:00 ` New user getting started questions Alyssa Ross
2021-01-06 15:56   ` Thomas Leonard
2021-01-07 11:38     ` Thomas Leonard
2021-01-07 15:33     ` Thomas Leonard
2021-01-14 12:29     ` Alyssa Ross
2021-01-14 12:51       ` Alyssa Ross
2021-01-20 13:04         ` Thomas Leonard
2021-01-27 17:31           ` Thomas Leonard
2021-03-07 12:52             ` Thomas Leonard
2021-03-09 16:59               ` Qubes-lite With KVM and Wayland Alyssa Ross
2021-03-10 14:19                 ` Thomas Leonard
2021-03-10 22:34                   ` Alyssa Ross
2021-03-09 16:25             ` New user getting started questions Alyssa Ross
2021-03-13  7:21               ` Thomas Leonard
2021-03-13 13:52                 ` Alyssa Ross
2021-10-30 12:58                 ` Thomas Leonard
2021-11-03 11:36                   ` Alyssa Ross
2021-11-03 18:27                     ` Thomas Leonard
2021-11-10 12:58                       ` Alyssa Ross
2021-11-10 12:00                         ` Thomas Leonard
2021-11-11 11:09                           ` Alyssa Ross
2021-11-11 16:12                             ` Thomas Leonard
2021-11-12 10:47                               ` Alyssa Ross
2022-03-13 15:08                         ` Thomas Leonard
2022-03-15 14:06                           ` Alyssa Ross
2022-03-15 20:23                             ` Alyssa Ross
2022-03-16 16:18                               ` Thomas Leonard [this message]
2022-03-16 16:54                                 ` Using virtio-gpu instead of virtwl Alyssa Ross
2022-03-21 12:10                                 ` Thomas Leonard
2022-03-21 16:05                                   ` Alyssa Ross
2022-03-22 11:08                                     ` Thomas Leonard
2022-03-22 11:16                                       ` Alyssa Ross
2022-03-22 20:05                                         ` Thomas Leonard
2022-04-06 12:19                                           ` Thomas Leonard
2022-04-13 17:12                                             ` Thomas Leonard
2022-04-14 13:57                                               ` Alyssa Ross
2022-04-19 12:58                                                 ` Thomas Leonard
2022-04-19 12:01                                                   ` Alyssa Ross
2022-05-15 15:20                                                 ` Thomas Leonard
2022-05-16 11:55                                                   ` Alyssa Ross
2022-05-18  9:55                                                     ` Thomas Leonard
2022-06-05 16:29                                                       ` Thomas Leonard
2022-08-09 12:00                                     ` Alyssa Ross
2022-10-10 15:16                                       ` Thomas Leonard
2022-10-10 16:53                                         ` Alyssa Ross

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='CAG4opy8-WAJb2ZNbnhr8RpTw_V=up_zdOn3Hd-s=R5gKB91WBA@mail.gmail.com' \
    --to=talex5@gmail.com \
    --cc=discuss@spectrum-os.org \
    --cc=hi@alyssa.is \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).