Difference between revisions of "Software/ThirdParty/Guides/Epic/UnrealEngine"
Line 10: | Line 10: | ||
=== Known Issues === | === Known Issues === | ||
− | AMD GPUs have known compatibility issues as of Q3 2018.<ref>https://patchwork.freedesktop.org/patch/171151/</ref> While we expect these to be fixed over time, in the interim the kernel and mesa need to be patched to work properly<ref>https://bugs.freedesktop.org/show_bug.cgi?id=106258#c40</ref> | + | AMD GPUs have known bugs and overall compatibility issues as of Q3 2018.<ref>https://patchwork.freedesktop.org/patch/171151/</ref> While we expect these to be fixed over time, in the interim the kernel and mesa need to be patched to work properly<ref>https://bugs.freedesktop.org/show_bug.cgi?id=106258#c40</ref>. |
− | + | It is believed that the shader incompatability, resulting in "AMDGPU.config is empty" messages followed by a crash, is not isolated to ppc64 machines but instead is a general issue with the relatively new and untested amdgpu driver stack on Linux. This shader incompatibility does not have a proper fix, and will result in a crash when launching any UE4 applications. A workaround is to edit the mesa file src/amd/common/ac_binary.c and change "if(elf)" to read "if (elf && success)"; this introduces a possible resource leak but works around crashing during teardown of the missing AMDGPU shader ELF. | |
+ | |||
+ | Finally, LLVMPipe cannot be used because it only exposes Shader Model 4 interfaces, while UE4/UT4 require Shader Model 5 or higher (or even Vulkan) to support their advanced rendering features. | ||
=== Build Instructions === | === Build Instructions === |
Revision as of 22:56, 19 August 2018
Contents
Unreal Engine 4 on Debian Buster, OpenPOWER Edition
Required OS dependencies
clang-4.0 dos2unix autotools-dev automake cmake libtool libc++-dev libc++abi-dev libx11-dev libxext-dev libegl1-mesa-dev mesa-common-dev libgl1-mesa-dev libgles2-mesa-dev libglib2.0-dev libglu1-mesa-dev libxinerama-dev libxkbcommon-dev libxrandr-dev libxrender-dev libvulkan-dev libxcursor-dev libxt-dev libxi-dev libxv-dev libwebsockets-dev freeglut3-dev wayland-protocols x11proto-input-dev x11proto-randr-dev x11proto-scrnsaver-dev x11proto-xinerama-dev
Required OS setup
update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-4.0 100 update-alternatives --install /usr/bin/clang clang /usr/bin/clang-4.0 100
Known Issues
AMD GPUs have known bugs and overall compatibility issues as of Q3 2018.[1] While we expect these to be fixed over time, in the interim the kernel and mesa need to be patched to work properly[2].
It is believed that the shader incompatability, resulting in "AMDGPU.config is empty" messages followed by a crash, is not isolated to ppc64 machines but instead is a general issue with the relatively new and untested amdgpu driver stack on Linux. This shader incompatibility does not have a proper fix, and will result in a crash when launching any UE4 applications. A workaround is to edit the mesa file src/amd/common/ac_binary.c and change "if(elf)" to read "if (elf && success)"; this introduces a possible resource leak but works around crashing during teardown of the missing AMDGPU shader ELF.
Finally, LLVMPipe cannot be used because it only exposes Shader Model 4 interfaces, while UE4/UT4 require Shader Model 5 or higher (or even Vulkan) to support their advanced rendering features.
Build Instructions
================================================================================= UE4 https://www.unrealengine.com/en-US/ue4-on-github Use POWER version from: https://github.com/kb9vqf/UnrealEngine ================================================================================= Build process: # Environment export TARGET_ARCH=powerpc64le-unknown-linux-gnu export UE4_ROOT_DIR=$PWD # Low level shared libraries and applications cd Engine/Source/ThirdParty/elftoolchain/build/Linux/libelf ./build_native cd $UE4_ROOT_DIR cd Engine/Source/ThirdParty/elftoolchain/build/Linux/libdwarf ./build_native cd $UE4_ROOT_DIR cd Engine/Source/ThirdParty/Breakpad/build/Linux ./BuildBreakpad.sh cd $UE4_ROOT_DIR cd Engine/Source/ThirdParty/zlib ../libcurl/BUILD.EPIC.sh cd OpenSSL/OpenSSL_1_0_2h ./config TARGET_ARCH= make depend TARGET_ARCH= make mkdir ../../../OpenSSL/1_0_2h/lib/Linux/${TARGET_ARCH} cp -Rp libcrypto.a ../../../OpenSSL/1_0_2h/lib/Linux/${TARGET_ARCH}/ cp -Rp libssl.a ../../../OpenSSL/1_0_2h/lib/Linux/${TARGET_ARCH}/ cd ../.. cd zlib/v1.2.8/build TARGET_ARCH= ./Build.sh mkdir ../lib/Linux/${TARGET_ARCH} cp -Rp libz.a ../lib/Linux/${TARGET_ARCH}/ cp -Rp libz_fPIC.a ../lib/Linux/${TARGET_ARCH}/ cd ../.. cd libcurl/curl-7_48_0 ./buildconf LDFLAGS=-L${PWD}/../../OpenSSL/OpenSSL_1_0_2h LD_LIBRARY_PATH=${PWD}/../../OpenSSL/OpenSSL_1_0_2h ./configure --with-zlib=${PWD}/../../zlib/v1.2.8 --with-ssl=${PWD}/../../OpenSSL/OpenSSL_1_0_2h --prefix=$PWD --enable-static --enable-shared --enable-threaded-resolver --enable-hidden-symbols --disable-ftp --disable-file --disable-ldap --disable-ldaps --disable-rtsp --disable-telnet --disable-tftp --disable-dict --disable-pop3 --disable-imap --disable-smtp --disable-gopher --disable-manual --disable-idn LDFLAGS=-L${PWD}/../../OpenSSL/OpenSSL_1_0_2h LD_LIBRARY_PATH=${PWD}/../../OpenSSL/OpenSSL_1_0_2h make mkdir ../../../libcurl/7_48_0/lib/Linux/${TARGET_ARCH} cp -Rp lib/.libs/libcurl.a ../../../libcurl/7_48_0/lib/Linux/${TARGET_ARCH}/ cd $UE4_ROOT_DIR cd Engine/Source/ThirdParty/FreeType2/FreeType2-2.6 cmake . make mkdir Lib/Linux/${TARGET_ARCH} cp -Rp libfreetype.a Lib/Linux/${TARGET_ARCH}/ cp -Rp libfreetype_fPIC.a Lib/Linux/${TARGET_ARCH}/ cd $UE4_ROOT_DIR cd Engine/Source/ThirdParty/libPNG/libPNG-1.5.2 cmake -DPNG_STATIC=ON . make mkdir lib/Linux/${TARGET_ARCH} cp -Rp libpng15.a lib/Linux/${TARGET_ARCH}/libpng.a cd $UE4_ROOT_DIR cd Engine/Source/Programs/BreakpadSymbolEncoder ./BuildBreakpadSymbolEncoderLinux.sh cp -Rp BreakpadSymbolEncoder ../../../Binaries/Linux/BreakpadSymbolEncoder cd $UE4_ROOT_DIR cd Engine/Source/ThirdParty/glslang/Build/Linux ./build.sh cd $UE4_ROOT_DIR cd Engine/Source/ThirdParty/MikkTSpace cmake . make mkdir lib/Linux/${TARGET_ARCH} cp -Rp libMikkTSpace.a lib/Linux/${TARGET_ARCH}/ cd $UE4_ROOT_DIR cd Engine/Source/ThirdParty/CEF3/cef_binary_3.2623.1395.g3034273_linux64 cp -Rp ../cef_source/cef_paths2.gypi . cd ../Build/Linux/ ./build.sh cd $UE4_ROOT_DIR cd Engine/Source/ThirdParty/VHACD/build/Linux mkdir ../../Lib/Linux/${TARGET_ARCH}/ make cd $UE4_ROOT_DIR cd Engine/Source/ThirdParty/libWebSockets/libwebsockets_src cmake . make mkdir -p ../libwebsockets/lib/Linux/${TARGET_ARCH}/Release/ cp -Rp lib/libwebsockets.a ../libwebsockets/lib/Linux/${TARGET_ARCH}/Release/ cd $UE4_ROOT_DIR cd Engine/Source/ThirdParty/ForsythTriOO cmake -DCMAKE_BUILD_TYPE=Release . make mkdir Lib/Linux/${TARGET_ARCH}/ cp -Rp libForsythTriOptimizer.a Lib/Linux/${TARGET_ARCH}/ cd $UE4_ROOT_DIR cd Engine/Source/ThirdParty/Kiss_FFT/kiss_fft129 mkdir -p Lib/Linux/Release/${TARGET_ARCH}/ cmake . make clean make cp -Rp ../Lib/Linux/Release/${TARGET_ARCH}/*.a Lib/Linux/Release/${TARGET_ARCH}/ cd $UE4_ROOT_DIR cd Engine/Source/ThirdParty/SpeedTree/SpeedTreeSDK-v7.0/Source/Core/Linux mkdir -p ../../../Lib/Linux/${TARGET_ARCH}/Release cp -Rp ../../../../Lib/Linux/${TARGET_ARCH}/Release/*.a ../../../Lib/Linux/${TARGET_ARCH}/Release/ cmake . make clean make cd $UE4_ROOT_DIR # Header fixup cd Engine/Source/ThirdParty/zlib/v1.2.8/include/Linux/ cp -Rp x86_64-unknown-linux-gnu powerpc64le-unknown-linux-gnu cd $UE4_ROOT_DIR cd Engine/Source/ThirdParty/OpenSSL/1_0_2h/include/Linux/ cp -Rp x86_64-unknown-linux-gnu powerpc64le-unknown-linux-gnu cd $UE4_ROOT_DIR cd Engine/Source/ThirdParty/libcurl/7_48_0/include/Linux/ cp -Rp x86_64-unknown-linux-gnu powerpc64le-unknown-linux-gnu cd $UE4_ROOT_DIR cd Engine/Source/ThirdParty/libWebSockets/libwebsockets/include/Linux/ cp -Rp x86_64-unknown-linux-gnu powerpc64le-unknown-linux-gnu cd $UE4_ROOT_DIR # Mid level shared libraries and general setup ./Setup.sh ./GenerateProjectFiles.sh # ICU fixup cd Engine/Source/ThirdParty/ICU/icu4c-53_1/Linux/powerpc64le-unknown-linux-gnu mkdir lib mv *.a lib cd $UE4_ROOT_DIR # Opus fixup cd Engine/Source/ThirdParty/libOpus/opus-1.1 mkdir Linux/${TARGET_ARCH} cp -Rp .libs/libopus.a Linux/${TARGET_ARCH}/ cd $UE4_ROOT_DIR # NVIDIA PhysX build mkdir -p Engine/Binaries/ThirdParty/PhysX3/Linux/${TARGET_ARCH}/ mkdir -p Engine/Source/ThirdParty/PhysX3/Lib/Linux/${TARGET_ARCH}/ cd Engine/Source/ThirdParty/PhysX3/PhysX_3.4/Source/compiler/cmake/linux GW_DEPS_ROOT="$UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3" cmake -DCMAKE_BUILD_TYPE=Debug . make GW_DEPS_ROOT="$UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3" cmake -DCMAKE_BUILD_TYPE=Checked . make GW_DEPS_ROOT="$UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3" cmake -DCMAKE_BUILD_TYPE=Profile . make GW_DEPS_ROOT="$UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3" cmake -DCMAKE_BUILD_TYPE=Release . make cp -Rp *.a $UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3/Lib/Linux/${TARGET_ARCH}/ cp -Rp pxshared_bin/*.a $UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3/Lib/Linux/${TARGET_ARCH}/ cd $UE4_ROOT_DIR cd Engine/Source/ThirdParty/PhysX3/APEX_1.4/compiler/cmake/linux GW_DEPS_ROOT="$UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3" cmake -DPX_STATIC_LIBRARIES=1 -DAPEX_LINUX_SHARED_LIBRARIES=1 -DCMAKE_MODULE_PATH="$UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3/Externals/CMakeModules" -DPHYSX_ROOT_DIR="$UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3/PhysX_3.4" -DAPEX_ENABLE_UE4=1 -DUSE_RESPONSE_FILES=1 -DCMAKE_BUILD_TYPE=Debug . make GW_DEPS_ROOT="$UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3" cmake -DPX_STATIC_LIBRARIES=1 -DAPEX_LINUX_SHARED_LIBRARIES=1 -DCMAKE_MODULE_PATH="$UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3/Externals/CMakeModules" -DPHYSX_ROOT_DIR="$UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3/PhysX_3.4" -DAPEX_ENABLE_UE4=1 -DUSE_RESPONSE_FILES=1 -DCMAKE_BUILD_TYPE=Checked . make GW_DEPS_ROOT="$UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3" cmake -DPX_STATIC_LIBRARIES=1 -DAPEX_LINUX_SHARED_LIBRARIES=1 -DCMAKE_MODULE_PATH="$UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3/Externals/CMakeModules" -DPHYSX_ROOT_DIR="$UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3/PhysX_3.4" -DAPEX_ENABLE_UE4=1 -DUSE_RESPONSE_FILES=1 -DCMAKE_BUILD_TYPE=Profile . make GW_DEPS_ROOT="$UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3" cmake -DPX_STATIC_LIBRARIES=1 -DAPEX_LINUX_SHARED_LIBRARIES=1 -DCMAKE_MODULE_PATH="$UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3/Externals/CMakeModules" -DPHYSX_ROOT_DIR="$UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3/PhysX_3.4" -DAPEX_ENABLE_UE4=1 -DUSE_RESPONSE_FILES=1 -DCMAKE_BUILD_TYPE=Release . make cp -Rp *.a $UE4_ROOT_DIR/Engine/Binaries/ThirdParty/PhysX3/Linux/${TARGET_ARCH}/ cp -Rp *.so $UE4_ROOT_DIR/Engine/Binaries/ThirdParty/PhysX3/Linux/${TARGET_ARCH}/ cp -Rp physx_bin/pxshared_bin/*.so $UE4_ROOT_DIR/Engine/Binaries/ThirdParty/PhysX3/Linux/${TARGET_ARCH}/ cp -Rp *.a $UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3/Lib/Linux/${TARGET_ARCH}/ cp -Rp *.so $UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3/Lib/Linux/${TARGET_ARCH}/ cp -Rp physx_bin/*.a $UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3/Lib/Linux/${TARGET_ARCH}/ cp -Rp physx_bin/pxshared_bin/*.a $UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3/Lib/Linux/${TARGET_ARCH}/ cp -Rp physx_bin/pxshared_bin/*.so $UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3/Lib/Linux/${TARGET_ARCH}/ cd $UE4_ROOT_DIR cd Engine/Source/ThirdParty/PhysX3/NvCloth/compiler/cmake/linux cmake -DPX_STATIC_LIBRARIES=1 -DCMAKE_MODULE_PATH="$UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3/Externals/CMakeModules" -DPXSHARED_ROOT_DIR="$UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3/PxShared" -DCMAKE_BUILD_TYPE=Profile . cp -Rp *.a $UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3/Lib/Linux/${TARGET_ARCH}/ cd $UE4_ROOT_DIR # Fixup NVIDIA PhysX cd $UE4_ROOT_DIR/Engine/Source/ThirdParty/PhysX3/Lib/Linux/${TARGET_ARCH}/ mv libPhysX3CharacterKinematicCHECKED_x64.a libPhysX3CharacterKinematicCHECKED.a mv libPhysX3CharacterKinematicDEBUG_x64.a libPhysX3CharacterKinematicDEBUG.a mv libPhysX3CharacterKinematicPROFILE_x64.a libPhysX3CharacterKinematicPROFILE.a mv libPhysX3CharacterKinematic_x64.a libPhysX3CharacterKinematic.a mv libPhysX3CHECKED_x64.a libPhysX3CHECKED.a mv libPhysX3CommonCHECKED_x64.a libPhysX3CommonCHECKED.a mv libPhysX3CommonDEBUG_x64.a libPhysX3CommonDEBUG.a mv libPhysX3CommonPROFILE_x64.a libPhysX3CommonPROFILE.a mv libPhysX3Common_x64.a libPhysX3Common.a mv libPhysX3CookingCHECKED_x64.a libPhysX3CookingCHECKED.a mv libPhysX3CookingDEBUG_x64.a libPhysX3CookingDEBUG.a mv libPhysX3CookingPROFILE_x64.a libPhysX3CookingPROFILE.a mv libPhysX3Cooking_x64.a libPhysX3Cooking.a mv libPhysX3DEBUG_x64.a libPhysX3DEBUG.a mv libPhysX3GpuCHECKED_x64.a libPhysX3GpuCHECKED.a mv libPhysX3GpuDEBUG_x64.a libPhysX3GpuDEBUG.a mv libPhysX3GpuPROFILE_x64.a libPhysX3GpuPROFILE.a mv libPhysX3Gpu_x64.a libPhysX3Gpu.a mv libPhysX3PROFILE_x64.a libPhysX3PROFILE.a mv libPhysX3_x64.a libPhysX3.a mv libPxFoundationCHECKED_x64.so libPxFoundationCHECKED.so mv libPxFoundationDEBUG_x64.so libPxFoundationDEBUG.so mv libPxFoundationPROFILE_x64.so libPxFoundationPROFILE.so mv libPxFoundation_x64.so libPxFoundation.so mv libPxPvdSDKCHECKED_x64.a libPxPvdSDKCHECKED.a mv libPxPvdSDKDEBUG_x64.a libPxPvdSDKDEBUG.a mv libPxPvdSDKPROFILE_x64.a libPxPvdSDKPROFILE.a mv libPxPvdSDK_x64.a libPxPvdSDK.a mv libLowLevelAABBCHECKED_x64.a libLowLevelAABBCHECKED.a mv libLowLevelAABBDEBUG_x64.a libLowLevelAABBDEBUG.a mv libLowLevelAABBPROFILE_x64.a libLowLevelAABBPROFILE.a mv libLowLevelAABB_x64.a libLowLevelAABB.a mv libLowLevelCHECKED_x64.a libLowLevelCHECKED.a mv libLowLevelClothCHECKED_x64.a libLowLevelClothCHECKED.a mv libLowLevelClothDEBUG_x64.a libLowLevelClothDEBUG.a mv libLowLevelClothPROFILE_x64.a libLowLevelClothPROFILE.a mv libLowLevelCloth_x64.a libLowLevelCloth.a mv libLowLevelDEBUG_x64.a libLowLevelDEBUG.a mv libLowLevelDynamicsCHECKED_x64.a libLowLevelDynamicsCHECKED.a mv libLowLevelDynamicsDEBUG_x64.a libLowLevelDynamicsDEBUG.a mv libLowLevelDynamicsPROFILE_x64.a libLowLevelDynamicsPROFILE.a mv libLowLevelDynamics_x64.a libLowLevelDynamics.a mv libLowLevelParticlesCHECKED_x64.a libLowLevelParticlesCHECKED.a mv libLowLevelParticlesDEBUG_x64.a libLowLevelParticlesDEBUG.a mv libLowLevelParticlesPROFILE_x64.a libLowLevelParticlesPROFILE.a mv libLowLevelParticles_x64.a libLowLevelParticles.a mv libLowLevelPROFILE_x64.a libLowLevelPROFILE.a mv libLowLevel_x64.a libLowLevel.a mv libPhysX3ExtensionsCHECKED_x64.a libPhysX3ExtensionsCHECKED.a mv libPhysX3ExtensionsDEBUG_x64.a libPhysX3ExtensionsDEBUG.a mv libPhysX3ExtensionsPROFILE_x64.a libPhysX3ExtensionsPROFILE.a mv libPhysX3Extensions_x64.a libPhysX3Extensions.a mv libPhysX3VehicleCHECKED_x64.a libPhysX3VehicleCHECKED.a mv libPhysX3VehicleDEBUG_x64.a libPhysX3VehicleDEBUG.a mv libPhysX3VehiclePROFILE_x64.a libPhysX3VehiclePROFILE.a mv libPhysX3Vehicle_x64.a libPhysX3Vehicle.a mv libSceneQueryCHECKED_x64.a libSceneQueryCHECKED.a mv libSceneQueryDEBUG_x64.a libSceneQueryDEBUG.a mv libSceneQueryPROFILE_x64.a libSceneQueryPROFILE.a mv libSceneQuery_x64.a libSceneQuery.a mv libSimulationControllerCHECKED_x64.a libSimulationControllerCHECKED.a mv libSimulationControllerDEBUG_x64.a libSimulationControllerDEBUG.a mv libSimulationControllerPROFILE_x64.a libSimulationControllerPROFILE.a mv libSimulationController_x64.a libSimulationController.a mv libPsFastXmlCHECKED_x64.a libPsFastXmlCHECKED.a mv libPsFastXmlDEBUG_x64.a libPsFastXmlDEBUG.a mv libPsFastXmlPROFILE_x64.a libPsFastXmlPROFILE.a mv libPsFastXml_x64.a libPsFastXml.a mv libPxTaskCHECKED_x64.a libPxTaskCHECKED.a mv libPxTaskDEBUG_x64.a libPxTaskDEBUG.a mv libPxTaskPROFILE_x64.a libPxTaskPROFILE.a mv libPxTask_x64.a libPxTask.a cd $UE4_ROOT_DIR # Build engine make # Build engine make