Jump to content
  • Advertisement
Sign in to follow this  
Cararasu

Weird freezes on Linux with Vulkan

Recommended Posts

Hello Everyone!

A few days ago I had a very interesting problem in one of my projects and I want to share the weirdness that happened.
A little bit of background: I am writing a renderer in Vulkan, which runs on both Windows and Linux. Most of the time I develope on Windows on my desktop PC but sometimes when I am away I switch to my Laptop with Ubuntu 18.04 LTS.
Last week I turned on my Laptop and started programming. Everything was fine the program ran well and no error was shown. Not even from the Vulkan validation layer. When I exited the program suddenly my OS froze. No response at all. No keystroke/key-combination was recognized, the mouse did not move, nothing. The only thing that worked was pressing the good old power-button and killing the system.
When rebooting everything worked fine again. So I continued programming. I changed a few things and restarted my program. After ~3 times the same freeze happened again. This pattern repeated a few times. Sometimes it worked sometimes my system would freeze on closing the window. It was quite strange, as this should not really happen.
So I went looking for a solution. My first thought was looking into log files to maybe track down the problem. /var/log/syslog would stop writing the moment the system freezes. There are a bunch of null bytes in the file but that seems to be normal in case of a crash. kernel.log and Xorg.0.log are the same. No entry the moment the system freezes.
My next thought was maybe the driver is at fault. I had a Nvidia GTX 950M with the nvidia-410 driver. I kicked out the driver and installed the version 396. Reboot and my program still freezes everything on exit. Same with driver version 415.
At this point, I tried nailing down where the freeze happened by enabling all logging messages in my program. To make it faster I also switched from debug-build to release build. I ran my program and it exited fine. I tried a bunch of times and there was no crash, no error, and no freezing.
That was strange so I switched back to my debug-build and it froze the system. One reboot later I just rebuild the whole program instead of doing an incremental build and since then I had no freezes at all. WTF? How?

So that was 3 hours of debugging that confused the hell out of me. Even if one of the object files was broken in some way it should not lock up the whole OS that way. I have no idea what the problem was and my complete rebuild deleted all object files so I can not recreate the behavior.

So yeah, that was one of the 2 ways I brought down my OS with this project, which I wanted to share.😉

Share this post


Link to post
Share on other sites
Advertisement

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!