# What cause VK\_ERROR\_DEVICE\_LOST error?

**URL:** <https://community.khronos.org/t/what-cause-vk-error-device-lost-error/7474>\
**Category:** Vulkan\
**Created:** [April 16, 2018, 11:08am UTC](https://community.khronos.org/t/what-cause-vk-error-device-lost-error/7474 "2018-04-16T11:08:20Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Haiiro\_no\_Jiren](https://community.khronos.org/user_avatar/community.khronos.org/haiiro_no_jiren/32/5638_2.png) [@Haiiro\_no\_Jiren](https://community.khronos.org/u/Haiiro_no_Jiren)\
**Post date:** [April 16, 2018, 11:08am UTC](https://community.khronos.org/t/what-cause-vk-error-device-lost-error/7474/1 "2018-04-16T11:08:20Z")

</div>

There’s not problem when running vulkan program on Intel HD 530.But when i run on GTX 960M VK\_ERROR\_DEVICE\_LOST pop out.Could it because of driver bug?

---

<div class="post-metadata">

**Author:** ![krOoze](https://community.khronos.org/user_avatar/community.khronos.org/krooze/32/4393_2.png) [@krOoze](https://community.khronos.org/u/krOoze)\
**Post date:** [April 16, 2018, 1:06pm UTC](https://community.khronos.org/t/what-cause-vk-error-device-lost-error/7474/2 "2018-04-16T13:06:40Z")

</div>

Undefined behavior may result in `VK_ERROR_DEVICE_LOST`, notably bad synchronization.  
If the OS feels your async execution takes too long, that may also be `VK_ERROR_DEVICE_LOST`.  
HW failure such as overheating may cause this too.  
And of course driver bug is always a possibility too.

---

<div class="post-metadata">

**Author:** ![Haiiro\_no\_Jiren](https://community.khronos.org/user_avatar/community.khronos.org/haiiro_no_jiren/32/5638_2.png) [@Haiiro\_no\_Jiren](https://community.khronos.org/u/Haiiro_no_Jiren)\
**Post date:** [April 17, 2018, 5:55am UTC](https://community.khronos.org/t/what-cause-vk-error-device-lost-error/7474/3 "2018-04-17T05:55:58Z")

</div>

I hope it just driver bug

---

<div class="post-metadata">

**Author:** ![krOoze](https://community.khronos.org/user_avatar/community.khronos.org/krooze/32/4393_2.png) [@krOoze](https://community.khronos.org/u/krOoze)\
**Post date:** [April 17, 2018, 11:54am UTC](https://community.khronos.org/t/what-cause-vk-error-device-lost-error/7474/4 "2018-04-17T11:54:24Z")

</div>

I hope not. That’s practically the worst case situation.

---

<div class="post-metadata">

**Author:** ![Haiiro\_no\_Jiren](https://community.khronos.org/user_avatar/community.khronos.org/haiiro_no_jiren/32/5638_2.png) [@Haiiro\_no\_Jiren](https://community.khronos.org/u/Haiiro_no_Jiren)\
**Post date:** [April 17, 2018, 12:37pm UTC](https://community.khronos.org/t/what-cause-vk-error-device-lost-error/7474/5 "2018-04-17T12:37:03Z")

</div>

Why it’s worst case situation? I haven’t update the driver for almost a year.

---

<div class="post-metadata">

**Author:** ![krOoze](https://community.khronos.org/user_avatar/community.khronos.org/krooze/32/4393_2.png) [@krOoze](https://community.khronos.org/u/krOoze)\
**Post date:** [April 18, 2018, 4:59am UTC](https://community.khronos.org/t/what-cause-vk-error-device-lost-error/7474/6 "2018-04-18T04:59:29Z")

</div>

OK, that’s a wholly different story.

It would be the worst case, because it would affect everyone, and all you can do about it is write an ugly workaround (assuming you know exactly how the driver bug works).  
In contrast, bug in your app affects only you, and you can simply fix your code.

---

<div class="post-metadata">

**Author:** ![Haiiro\_no\_Jiren](https://community.khronos.org/user_avatar/community.khronos.org/haiiro_no_jiren/32/5638_2.png) [@Haiiro\_no\_Jiren](https://community.khronos.org/u/Haiiro_no_Jiren)\
**Post date:** [April 18, 2018, 3:20pm UTC](https://community.khronos.org/t/what-cause-vk-error-device-lost-error/7474/7 "2018-04-18T15:20:34Z")

</div>

I just figured out i forgot to reassign vk::BufferCopy::size to new buffer size before calling vk::CommandBuffer::copyBuffer.It works now.

---

<div class="post-metadata">

**Author:** ![Haiiro\_no\_Jiren](https://community.khronos.org/user_avatar/community.khronos.org/haiiro_no_jiren/32/5638_2.png) [@Haiiro\_no\_Jiren](https://community.khronos.org/u/Haiiro_no_Jiren)\
**Post date:** [April 18, 2018, 3:28pm UTC](https://community.khronos.org/t/what-cause-vk-error-device-lost-error/7474/8 "2018-04-18T15:28:51Z")

</div>

Mr krOoze can you suggest me a good resource for leaning vulkan.I’m currently leaning through trial and error.I’m not even sure what I’m doing is good method or not.

---

<div class="post-metadata">

**Author:** ![krOoze](https://community.khronos.org/user_avatar/community.khronos.org/krooze/32/4393_2.png) [@krOoze](https://community.khronos.org/u/krOoze)\
**Post date:** [April 18, 2018, 4:58pm UTC](https://community.khronos.org/t/what-cause-vk-error-device-lost-error/7474/9 "2018-04-18T16:58:51Z")

</div>

I am not the best person to ask. There were not many resources around when I started learning it.  
I pretty much used [this outline how to get a triangle on the screen](https://renderdoc.org/vulkan-in-30-minutes.html) and the Vulkan specification. So I may be biased, but I think the Vulkan specification itself is quite usable to learn.

Good thing about Vulkan is that it is relatively simple (“simple” as in math, not necessarily “simple” as “easy to learn”; if you know what I mean). Once you get a triangle on the screen you know like 80 % of the core functionality of Vulkan.

Vulkan has objects, and most of them have constant state during their lifetime – that IMO makes it easy to reason about, and learn the purpose of individual commands.

What is tricky to learn from the spec is the synchronization, and the shader interface. Then again, the synchronization chapter was much improved, while some of the available tutorials are still either silent, or confusing about this matter.

Problem with trial and error is the Undefined Behavior. The “error” is not always visible. As you witnessed, your app may work just fine, while still containing an error.  
There are the ` VK_LAYER_LUNARG_standard_validation` Validation Layers that everyone should use during development phase. But the coverage is not absolute – especially about synchronization errors. So, you can get away with trial and error, but it pays to learn the synchronization theory upfront and trying to avoid errors there.

---

<div class="post-metadata">

**Author:** ![khronos](https://community.khronos.org/user_avatar/community.khronos.org/khronos/32/2253_2.png) [@khronos](https://community.khronos.org/u/khronos)\
**Post date:** [April 19, 2018, 4:31am UTC](https://community.khronos.org/t/what-cause-vk-error-device-lost-error/7474/10 "2018-04-19T04:31:36Z")

</div>

> [@Haiiro no Jiren;43377](#):
>
> Mr krOoze can you suggest me a good resource for leaning vulkan.I’m currently leaning through trial and error.I’m not even sure what I’m doing is good method or not.

Perhaps one of these pages can help guide you to a good learning resource:

> **[Beginners Guide to Vulkan](https://www.khronos.org/blog/beginners-guide-to-vulkan)**
>
> Recently I asked the community for beginner-friendly resources on Vulkan, and I compiled a list of them that you can find below. For the beginners reading this, Vulkan is a new graphics API-- in other words, a way to communicate with your GPU and...

> <https://github.com/KhronosGroup/Khronosdotorg/blob/main/api/vulkan/resources.md>
