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 · 1 comment
Open

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

ChristophHaag opened this issue Oct 19, 2024 · 1 comment
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature. priority/minor Lowest priority. Work that may be scheduled sig/platform Categorizes an issue or PR as relevant to SIG Platform. triage/accepted Indicates an issue or PR is ready to be actively worked on.

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
@byrcolin
Copy link
Contributor

byrcolin commented Nov 19, 2024

@ChristophHaag It appears you are doing a few things slightly incorrectly.
First, the registration commands should add a line to the /.o3de/o3de_manifest.json. Then in your projects and gems that refer to these objects should only use the name of the object.
Second: "external_subdirectories": [
"Gem",
"/home/haagch/o3de-extras/Gems/XR",
"/home/haagch/o3de-extras/Gems/OpenXRVk"
],
This is a list of sub directories that will be descended by cmake. If you want to include the object you would add the name of he object to the project.json, not the path into the gem_names I think...
The TRAIT being set to FALSE is something I'll have to look into... not sure why off the top of my head that is.
Also I would use the project manager to do all this. It does just call the underlying CLI commands but does it all for you so less chance of a making these kind of mistakes.

I'm going to call this a feature request and accept triage on it as I want to loo into why the TRAIT was set to false. Once I can determine that I will update this issue and close it.

@byrcolin byrcolin added triage/accepted Indicates an issue or PR is ready to be actively worked on. kind/feature Categorizes issue or PR as related to a new feature. priority/minor Lowest priority. Work that may be scheduled and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Nov 19, 2024
@byrcolin byrcolin self-assigned this Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. priority/minor Lowest priority. Work that may be scheduled sig/platform Categorizes an issue or PR as relevant to SIG Platform. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
Status: 🏗 In progress
Development

No branches or pull requests

3 participants