From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE,WEIRD_PORT autolearn=unavailable autolearn_force=no version=3.4.6 Received: by atuin.qyliss.net (Postfix, from userid 496) id 60E6D61A55; Wed, 16 Mar 2022 16:19:38 +0000 (UTC) Received: from atuin.qyliss.net (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id 4132461A1E; Wed, 16 Mar 2022 16:19:13 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 496) id 654B36197E; Wed, 16 Mar 2022 16:19:10 +0000 (UTC) Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by atuin.qyliss.net (Postfix) with ESMTPS id 766E96197D for ; Wed, 16 Mar 2022 16:19:06 +0000 (UTC) Received: by mail-lj1-x22e.google.com with SMTP id q5so3773512ljb.11 for ; Wed, 16 Mar 2022 09:19:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=VZNWWcZ8LWYFJtxT4oyTs8mTMA3MVcKTLzy6dftrnBE=; b=RDUYEVb4o+DaIlK1PxernvTjL2Z0d46M7DZMZ6GamF0ACiUiWOVkrF2Kswyvb1yd42 cGX/NzLN7kphPYJ3simNB5/egtp3HQo4kCmnyUetx0QwGIsY+D5Ca6A6vrT+rWvySGSl PUEc89T7Jy+uIn0VzCd6XvnKRQAhRrva8eut4jYDdGVNntPfz17b2Gk/ZrV29NvifpOu bcX2FWUj9+pBkjJ0hDwx+ty7GxdOV7RZAvMJy+j2m19bnVYJbTlxiPQlkkV+F9i7Xj1Y 9PTXVqArbNiNZK6nFQT/347VA28by+jChI6cmqd6HiVySNygGQTpUB1XmsH7iENGtF6n 0FBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=VZNWWcZ8LWYFJtxT4oyTs8mTMA3MVcKTLzy6dftrnBE=; b=cmi86plkXXfq3PMXzdEvoPpzo5HlJxcIvpF/gmDvaTpwU27/v/XyBT7f7CDJYe3TX5 V+7zqGqQHD63/+zHzwaS0DDMl7aofSGJv57DtY6C494PRcEAUnMuzGw24yXTitHLIwWH QuF/KZzEV0Do9qoojn13+gCWPUvmvPLYwI5rdBNM6t2Yyxc4Jitqoi28xQnpu61QRPs1 cjIflo6+eRFVT6TaUG+cu4+UJZ4n+RQwE3DqDBbw03qoqcGCBSkifIg0mOFXPXKfglbK jlbDjIkI56A6UryD/BY4x9VeQot4NVxxWGEqT0tbXPnkwY7NehiIQ+Grty369Mce1csE 2dxw== X-Gm-Message-State: AOAM533f5UiMqDrjZfsFHZQTtffuUea1kvbIOox+WuJhIiLxTsv+DB7v szEE/90BlTivQokTE4EaDciZjDvndn8f3VfVWhY= X-Google-Smtp-Source: ABdhPJxgXXaCYu885yoyrCxteBJc4X8J9HMsaZZPuSJbgKiR7c0ZRge3AehX5tqvYsjpliu+qLFBCbP+fkMhkpbCwhw= X-Received: by 2002:a2e:3609:0:b0:249:44a7:dc7b with SMTP id d9-20020a2e3609000000b0024944a7dc7bmr273945lja.82.1647447544200; Wed, 16 Mar 2022 09:19:04 -0700 (PDT) MIME-Version: 1.0 References: <20210309162556.ctiy3yfp7plkbdqs@x220.qyliss.net> <87o871tqqu.fsf@alyssa.is> <87bl2sp3p3.fsf@alyssa.is> <20220315140604.ta433j557jsoknkv@eve> <20220315202339.6bqrzsf4yjkggbup@eve> In-Reply-To: <20220315202339.6bqrzsf4yjkggbup@eve> From: Thomas Leonard Date: Wed, 16 Mar 2022 16:18:52 +0000 Message-ID: Subject: Using virtio-gpu instead of virtwl To: Alyssa Ross Content-Type: text/plain; charset="UTF-8" Message-ID-Hash: ZHM3BF6DZTR6BYRRHHC7HXXYVQJQSS4Y X-Message-ID-Hash: ZHM3BF6DZTR6BYRRHHC7HXXYVQJQSS4Y X-MailFrom: talex5@gmail.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1; header-match-discuss.spectrum-os.org-0; header-match-discuss.spectrum-os.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: discuss@spectrum-os.org X-Mailman-Version: 3.3.5 Precedence: list List-Id: General high-level discussion about Spectrum Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Tue, 15 Mar 2022 at 20:23, Alyssa Ross 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/