Closed hissssst closed 1 year ago
What compositor are you using on your host?
I see these errors in my logs too from time to time. Not sure what causes it. 0x1200
is VIRTIO_GPU_RESP_ERR_UNSPEC
, which is rather unhelpful:
crosvm maps various errors to that:
GpuResponse::ErrUnspec => VIRTIO_GPU_RESP_ERR_UNSPEC,
GpuResponse::ErrTube(_) => VIRTIO_GPU_RESP_ERR_UNSPEC,
GpuResponse::ErrBase(_) => VIRTIO_GPU_RESP_ERR_UNSPEC,
GpuResponse::ErrRutabaga(_) => VIRTIO_GPU_RESP_ERR_UNSPEC,
GpuResponse::ErrDisplay(_) => VIRTIO_GPU_RESP_ERR_UNSPEC,
GpuResponse::ErrMapping(_) => VIRTIO_GPU_RESP_ERR_UNSPEC,
GpuResponse::ErrUdmabuf(_) => VIRTIO_GPU_RESP_ERR_UNSPEC,
GpuResponse::ErrScanout { num_scanouts: _ } => VIRTIO_GPU_RESP_ERR_UNSPEC,
Probably worth adding some extra debug to log the original problem.
Does the proxy always fail for you, or just sometimes?
What compositor are you using on your host?
$ sway --version
sway version 1.8.1
Not sure what causes it. 0x1200 is VIRTIO_GPU_RESP_ERR_UNSPEC, which is rather unhelpful:
I've traced it to. https://github.com/torvalds/linux/blob/bb7c241fae6228e89c0286ffd6f249b3b0dea225/drivers/gpu/drm/virtio/virtgpu_vq.c#L221 So yeah, it's one of those. Perhaps changing it to
GpuResponse::ErrUnspec => VIRTIO_GPU_RESP_ERR_UNSPEC + 0x100,
GpuResponse::ErrTube(_) => VIRTIO_GPU_RESP_ERR_UNSPEC + 0x101,
GpuResponse::ErrBase(_) => VIRTIO_GPU_RESP_ERR_UNSPEC + 0x102,
GpuResponse::ErrRutabaga(_) => VIRTIO_GPU_RESP_ERR_UNSPEC + 0x103,
GpuResponse::ErrDisplay(_) => VIRTIO_GPU_RESP_ERR_UNSPEC + 0x104,
GpuResponse::ErrMapping(_) => VIRTIO_GPU_RESP_ERR_UNSPEC + 0x105,
GpuResponse::ErrUdmabuf(_) => VIRTIO_GPU_RESP_ERR_UNSPEC + 0x106,
GpuResponse::ErrScanout { num_scanouts: _ } => VIRTIO_GPU_RESP_ERR_UNSPEC + 0x107,
may help to find the exact error
Probably worth adding some extra debug to log the original problem.
How do I do this?
Does the proxy always fail for you, or just sometimes?
Always fails
I rebased my crosvm branch on version 113 and attempted to add some debugging here: https://gitlab.com/talex5/crosvm/-/commit/05a90f3e66cfcc584d15ee810cd117ac0d00b9a3
Does that do anything?
[2023-05-14T22:01:26.985453558+04:00 ERROR devices::virtio::sys::unix::net] net: tx: failed to write frame to tap: Input/output error (os error 5)
[2023-05-14T22:01:26.992337430+04:00 ERROR devices::virtio::sys::unix::net] net: tx: failed to write frame to tap: Input/output error (os error 5)
[2023-05-14T22:01:27.040260463+04:00 WARN devices::virtio::gpu::protocol] Returning VIRTIO_GPU_RESP_ERR_UNSPEC for error ErrRutabaga(IoError(Os { code: 13, kind: PermissionDenied, message: "Permission denied" }))
[ 2.516511] [drm:virtio_gpu_dequeue_ctrl_func [virtio_gpu]] *ERROR* response 0x1200 (command 0x207)
I think it is somehow related to me being unable to mount shared directory into crosvm as virtiofs. It fails with exactly same exception
Well, it should be easy enough to trace crosvm and find out where the EACCES
is coming from.
How do I do this?
I have reproduced it with this setup too: https://github.com/astro/microvm.nix
How do I do this?
I'm not an expert on Rust or crosvm, but maybe strace
on one of the processes would do it? Probably the parent process, since I disabled the GUI sandbox for debugging. Could be a permissions problem with the graphics device.
You might need to prevent it from using io_uring to give useful results, though. Not sure how to do that, but there's a use_uring
function in common/cros_asyncv2/src/unix/io_driver/uring.rs
that looks like it could be modified easily.
I have reproduced it with this setup too: https://github.com/astro/microvm.nix
Looks like an interesting project - I should probably use that instead of my hacky scripts!
I've managed to get it running. For some reason, running your script as a root created some permission problems, while running it as a user was impossible because mktuntap
required cap_net_admin
.
I've managed to wrap cap_net_admin
with nixos's builtin capability wrapper and running your script as a regular user was successful without any rutabaga exception.
However, I am still experiencing these exceptions, though UI works correctly:
[2023-05-20T16:53:31.538355063+04:00 ERROR devices::virtio::sys::unix::net] net: tx: failed to write frame to tap: Input/output error (os error 5)
Ah, I create the tap devices in my configuration.nix
. mktuntap
just opens them. See the example at https://roscidus.com/blog/blog/2021/03/07/qubes-lite-with-kvm-and-wayland/#thoughts-on-nixos.
I've tried to set up your qubes-lite gitlab project, and after some tweaking came across this issue
When called in guest
But after this error, wayland-proxy-virtwl doesn't stop working and every try to run any wayland program generates the same error, like
I have pinned nixpkgs to be the same as my host version, otherwise loading mesa drivers failed with incompatible
GLIBC_VERSION
error