X11 or qrexec integration failing with copied fedora template with nvidia drivers

I am confused by the following:

  1. In Qubes v4.1.2, create a new template VM from the fedora-38 template, and set it to use the image-provided kernel and HVM mode.

  2. Launch this new template by running a terminal.

  3. While in the template, enable rpmfusion-nonfree (dnf config-manager —set-enabled rpmfusion-nonfree). Install akmod-nvidia and wait for it to finish building the kernel module (wait until the top command shows the VM is idle).

  4. Shut down the template.

  5. Start the template. Try to start a terminal—it will never happen. Try to start an xterm using qvm-run and the command will never complete.

I don’t know how to debug this. I don’t see any problems in the qrexec logs. Any thoughts? Is this reproducible for others?

Update: HVM is not needed to reproduce the issue. Installing akmod-nvidia in a PVH VM is enough.

Update: also happens with a fedora-37 template.

In a domU console:

I tried isolating the domU packages. The problem happens when I install akmod-nvidia and its immediate dependencies (the cuda and xorg libraries). The problem does not happen with just akmods, for example.

I tried diffing /etc before and after installing the package, but nothing interesting seemed to change.

I tried running strace on the xterm command, but I could find no obvious problem.

I tried restarting some of the domU qrexec services, but that had no effect.

Where do I go from here? How do I make sure domU qrexec and X11 integrations are healthy?