Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why is Linux support disabled in the XR gems? #776

Open
ChristophHaag opened this issue Oct 19, 2024 · 0 comments
Open

Why is Linux support disabled in the XR gems? #776

ChristophHaag opened this issue Oct 19, 2024 · 0 comments
Labels
needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. sig/platform Categorizes an issue or PR as relevant to SIG Platform.

Comments

@ChristophHaag
Copy link

ChristophHaag commented Oct 19, 2024

I'm not familiar with o3de, but wanted to see if the XR support worked on Linux. So I installed the 24.09.0 binary version of o3de on archlinux

Creating a new project with the downloaded XR gems from the asset library predictably didn't launch any XR mode when going into play mode with ctrl+g, so I deleted the downloaded gems in the Gem directory and tried to add the ones from an o3de-extras checkout of the 2409.0 branch but other than outputting 1.12.1 these commands do nothing:

$ /opt/O3DE/24.09/scripts/o3de.sh register -gp /home/haagch/o3de-extras/Gems/XR -espp /home/haagch/O3DE/Projects/OpenXRTest/1.0.1
1.12.1
$ /opt/O3DE/24.09/scripts/o3de.sh register -gp /home/haagch/o3de-extras/Gems/OpenXRVk -espp /home/haagch/O3DE/Projects/OpenXRTest/1.0.1
1.12.1 

so I just went ahead and added them manually in my project in project.json

    "external_subdirectories": [
        "Gem",
        "/home/haagch/o3de-extras/Gems/XR",
        "/home/haagch/o3de-extras/Gems/OpenXRVk"
    ],

Now to the gem code.

First I see this commit but I could not find any rationale to why: 6001b28

Once I revert that commit and click build in the editor, it hits this error #error "Linux Window Manager not recognized." https://github.com/o3de/o3de-extras/blob/2409.0/Gems/OpenXRVk/Code/Include/OpenXRVk/Platform/Linux/OpenXRVk_Linux.h#L17-L24

afaik you only support OpenXR with the Vulkan RHI, which has no need for any interaction with xlib/xcb or wayland (the wayland graphics binding really shouldn't exist in this form anyway). So once I delete these ifdefs and hit build again, I am hit with a less clear linking error

[1/13] Linking CXX static library lib/profile/libXR.Static.a
[2/13] Copying XR runtime dependencies to output...
[3/13] Building CXX object External/XR-d0652409/Code/CMakeFiles/XR.dir/profile/Unity/unity_0_cxx.cxx.o
[4/13] Linking CXX shared module bin/profile/libXR.so
FAILED: bin/profile/libXR.so 
: && /usr/sbin/clang++ -fPIC -fno-exceptions -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Werror -Wno-inconsistent-missing-override -Wrange-loop-analysis -Wno-unknown-warning-option -Wno-parentheses -Wno-reorder -Wno-switch -Wno-undefined-var-template -msse4.1  -O2 -g -fstack-protector-all -fstack-check  -Wl,--no-undefined -fpie -Wl,-z,relro,-z,now -Wl,-z,noexecstack -shared  -o bin/profile/libXR.so External/XR-d0652409/Code/CMakeFiles/XR.dir/profile/Unity/unity_0_cxx.cxx.o  -Wl,-rpath,"\$ORIGIN"  lib/profile/libXR.Static.a  /opt/O3DE/24.09/lib/Linux/profile/Default/libAtom_RPI.Public.a  /opt/O3DE/24.09/lib/Linux/profile/Default/libAtom_RHI.Public.a  /opt/O3DE/24.09/lib/Linux/profile/Default/libAtom_RHI.Reflect.a  /opt/O3DE/24.09/lib/Linux/profile/Default/libAzFramework.a  /opt/O3DE/24.09/lib/Linux/profile/Default/libAzNetworking.a  /home/haagch/.o3de/3rdParty/packages/OpenSSL-1.1.1t-rev1-linux/OpenSSL/lib/libssl.a  /home/haagch/.o3de/3rdParty/packages/OpenSSL-1.1.1t-rev1-linux/OpenSSL/lib/libcrypto.a  /home/haagch/.o3de/3rdParty/packages/lz4-1.9.4-rev2-linux/lz4/lib/liblz4.a  /opt/O3DE/24.09/lib/Linux/profile/Default/libAtomCore.a  /opt/O3DE/24.09/lib/Linux/profile/Default/libAzCore.a  /home/haagch/.o3de/3rdParty/packages/Lua-5.4.4-rev1-linux/Lua/lib/release/liblualib.a  /home/haagch/.o3de/3rdParty/packages/zlib-1.2.11-rev5-linux/zlib/lib/libz.a  /usr/lib/libzstd.so  /home/haagch/.o3de/3rdParty/packages/cityhash-1.1-multiplatform/cityhash/build/linux/clang-3.8/release/libcityhash.a  /opt/O3DE/24.09/bin/Linux/profile/Default/./libO3DEKernel.so  -ldl  -lpthread  /usr/lib/libunwind.so  -latomic && cd /home/haagch/O3DE/Projects/openxrtest/build/linux/External/XR-d0652409/Code && /usr/bin/cmake -P /opt/O3DE/24.09/cmake/Platform/Linux/ProcessDebugSymbols.cmake /usr/bin/strip /usr/bin/objcopy /home/haagch/O3DE/Projects/openxrtest/build/linux/bin/profile/libXR.so dbg MODULE_LIBRARY DETACH
/usr/sbin/ld: lib/profile/libXR.Static.a(unity_0_cxx.cxx.o): in function `AZ::AzTypeInfo<AZStd::basic_fixed_string<char, 256ul, AZStd::char_traits<char> > >::GetCanonicalTypeId()':
/opt/O3DE/24.09/Code/Framework/AzCore/./AzCore/RTTI/TypeInfoSimple.h:317:(.text.startup[_ZN2XR39r_default_openxr_foveated_pass_templateE]+0x144): undefined reference to `_ZN5AZStd13GetO3deTypeIdIcTnDaLm256ENS_11char_traitsIcEEEEN2AZ4UuidENS3_3AdlENS_13type_identityINS_18basic_fixed_stringIT_XT0_ET1_EEEE'

might this be because of differences in the debian build and clang 18.1.8 from archlinux?

@ChristophHaag ChristophHaag added needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Oct 19, 2024
@michalpelka michalpelka added sig/platform Categorizes an issue or PR as relevant to SIG Platform. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. sig/platform Categorizes an issue or PR as relevant to SIG Platform.
Projects
None yet
Development

No branches or pull requests

2 participants