Shader compilation crash with AMD GPU

Hi folks,

I’m experiencing crashes during shader compilation for LightShaftOcclusion/RadialBlur on Linux when using an AMD GPU.
From the log I get:

[0m [31m[2017.12.08-12.29.43:941][  2]LogRHI: Error: Failed to link program. Compile log:
error: vertex shader output `out_TEXCOORD0' specifies noperspective interpolation qualifier, but fragment shader input specifies no interpolation qualifier

I would guess it originated to either line 50 or 62 in the attached shader source.
On another linux system with a nVidia GPU I can not reproduce this issue.

#0 raise()
#1 FLinuxPlatformMisc::DebugBreak()
#2 FOpenGLDynamicRHI::RHICreateBoundShaderState()
#3 RHICreateBoundShaderState()
#4 IRHICommandContext::RHISetGraphicsPipelineState()
#5 FRHICommandList::SetGraphicsPipelineState()
#6 SetGraphicsPipelineState()
#7 ApplyRadialBlurPasses()
#8 FDeferredShadingSceneRenderer::RenderLightShaftOcclusion()
#9 FDeferredShadingSceneRenderer::Render()
#10 RenderViewFamily_RenderThread()
#11 FRendererModule::BeginRenderingViewFamily(FCanvas*, FSceneViewFamily*)::EURCMacro_FDrawSceneCommand::DoTask(ENamedThreads::Type, TRefCountPtr<FGraphEvent> const&)()
#12 TGraphTask<FRendererModule::BeginRenderingViewFamily(FCanvas*, FSceneViewFamily*)::EURCMacro_FDrawSceneCommand>::ExecuteTask(TArray<FBaseGraphTask*, FDefaultAllocator>&, ENamedThreads::Type)()
#13 FBaseGraphTask::Execute()
#14 FNamedTaskThread::ProcessTasksNamedThread()
#15 FNamedTaskThread::ProcessTasksUntilQuit()
#16 FTaskGraphImplementation::ProcessThreadUntilRequestReturn()
#17 RenderingThreadMain()
#18 FRenderingThread::Run()
#19 FRunnableThreadPThread::Run()
#20 FRunnableThreadPThread::_ThreadProc()

Looking at this callstack I suppose this is still the same issue I already had on 4.16 with a less verbose log.
I would be great to get any hints how I can make this shader work for OpenGL on Linux with an AMD GPU.

Hi,

Thanks for the report. It looks like this is a known issue with some of the shaders. I will update our tracking system with reference to this specific shader to make sure it is not missed in any of the fixes.

There is already a pull request found here https://github.com/EpicGames/UnrealEngine/pull/4080 to fix this issue for one specific shader and you should be able to adapt this to create a work around for other shaders you have issues with until a fix is released.

Overall the reason this works on nvidia but not amd looks like a potential miss interpretation between the GLSL 430 spec in the driver’s compiler. The following link may be related to why the miss-interpretation in the spec: [OpenGL] 4.6: SPIR-V cannot correctly declare interpolation on variables. · Issue #10 · KhronosGroup/OpenGL-API · GitHub

Thanks a lot for your reply. Please be aware that a copy of this thread exists on UDN as I did not expected this to be answered here soon anymore and also did not make notable progress myself on this issue. I’m sorry if this should have lead to confusion. Please feel free to merge the threads if you like.

When I try to fix the LightShaftShader by adding noperspective qualifiers to the TEXCOORD0 params I’m experiencing system freezes, possibly caused by the same reasons as the issue I linked in the original question.
I attached a glxinfo output to provide some insight to the hardware and drivers used on the development system.
Strange enough, several of our customers report that the game is working for them with Linux and AMD GPU, although we don’t support it officially due to this issue. So this also seems not to be a general problem with AMD cards or MESA drivers.

It’s okay, as anyone using the github source on Linux will still come up against this issue and be able to find it here.

There will potentially be a difference between the way the compiler works on different AMD cards or different Linux setups as there are at least 3 different AMD drivers in use, AMDGPU-PRO, fglrx, radeonsi. So it may work on systems running AMDGPU-PRO (downloaded from AMD) but not radeonsi (the open source mesa based drivers) as they may interpret the spec differently.

In regard to your system freeze:

Taking a look at your glxinfo I see you are currently running on the Mesa AMD drivers. Unfortunately whilst we will fix issues where we can, we currently do not support non-official drivers on Linux. If you could try again with the official AMD drivers downloaded from here http://support.amd.com/en-us/download/linux

If you continue to have the system freeze issue with the proprietary drivers please resubmit a new issue.