Skia Vulkan

1,119 views
Skip to first unread message

Jeff Moguillansky

unread,
Oct 19, 2016, 12:58:33 PM10/19/16
to skia-discuss
Hi,
I would like to evaluate skia/Vulkan.
How do I run nanobench with Vulkan backend?  
How do I run the SampleApp, and the unit tests?

I followed these instructions: https://skia.org/user/special/vulkan

Thanks,
Jeff

E. Greg Daniel

unread,
Oct 19, 2016, 1:03:12 PM10/19/16
to skia-discuss
Hey Jeff,

Assuming you were able to compile skia with vulkan support as described on that page, most things should behave as they did before. In tools like nanobench or dm you trigger vulkan with '--config vk'. Vulkan is not supported on SampleApp, but it does work with our new Viewer app if you want to give that one a try.

Greg

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.
To post to this group, send email to skia-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/skia-discuss.
For more options, visit https://groups.google.com/d/optout.

Jeff Moguillansky

unread,
Oct 19, 2016, 2:02:14 PM10/19/16
to skia-discuss
Thank you Greg for the quick response!
I got nanobench working with vk backend.  How do I run the viewer app?  Does it work on Linux PC?

Thanks,
Jeff

E. Greg Daniel

unread,
Oct 19, 2016, 2:14:59 PM10/19/16
to skia-discuss
The same way you built nanobench you should be able to build viewer but with the target being "viewer" (or Viewer if that doesn't work). Then just run it with out/<Debug,Release>/viewer. 

On Linux sadly it doesn't support switching backends in the app (some bug involving going from a GL to vulkan surface), so you can just run with the additional "-b vk" argument and it will just start in vulkan. All other things should work and you can press 'h' in the app to see what things are available.

Greg

Jim Van Verth

unread,
Oct 19, 2016, 4:16:37 PM10/19/16
to skia-discuss
The viewer should switch backends -- it just creates a new window to do so. If that's not working, let me know. But if you know what you want, -b on the command line is a better choice.



On Wed, Oct 19, 2016 at 2:14 PM, 'E. Greg Daniel' via skia-discuss <skia-d...@googlegroups.com> wrote:
The same way you built nanobench you should be able to build viewer but with the target being "viewer" (or Viewer if that doesn't work). Then just run it with out/<Debug,Release>/viewer. 

On Linux sadly it doesn't support switching backends in the app (some bug involving going from a GL to vulkan surface), so you can just run with the additional "-b vk" argument and it will just start in vulkan. All other things should work and you can press 'h' in the app to see what things are available.

Greg
On Wed, Oct 19, 2016 at 2:02 PM Jeff Moguillansky <jmog...@gmail.com> wrote:
Thank you Greg for the quick response!
I got nanobench working with vk backend.  How do I run the viewer app?  Does it work on Linux PC?

Thanks,
Jeff

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss+unsubscribe@googlegroups.com.

To post to this group, send email to skia-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/skia-discuss.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss+unsubscribe@googlegroups.com.

Sergey Kipet

unread,
Nov 23, 2016, 4:51:46 AM11/23/16
to skia-discuss
Hi,

Have the same goal as the topicstarter does.

Unfortunately, got no luck with running either 'nanobench' or 'viewer' app (thanks for announcing the latter by the way). Particularly, in both of the cases -9 error code (AFAICS it stands for VK_ERROR_INCOMPATIBLE_DRIVER) is returned despite I have a Vulkan enabled Open Source 3D Graphics Driver properly installed (as well as LunarG Vulkan API SDK) and capable to run some freely distributed demo apps designed for using by the Vulkan API.

Would appreciate any directions from you side capable to manage the problem.

OS: Ububtu 16.04 LTS (x86_64)
GPU Chipset: Intel® HD Graphics 530 (Skylake GT2)
GPU Driver: i915-4.6.3-4.4.0-dkms

Thanks in advance.

BRs,
Sergey Kipet.

среда, 19 октября 2016 г., 23:16:37 UTC+3 пользователь Jim Van Verth написал:
The viewer should switch backends -- it just creates a new window to do so. If that's not working, let me know. But if you know what you want, -b on the command line is a better choice.


On Wed, Oct 19, 2016 at 2:14 PM, 'E. Greg Daniel' via skia-discuss <skia-d...@googlegroups.com> wrote:
The same way you built nanobench you should be able to build viewer but with the target being "viewer" (or Viewer if that doesn't work). Then just run it with out/<Debug,Release>/viewer. 

On Linux sadly it doesn't support switching backends in the app (some bug involving going from a GL to vulkan surface), so you can just run with the additional "-b vk" argument and it will just start in vulkan. All other things should work and you can press 'h' in the app to see what things are available.

Greg
On Wed, Oct 19, 2016 at 2:02 PM Jeff Moguillansky <jmog...@gmail.com> wrote:
Thank you Greg for the quick response!
I got nanobench working with vk backend.  How do I run the viewer app?  Does it work on Linux PC?

Thanks,
Jeff

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.

To post to this group, send email to skia-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/skia-discuss.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "skia-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss...@googlegroups.com.

Greg Daniel

unread,
Nov 23, 2016, 8:57:34 AM11/23/16
to skia-discuss
Hey,

So we currently have not yet started testing our Vulkan backend on an intel GPU, though it is on our shortlist of where to extend next. As a side note, it also currently crashes on AMD and we're investigating that.

In the mean time maybe I can help debug the issue. Do you know what call is returning the incompatible driver error (I assume it is createInstance)? Can you send us the info in the structs passed to the failing call? In the case of createInstance those would be VkInstanceCreateInfo and the the inner struct VkApplicationInfo.

Thanks for your help in fixing this,
Greg

Greg Daniel

unread,
Nov 23, 2016, 8:58:08 AM11/23/16
to skia-discuss
Also, can you send the driver and SDK version that you are using.

Sergey Kipet

unread,
Nov 23, 2016, 12:42:05 PM11/23/16
to skia-discuss
Hey Greg,

Thanks for your feedback. Well, I see now...

Regarding the inquiry of yours, I've just put some traces into the source code and rebuilt Skia, so I guess I could assist you on this. Please, consider the following output obtained:

((c51a3a4...))skipet@skipet-PC:~/yas/skia$ grep -ir --include=\*.cpp --include=\*.hpp --include=\*.h "vkCreateInstance failed"
src
/gpu/vk/GrVkBackendContext.cpp:        SkDebugf("vkCreateInstance failed: %d\n", err);
((c51a3a4...))skipet@skipet-PC:~/yas/skia$
((c51a3a4...))skipet@skipet-PC:~/yas/skia$ out/Debug/nanobench --config gpu[api=vulkan]
Timer overhead: 68ns
Fixed number of loops; times would only be misleading so we won't print them.
vkCreateInstance failed: -9
while calling "err = vkCreateInstance(&instance_create, nullptr, &inst);"
where:
    sType: "1"
    pNext: "(nil)"
    flags: "0"
    pApplicationInfo (inner struct):
        sType: "0"
        pNext: "(nil)"
        pApplicationName: "vktest"
        applicationVersion: "0"
        pEngineName: "vktest"
        engineVersion: "0"
        apiVersion: "4194312"
    enabledLayerNameCount: "7"
    ppEnabledLayerNames: "VK_LAYER_GOOGLE_threading"
    enabledExtensionNameCount: "3"
    ppEnabledExtensionNames: "VK_EXT_debug_report"
No context was available matching config type and options.

As for the SDK version installed:

((c51a3a4...))skipet@skipet-PC:~/yas/skia$ echo $VULKAN_SDK
/home/skipet/VulkanSDK/1.0.26.0/x86_64

And I'm not really sure how to get exact version of those installed open-source drivers. Although, this was exactly the Intel Graphics Installer 1.4.0 for Linux I used to get them (either Mesa for 3D or Cairo for 2D, as well as other associated and required libraries), which is available from right here.

In case of any other either assistance or info from my side is required, just let me know. Thank you.

BRs,
Sergey Kipet.


среда, 23 ноября 2016 г., 16:58:08 UTC+3 пользователь Greg Daniel написал:

Greg Daniel

unread,
Nov 23, 2016, 12:50:39 PM11/23/16
to skia-discuss
Thanks for getting back Sergey,

Okay. In GrVkBackendContext.cpp line 37, can you trying changing it to VK_MAKE_VERSION_(1, 0, 0); You will also need to make sure that SK_ENABLE_VK_LAYERS is not defined since the ones we use require the slightly higher version.

Make those changes and see if you can get pass the vkCreateInstance step.

Greg

Sergey Kipet

unread,
Nov 24, 2016, 9:30:44 AM11/24/16
to skia-discuss
Hey Greg,

Sorry for the bit belated response (I guess we both are in different time zones, thus, may have some conversation delays because of this).

Well, thank you once again for your directions provided earlier. Yep, I've finally succeeded in passing the vkCreateInstance step, but, unfortunately (or even fortunately), faced another one preventing me from going forward (either with 'nanobench' or 'viewer'). Please, consider the following output I've got this time:

1.

((c51a3a4...))skipet@skipet-PC:~/yas/skia$ out/Debug/nanobench --config gpu[api=vulkan]
Timer overhead: 50.9ns

Fixed number of loops; times would only be misleading so we won
't print them.
../../../../../src/intel/vulkan/anv_device.c:414: FINISHME: Get correct values for VkPhysicalDeviceLimits
 182/182 MB    Xfermode_Luminosity    
../../../../../src/intel/vulkan/anv_device.c:414: FINISHME: Get correct values for VkPhysicalDeviceLimits
 197/197 MB    Xfermode_Luminosity_aa    
../../../../../src/intel/vulkan/anv_device.c:414: FINISHME: Get correct values for VkPhysicalDeviceLimits
 201/201 MB    Xfermode_Color    
../../../../../src/intel/vulkan/anv_device.c:414: FINISHME: Get correct values for VkPhysicalDeviceLimits
 203/203 MB    Xfermode_Color_aa    
...
// a lot of similar warnings
...
 109/214 MB    shapes_rect_inner_rect_500_32x32    
../../../../../src/intel/vulkan/anv_device.c:414: FINISHME: Get correct values for VkPhysicalDeviceLimits
*** Error in `out/Debug/nanobench'
: malloc(): memory corruption: 0x0000000005805ed0 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f6433e657e5]
...
// a lot of backtrace details
...
// a lot of memory map details
...
7fffddfd8000-7fffddff9000 rw-p 00000000 00:00 0                          [stack]Aborted (core dumped)


2.

((c51a3a4...))skipet@skipet-PC:~/yas/skia$ out/Debug/viewer -b vk
Command line arguments: -b vk
../../../../../src/intel/vulkan/anv_device.c:414: FINISHME: Get correct values for VkPhysicalDeviceLimits
Segmentation fault (core dumped)

Any thoughts/suggestions/inquiries are welcomed as always. :-)

Thank you for you support.

P.S.
BTW, what is the general use of the 'nanobench' performance tool (got a few info on it in case of using Skia main web portal)? What is the best way of getting use of it (benchmark metrics, etc.)?

BRs,
Sergey Kipet.


среда, 23 ноября 2016 г., 20:50:39 UTC+3 пользователь Greg Daniel написал:

Jim Van Verth

unread,
Nov 28, 2016, 11:11:41 AM11/28/16
to skia-discuss
The "FINISHME: Get correct values for VkPhysicalDeviceLimits" message is coming from the driver. I don't know that it's all that informative unless Skia is depending on a value that is not correct. Can you see where it's crashing in a debugger? Is there full backtrace info for nanobench?

One way we use nanobench is to time SKPs which are recorded from webpages (see https://www.chromium.org/developers/how-tos/trace-event-profiling-tool/saving-skp-s-from-chromium). So this command line would do that, assuming your skp files are stored in ./skps:

out/Release/nanobench --config gpu --skps ./skps --match skp

Comparing times before and after a change gives relative times for that change. However, nanobench doesn't always give consistent numbers on mobile devices, so we're creating skpbench to get better timing numbers. You might be okay on Intel, I'm not sure.

Out of curiosity, have you gotten Vulkan running with other things? For example, can you run the samples provided in the SDK? (VulkanSDK/1.0.26.0/Samples, or whatever your SDK path may be)

Sergey Kipet

unread,
Dec 13, 2016, 11:22:44 AM12/13/16
to skia-discuss
Hi Jim,

Really sorry for taking so long with the reply. Although I've just updated my local Skia repo as well as the open source Intel graphics driver, unfortunately, still have no luck with running the nanobench tool. Please, have a look into the attached file (with the gdb output as well as full backtrace included). Hope this can tell you more.

Thanks for making things clearer regarding the nanobench usage in your team. Will definitely keep in mind that.

Yep, I've got successful Vulkan running (e.g. I'm capable to run most of the 3D samples from Sascha Willems with the same warning messages populated while each run - "../../../../../src/intel/vulkan/anv_device.c:414: FINISHME: Get correct values for VkPhysicalDeviceLimits").

Please, don't hesitate to ask for more assistance (if required).

BRs,
Sergey Kipet.

понедельник, 28 ноября 2016 г., 19:11:41 UTC+3 пользователь Jim Van Verth написал:
nanobench_config_vk_intel_crash_bt.out

Jim Van Verth

unread,
Dec 13, 2016, 12:31:33 PM12/13/16
to skia-discuss
It looks like we may have an issue on Intel chips where either we are not freeing memory correctly, or the driver isn't freeing the memory we request it to for some reason. We have a Skylake NUC coming in tomorrow to test on -- once that's set up I'll take a look.

Sergey Kipet

unread,
Dec 13, 2016, 12:59:28 PM12/13/16
to skia-d...@googlegroups.com
Hey Jim,

Yeah, it looks so (at least the output says so). Sounds good. Would appreciate it much if you share results of your trial with the Intel Skylake family chip.

Thanks.

BRs,
Sergey Kipet.

To unsubscribe from this group and stop receiving emails from it, send an email to skia-discuss+unsubscribe@googlegroups.com.

To post to this group, send email to skia-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/skia-discuss.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to a topic in the Google Groups "skia-discuss" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/skia-discuss/uUQZTQkf-r8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to skia-discuss+unsubscribe@googlegroups.com.

To post to this group, send email to skia-d...@googlegroups.com.
Visit this group at https://groups.google.com/group/skia-discuss.
For more options, visit https://groups.google.com/d/optout.



--
BRs,
Sergey Kipet
Reply all
Reply to author
Forward
0 new messages