Unable to run SunTemple with Vulkan on Ubuntu 16.04 from UE4 built from source

Hello,

I hope this is the correct place to post this, I didn’t see a ‘Troubleshooting’ or ‘Linux’ forum. I built the UE 4.19 engine from Source, so I think that qualifies this.

I have been attempting to get SunTemple to run on Ubuntu 16.04 with Vulkan for a while now and am at a loss as to how to proceed. I moved the project files over from a Win10 box and rebuilt on Ubuntu. I can run the built sample with OGL and it runs as expected, but when I start the demo with the SunTemple.sh file (using the ‘-vulkan’ agrument) I see this error before the demo closes:

[2018.03.20-22.43.30:689] 0]LogOutputDevice: Error: === Handled ensure: ===
[2018.03.20-22.43.30:689] 0]LogOutputDevice: Error:
[2018.03.20-22.43.30:689] 0]LogOutputDevice: Error: Ensure condition failed: (ImageCreateInfo.usage & VK_IMAGE_USAGE_SAMPLED_BIT) == 0 [File:/media/test/Linux Workloads/UnrealEngine/Engine/Source/Runtime/VulkanRHI/Private/VulkanTexture.cpp] [Line: 354]
[2018.03.20-22.43.30:689] 0]LogOutputDevice: Error:
[2018.03.20-22.43.30:689] 0]LogOutputDevice: Error: Stack:
[2018.03.20-22.43.30:689] 0]LogOutputDevice: Error: [Callstack] 0x0000000002231eb5 FLinuxPlatformStackWalk::CaptureStackBackTrace(unsigned long long*, unsigned int, void*)
[2018.03.20-22.43.30:689] 0]LogOutputDevice: Error: [Callstack] 0x000000000211b7b5 FGenericPlatformStackWalk::StackWalkAndDump(char*, unsigned long, int, void*)
[2018.03.20-22.43.30:689] 0]LogOutputDevice: Error: [Callstack] 0x0000000002231e69 FLinuxPlatformStackWalk::StackWalkAndDumpEx(char*, unsigned long, int, unsigned int, void*)
[2018.03.20-22.43.30:689] 0]LogOutputDevice: Error: [Callstack] 0x00000000022796c2 FDebug::EnsureFailed(char const*, char const*, int, wchar_t const*)
[2018.03.20-22.43.30:689] 0]LogOutputDevice: Error: [Callstack] 0x0000000002279cda FDebug::OptionallyLogFormattedEnsureMessageReturningFalse(bool, char const*, char const*, int, wchar_t const*, …)
[2018.03.20-22.43.30:689] 0]LogOutputDevice: Error: [Callstack] 0x00000000036f2579 FVulkanSurface::CreateImage(FVulkanDevice&, VkImageViewType, EPixelFormat, unsigned int, unsigned int, unsigned int, bool, unsigned int, unsigned int, unsigned int, unsigned int, VkMemoryRequirements&, VkFormat*, VkFormat*, VkImageCreateInfo*, bool)
[2018.03.20-22.43.30:689] 0]LogOutputDevice: Error: [Callstack] 0x00000000036f27c3 FVulkanSurface::FVulkanSurface(FVulkanDevice&, VkImageViewType, EPixelFormat, unsigned int, unsigned int, unsigned int, bool, unsigned int, unsigned int, unsigned int, unsigned int, FRHIResourceCreateInfo const&)
[2018.03.20-22.43.30:689] 0]LogOutputDevice: Error: [Callstack] 0x00000000036f5f4d FVulkanTextureBase::FVulkanTextureBase(FVulkanDevice&, VkImageViewType, EPixelFormat, unsigned int, unsigned int, unsigned int, bool, unsigned int, unsigned int, unsigned int, unsigned int, FRHIResourceCreateInfo const&)
[2018.03.20-22.43.30:689] 0]LogOutputDevice: Error: [Callstack] 0x00000000036f360a FVulkanDynamicRHI::RHICreateTexture2D(unsigned int, unsigned int, unsigned char, unsigned int, unsigned int, unsigned int, FRHIResourceCreateInfo&)
[2018.03.20-22.43.30:689] 0]LogOutputDevice: Error: [Callstack] 0x00000000037d049a FDynamicRHI::RHICreateTexture2D_RenderThread(FRHICommandListImmediate&, unsigned int, unsigned int, unsigned char, unsigned int, unsigned int, unsigned int, FRHIResourceCreateInfo&)
[2018.03.20-22.43.30:689] 0]LogOutputDevice: Error: [Callstack] 0x0000000004c05c6b FTexture2DResource::InitRHI()
[2018.03.20-22.43.30:689] 0]LogOutputDevice: Error: [Callstack] 0x00000000037f5899 FRenderResource::InitResource()
[2018.03.20-22.43.30:689] 0]LogOutputDevice: Error: [Callstack] 0x00000000037fd382 /media/test/Linux Workloads/Projects/SunTemple/LinuxNoEditor/Engine/Binaries/Linux/UE4Game() [0x37fd382]
[2018.03.20-22.43.30:689] 0]LogOutputDevice: Error: [Callstack] 0x0000000002140ccc FNamedTaskThread::ProcessTasksNamedThread(int, bool)
[2018.03.20-22.43.30:689] 0]LogOutputDevice: Error: [Callstack] 0x000000000214016e FNamedTaskThread::ProcessTasksUntilQuit(int)
[2018.03.20-22.43.30:689] 0]LogOutputDevice: Error: [Callstack] 0x00000000037f1085 RenderingThreadMain(FEvent*)
[2018.03.20-22.43.30:689] 0]LogOutputDevice: Error: [Callstack] 0x0000000003800ea2 FRenderingThread::Run()
[2018.03.20-22.43.30:690] 0]LogOutputDevice: Error: [Callstack] 0x0000000002176697 FRunnableThreadPThread::Run()
[2018.03.20-22.43.30:690] 0]LogOutputDevice: Error: [Callstack] 0x000000000215563a FRunnableThreadPThread::_ThreadProc(void*)
[2018.03.20-22.43.30:690] 0]LogOutputDevice: Error: [Callstack] 0x00007f6f6be536ba /lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba) [0x7f6f6be536ba]
[2018.03.20-22.43.30:690] 0]LogOutputDevice: Error: [Callstack] 0x00007f6f6acb641d /lib/x86_64-linux-gnu/libc.so.6(clone+0x6d) [0x7f6f6acb641d]

Checking the cpp file/line that is specified in the error, I see this line:

ensure((ImageCreateInfo.usage & VK_IMAGE_USAGE_SAMPLED_BIT) == 0);
ImageCreateInfo.usage &= ~VK_IMAGE_USAGE_SAMPLED_BIT;

If I try to launch UE with the ‘-vulkan’ flag I get the following error before it closes:

[2018.03.20-23.08.07:011] 0]LogOutputDevice: Error: === Handled ensure: ===
[2018.03.20-23.08.07:011] 0]LogOutputDevice: Error:
[2018.03.20-23.08.07:011] 0]LogOutputDevice: Error: Ensure condition failed: MemoryProperties.memoryTypes[TypeIndices[Index]].heapIndex == HeapIndex [File:/media/test/Linux Workloads/UnrealEngine/Engine/Source/Runtime/VulkanRHI/Private/VulkanMemory.cpp] [Line: 772]
[2018.03.20-23.08.07:011] 0]LogOutputDevice: Error:
[2018.03.20-23.08.07:011] 0]LogOutputDevice: Error: Stack:
[2018.03.20-23.08.07:011] 0]LogOutputDevice: Error: [Callstack] 0x00007f3060b92f05 FLinuxPlatformStackWalk::CaptureStackBackTrace(unsigned long long*, unsigned int, void*)
[2018.03.20-23.08.07:011] 0]LogOutputDevice: Error: [Callstack] 0x00007f3060a41c25 FGenericPlatformStackWalk::StackWalkAndDump(char*, unsigned long, int, void*)
[2018.03.20-23.08.07:011] 0]LogOutputDevice: Error: [Callstack] 0x00007f3060b92ea1 FLinuxPlatformStackWalk::StackWalkAndDumpEx(char*, unsigned long, int, unsigned int, void*)
[2018.03.20-23.08.07:011] 0]LogOutputDevice: Error: [Callstack] 0x00007f3060be3e9b FDebug::EnsureFailed(char const*, char const*, int, wchar_t const*)
[2018.03.20-23.08.07:011] 0]LogOutputDevice: Error: [Callstack] 0x00007f3060be471a FDebug::OptionallyLogFormattedEnsureMessageReturningFalse(bool, char const*, char const*, int, wchar_t const*, …)
[2018.03.20-23.08.07:011] 0]LogOutputDevice: Error: [Callstack] 0x00007f2f8999e790 VulkanRHI::FResourceHeapManager::Init()
[2018.03.20-23.08.07:011] 0]LogOutputDevice: Error: [Callstack] 0x00007f2f8999cc9f FVulkanDevice::InitGPU(int)
[2018.03.20-23.08.07:011] 0]LogOutputDevice: Error: [Callstack] 0x00007f2f899cedd0 FVulkanDynamicRHI::InitInstance()
[2018.03.20-23.08.07:011] 0]LogOutputDevice: Error: [Callstack] 0x00007f2f899ce68e FVulkanDynamicRHI::Init()
[2018.03.20-23.08.07:011] 0]LogOutputDevice: Error: [Callstack] 0x00007f305b1d083e RHIInit(bool)
[2018.03.20-23.08.07:011] 0]LogOutputDevice: Error: [Callstack] 0x000000000041a6f8 FEngineLoop::PreInit(wchar_t const*)
[2018.03.20-23.08.07:011] 0]LogOutputDevice: Error: [Callstack] 0x000000000042fbe8 GuardedMain(wchar_t const*)
[2018.03.20-23.08.07:011] 0]LogOutputDevice: Error: [Callstack] 0x00007f305636d227 CommonLinuxMain(int, char**, int ()(wchar_t const))
[2018.03.20-23.08.07:011] 0]LogOutputDevice: Error: [Callstack] 0x00007f3055db8830 /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0) [0x7f3055db8830]
[2018.03.20-23.08.07:011] 0]LogOutputDevice: Error: [Callstack] 0x00000000004169c9 /media/test/Linux Workloads/UnrealEngine/Engine/Binaries/Linux/UE4Editor(_start+0x29) [0x4169c9]

Checking the file/line mentioned in this error I see:

ensure(MemoryProperties.memoryTypes[TypeIndices[Index]].heapIndex == HeapIndex);

I am unsure if I can or how to circumvent these errors.

I do have the latest Vulkan drivers installed as well as the LunarG SDK. I am able to run multiple Unity samples in Vulkan as well as the LunarG and Nvidia Vulkan samples. Inside UE, I have both Vulkan and OGL APIs checked (SM4 and SM5). I have tried unckecking these, one by one, to see if that would help - same error.

I have also built this demo on a Win10 box and moved the packaged demo over to Linux - same error (unsure if it is the same line specified in the error above, but it is an ‘ensure condition failed’ error).

Ultimately what I am attempting to do is build a few Unreal samples, using Vulkan, to run on Linux in the new engine (4.19). Nothing fancy: SunTemple, Elemental, Matinee, and a few others.

I am on an Intel NUC with SKL graphics and 16GB of memory - using UE 4.19.

Any help would be appreciated!