<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p><br>
    </p>
    <div class="moz-cite-prefix"> On 2022-11-08 18:35, Gert Wollny
      wrote:<br>
    </div>
    <blockquote type="cite"
      cite="mid:58bcf58d5493fa235cbf15855b628e8005b6f7cb.camel@gmail.com">
      <pre class="moz-quote-pre" wrap="">Hello, 

On Sun, 2022-11-06 at 11:33 -0800, Rob Clark wrote:
</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">On Fri, Nov 4, 2022 at 1:42 AM Taylor Viktor <a class="moz-txt-link-rfc2396E" href="mailto:sysescool@gmail.com"><sysescool@gmail.com></a>
wrote:
</pre>
        <blockquote type="cite">
          <pre class="moz-quote-pre" wrap="">
Dear Developers:

I am referring to this document
<a class="moz-txt-link-freetext" href="https://docs.mesa3d.org/drivers/venus.html#vtest">https://docs.mesa3d.org/drivers/venus.html#vtest</a> to develop vulkan
related functions, but every time I run vulkaninfo or vkcube some
errors occur.

virgl_test_server prints the following:

    gl_version 46 - core profile enabled
    vtest_client_dispatch_commands: client context created.
    client failed: VTEST_CLIENT_ERROR_INPUT_READ

Running vulkaninfo prints the following:

    WARNING: [Loader Message] Code 0 : terminator_CreateInstance: Failed to CreateInstance in ICD 0.  Skipping ICD.
    Cannot create Vulkan instance.
    This problem is often caused by a faulty installation of the Vulkan driver or attempting to use a GPU that does not support Vulkan.
    ERROR at ./vulkaninfo/vulkaninfo.h:649:vkCreateInstance failed with ERROR_INCOMPATIBLE_DRIVER

Running vkcube prints the following:

    Cannot find a compatible Vulkan installable client driver (ICD).
    Please look at the Getting Started guide for additional information.

After debugging, I found that the error occurred when calling the system function 
    res = read(fd, ptr, left) 
in the 
    vtest_block_read(struct vtest_input *input, void *buf, int size) 
function, it returned 0 to the variable res, 
but The variable left passed in is 8. This is only true if(res == left).


<span class="gmail-md-plain" style="box-sizing:border-box">And I checked the Requirements by running below command:
  vulkaninfo | grep "Vulkan Instance Version"
  vulkaninfo | grep VK_EXT_external_memory_dma_buf
  vulkaninfo | grep VK_EXT_image_drm_format_modifier
  vulkaninfo | grep VK_EXT_queue_family_foreign
  uname -r
the output:
    Vulkan Instance Version: 1.3.204
    VK_EXT_external_memory_dma_buf            : extension revision 1
    VK_EXT_image_drm_format_modifier          : extension revision 2
    VK_EXT_queue_family_foreign                       : extension revision 1
    5.15.0-52-generic

Except the graphics card is GTX 1060 3GB, I think my other requirements are met. 
I use vtest, which can ignore the kernel version according to the documentation.

When you were testing, what versions of virglrenderer and mesa were you using? 
  If you guys know, please let me know and I will try it again.

If you don't know the specific version, can you give me some debugging or method suggestions?

Looking forward to your reply, thank you very much
</span></pre>
        </blockquote>
        <pre class="moz-quote-pre" wrap="">
I'm not sure about the venus/vk case, but I got the same error when
trying to use virgl+vtest the other day.  I think this must have
broken semi-recently, but didn't try to bisect or figure out if the
issue was in mesa or virglrenderer
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">
The error message 
   "client failed: VTEST_CLIENT_ERROR_INPUT_READ" 
is also emitted when the guest client exits normally, this is a bit
unfortunate, but IMSMR it was not possible to distinguish between the
client just finishing or whether something had gone wrong with the file
descriptor. 

AFAIR this has been printed since the beginning, and OpenGL should just
work fine (it does for me), but gives above sever side output.

As for Venus, for me I can run vulkaninfo just fine, and for vkcube I
get a client side error, complete client side output is:


  ./vkcube
  1 physical devices
  vendor id 1002, device name Virtio-GPU Venus (AMD Radeon RX 6700 XT 
(RADV NAVI22))
  vkcube: ../src/virtio/vulkan/vn_queue.c:164:
  vn_queue_submission_prepare: 
   Assertion `!submit->wsi_mem->base_memory && submit->wsi_mem-
</pre>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">base_bo' failed.
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">Aborted

(The same assertion is triggered on Intel)

You can also try these server side options: 

   --no-fork and --multi-client

They make no difference for me, I just know that at the beginning they
were needed. 

Hope that helps, 
Gert 

</pre>
    </blockquote>
    <p>Thank you,  Gert.<br>
      <br>
      I've added the entire previous letter to show the full error and
      problem.<br>
      * Do you remember the version of virglrenderer and mesa you were
      using? *<br>
    </p>
    <p>I tried something to handle:</p>
    <p>1. I downloaded the source from KhronosGroup/Vulkan-Tools and
      compiled it with version tag v1.3.204.<br>
      * Is the normal operation of mesa and virglrenderer related to the
      version of Vulkan-Tools? *<br>
       i) dll.fp_vkEnumerateInstanceVersion(&instance_version) in
      struct AppInstance::AppInstance() return version: 4206796<br>
           I am not sure if this version number is correct.<br>
      ii) socket established and closed at line<br>
                   VkResult err =
      dll.fp_vkCreateInstance(&inst_info, nullptr, &instance); <br>
           and which returned the error VK_ERROR_INCOMPATIBLE_DRIVER.<br>
    </p>
    2. I tried with command strace to trace vulkaninfo, and noticed that
    there is a shutdown system call close the socket normally.<br>
    (BTW, ltrace didn't work with vulkaninfo to trace
    libvulkan_virtio.so)<br>
    However, after socket close, the virglrenderer still keep reading
    from the fd and the reason why is <br>
              client->in_fd_ready = true. in
    vtest_server_wait_clients(void) in file vtest_server.c<br>
    <p>3. I tried --no-fork and --multi-client too. They make no
      difference for me too, and there is still error.<br>
    </p>
    <p>4. something unrelated but not mentioned<br>
    </p>
    <p>** The biggest problem currently bothering me is: I don't have a
      good way to trace calls to libvulkan_virtio.so **<br>
      any suggestion?<br>
    </p>
    <p>BR<br>
      -S<br>
    </p>
  </body>
</html>