ConfettiFX / The-Forge

The Forge Cross-Platform Rendering Framework PC Windows, Steamdeck (native), Ray Tracing, macOS / iOS, Android, XBOX, PS4, PS5, Switch, Quest 2
Apache License 2.0
4.71k stars 493 forks source link

Segmentation Fault on Linux through CodeLite at vkCreateInstance #201

Closed sierret closed 3 years ago

sierret commented 3 years ago

Running any of the cpp files from UbuntuUnitTests folder yields the following error:


2021-06-11 14:09:30 [MainThread ] Vulkan.cpp:2116 ERR| vkCreateInstance(&create_info, &gVkAllocationCallbacks, &(pRenderer->mVulkan.pVkInstance)): FAILED with VkResult: 4294967287 Failed: (false)

File: .../The-Forge/Common_3/Renderer/Vulkan/Vulkan.cpp Line: 2116

Segmentation fault Press ENTER to continue...


I tried switching compilers using the Cross GCC ( x86_64-linux-gnu ), GCC and gnu g++, but no change in output. Platform:

MX Linux(kernel v5.8.0-3-amd64) Intel(R) Core(TM) i5-9300HF 8GB RAM GTX 1650

wolfgangfengel commented 3 years ago

Thanks for reporting this. What driver do you use?

sierret commented 3 years ago

Driver Version: 460.32.03

wolfgangfengel commented 3 years ago

Sorry I am not very familiar with the Linux graphics stack. Is this a driver that is different from the one we are testing?

wolfgangfengel commented 3 years ago

In case you haven't seen it, this is the configuration that we are testing:

Ubuntu 18.04 LTS Kernel Version: 4.15.0-20-generic

GPU Drivers: AMD GPUs: we are testing on the Mesa RADV driver NVIDIA GPUs: we are testing with the NVIDIA driver Workspace file is provided for codelite 12.0.6

Vulkan SDK Version 1.1.108: download the native Ubuntu Linux package for all the elements of the Vulkan SDK LunarG Vulkan SDK Packages for Ubuntu 16.04 and 18.04

It is on the Github main page ...

sierret commented 3 years ago

Yes. I understand. I'm using the Nvidia driver on GTX 1650 Mobile.

I'm aware I'm not on Ubuntu 18.04 LTS Kernel Version: 4.15.0-20-generic. The MX Linux version I am on is based on the same version of Debian(Buster) and the kernel version shouldn't affect Cpp compiling and running(as far was I'm aware).

You think this could be the issue?

wolfgangfengel commented 3 years ago

I flag this for the next release. One of my colleagues will look into this.

sierret commented 3 years ago

I managed to fix the issue.

This was a NVIDIA driver problem. I was forced to downgrade from nvidia-driver=450.80.02-2~mx19+1 to nvidia-driver=418.181.07-1(required many dependencies to be downgraded one by one also to version 418.181.07-1). Also, installed libnvidia-glvkspirv=418.181.07-1, so vulkaninfo test command runs fine.

Anyone else with similar issues may need to prevent nvidia-driver and all dependencies packages from auto-upgrading, as I got issues with packages simply auto-upgrading back to version 450.80.02-2~mx19+1. I used "sudo apt-mark hold [package name] " directly after downgrade.You may also need to install nvidia-kernel-support=418.181.07-1(same version no).

I also installed the Vulkan SDK using the tarball. I'm not sure if the ubuntu LunarG Vulkan SDK works using the ppa repo but this is simply what I did. Instructions here:https://vulkan.lunarg.com/doc/sdk/1.1.108.0/linux/getting_started.html

Simply extract tarball. Be sure to add environment variables using "source ~/vulkan/1.1.xx.y/setup-env.sh" (temporary) or add to /home/[user]/.profile (permanent)