# Native\_SDK Vulkan examples run failed

**URL:** <https://forums.imgtec.com/t/native-sdk-vulkan-examples-run-failed/3725>\
**Category:** PowerVR Insider\
**Created:** [June 14, 2023, 6:11am UTC](https://forums.imgtec.com/t/native-sdk-vulkan-examples-run-failed/3725 "2023-06-14T06:11:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![slamdunk315](https://avatars.discourse-cdn.com/v4/letter/s/f05b48/32.png) [@slamdunk315](https://forums.imgtec.com/u/slamdunk315)\
**Post date:** [June 14, 2023, 6:11am UTC](https://forums.imgtec.com/t/native-sdk-vulkan-examples-run-failed/3725/1 "2023-06-14T06:11:31Z")

</div>

Hello,  
In ubuntu18.04 I have built Native\_SDK(cmake … -DPVR\_WINDOW\_SYSTEM=X11) , and all the OpenGLES and OpenCL sample code can run successfully. But all the Vulkan examples are failed to run.

Here is th _VulkanHelloAPI_ running log:

```auto
Native_SDK$ ./bin/VulkanHelloAPI 
Host library 'libvulkan.so' loaded
MESA-INTEL: warning: Performance support disabled, consider sysctl dev.i915.perf_stream_paranoid=0

INFORMATION: ------------Properties for Physical Devices--------------
INFORMATION: Device Name: Intel(R) UHD Graphics 630 (CML GT2)
INFORMATION: Device ID: 0x9BC8
INFORMATION: Device Driver Version: 0x5402006
INFORMATION: --------------------------------------
INFORMATION: Device Name: llvmpipe (LLVM 12.0.0, 256 bits)
INFORMATION: Device ID: 0x0
INFORMATION: Device Driver Version: 0x1
INFORMATION: --------------------------------------
INFORMATION: Device Name: NVIDIA GeForce GT 730
INFORMATION: Device ID: 0x1287
INFORMATION: Device Driver Version: 0x75AD80C0
INFORMATION: --------------------------------------
INFORMATION: Active Device is -- Intel(R) UHD Graphics 630 (CML GT2)
X Error of failed request: BadDrawable (invalid Pixmap or Window parameter)
  Major opcode of failed request: 149 ()
  Minor opcode of failed request: 4
  Resource id in failed request: 0x4600006
  Serial number of failed request: 37
  Current serial number in output stream: 43

```

how to fix the error “X Error of failed request: BadDrawable (invalid Pixmap or Window parameter)”

Thanks

---

<div class="post-metadata">

**Author:** ![AlejandroC](https://avatars.discourse-cdn.com/v4/letter/a/97f17d/32.png) [@AlejandroC](https://forums.imgtec.com/u/AlejandroC)\
**Post date:** [June 14, 2023, 10:21am UTC](https://forums.imgtec.com/t/native-sdk-vulkan-examples-run-failed/3725/2 "2023-06-14T10:21:51Z")

</div>

Hi slamdunk315,

As a first step, you could check whether you have Vulkan support on your current Linux setup on your machine. Please go to [LunarXchange](https://vulkan.lunarg.com/sdk/home#linux) and download the Vulkan SDK. Then please run the vulkaninfo executable to see support and capabilities. Also there is a basic Vulkan application in `Bin/vkcube` you can try to test if it runs correctly.

After a bit of googling the error you are experiencing _X Error of failed request: BadDrawable (invalid Pixmap or Window parameter)_, I have read several cases seem related with driver version ([Invalid pixelmap or window parameter · Issue #2232 · carla-simulator/carla · GitHub](https://github.com/carla-simulator/carla/issues/2232)). Please try to update both Intel and NVIDIA GPU drivers, and if it does not work, try with older, different versions.

Also it seems the issue could be related with some extensions not available in the GPU being used, which is the Intel one ([~eliasnaur/gio#347: examples fail with BadDrawable (invalid Pixmap or Window parameter) — sourcehut todo](https://todo.sr.ht/~eliasnaur/gio/347)). You can try running the VulkanHelloAPI demo on the NVIDIA GPU. For that you will need to change code in `VulkanHelloAPI::getCompatibleDevice()` to force returning as `VkPhysicalDevice` the _other one_ not being selected.

Let me know if after those tests you still have any issues,

Best regards,  
Alejandro

---

<div class="post-metadata">

**Author:** ![slamdunk315](https://avatars.discourse-cdn.com/v4/letter/s/f05b48/32.png) [@slamdunk315](https://forums.imgtec.com/u/slamdunk315)\
**Post date:** [June 19, 2023, 9:03am UTC](https://forums.imgtec.com/t/native-sdk-vulkan-examples-run-failed/3725/3 "2023-06-19T09:03:12Z")

</div>

Hi Alejandro,

Thanks for your reply.

Firstly ,I tried Vulkan SDK `Bin/vkcube` and it runs correctly. So the Vulkan is supported?

Then I change the code like this:  
`if (deviceProperties.deviceType == VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU )`  
the ./bin/VulkanHelloAPI runs correctly!

```auto
Native_SDK$ ./bin/VulkanHelloAPI 
Host library 'libvulkan.so' loaded
MESA-INTEL: warning: Performance support disabled, consider sysctl dev.i915.perf_stream_paranoid=0

INFORMATION: ------------Properties for Physical Devices--------------
INFORMATION: Device Name: Intel(R) UHD Graphics 630 (CML GT2)
INFORMATION: Device ID: 0x9BC8
INFORMATION: Device Driver Version: 0x5402006
INFORMATION: --------------------------------------
INFORMATION: Device Name: llvmpipe (LLVM 12.0.0, 256 bits)
INFORMATION: Device ID: 0x0
INFORMATION: Device Driver Version: 0x1
INFORMATION: --------------------------------------
INFORMATION: Device Name: NVIDIA GeForce GT 730
INFORMATION: Device ID: 0x1287
INFORMATION: Device Driver Version: 0x75AD80C0
INFORMATION: --------------------------------------
INFORMATION: Active Device is -- NVIDIA GeForce GT 730

```

So the APP runs on NVIDIA GPU correctly.

Another question is ,I find code `getCompatibleDevice` only located in VulkanHelloAPI.cpp and VulkanIntroducingPVRShell.cpp.

If want to run other samples,maybe modify some other code?

---

<div class="post-metadata">

**Author:** ![AlejandroC](https://avatars.discourse-cdn.com/v4/letter/a/97f17d/32.png) [@AlejandroC](https://forums.imgtec.com/u/AlejandroC)\
**Post date:** [June 19, 2023, 11:06am UTC](https://forums.imgtec.com/t/native-sdk-vulkan-examples-run-failed/3725/4 "2023-06-19T11:06:10Z")

</div>

Hi slamdunk315,

Regarding `Bin/vkcube` it seems Vulkan is supported but I can’t tell whether it was run on you Intel or your NVIDIA GPU.

Good to know you found another way to make _VulkanHelloAPI_ work. Regarding `getCompatibleDevice()`, we only use it on the _VulkanHelloAPI_ example which is an API introductory example. In our SDK we have our own Vulkan framework used for all other Vulkan examples. I recommend to read _VulkanIntroducingPVRShell_, _VulkanIntroducingPVRUtils_ and _VulkanIntroducingPVRVk_ examples to understand our framework.

In most of the Vulkan examples in our SDK we select the first physical device found and verify it has all extensions required for the example. You can see in the `initView()` method in each example code like `_deviceResources->instance->getPhysicalDevice(0)` with `0` being the index of the physical device chosen. You can change the code to force the NVIDIA GPU. For those demos using ray tracing (_HelloRayTracing, HybridHardShadows, HybridReflections, HybridRefractions, HybridSoftShadows, HybridTransparency, RayTracedHardShadows_ and _RayTracingDenoising_), we select only the GPU that supports ray tracing at hardware level.

Please let me know if you have any other questions.

Best regards,  
Alejandro

---

<div class="post-metadata">

**Author:** ![slamdunk315](https://avatars.discourse-cdn.com/v4/letter/s/f05b48/32.png) [@slamdunk315](https://forums.imgtec.com/u/slamdunk315)\
**Post date:** [June 20, 2023, 3:37am UTC](https://forums.imgtec.com/t/native-sdk-vulkan-examples-run-failed/3725/5 "2023-06-20T03:37:58Z")

</div>

Hi Alejandro,

I will take more effort to study SDK sample code.

Thanks very much.
