DUOLabs333 / vulkan-stream

A Vulkan driver to stream commands over TCP
9 stars 2 forks source link

Can't compile MacOS 14.3.1 #1

Closed Moxnatiy closed 6 months ago

Moxnatiy commented 6 months ago

Can't compile, here is log:

➜ vulkan-stream git:(master) ✗ ./build.sh MACOS Build In file included from autogen/Commands.cpp:13: autogen/Serialization.hpp:652:15: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Wnon-c-typedef-for-linkage] typedef struct { ^ Sync autogen/Serialization.hpp:653:26: note: type is not C-compatible due to this default member initializer uintptr_t devicememory = 0; ^ autogen/Serialization.hpp:660:3: note: type is given name 'Sync' for linkage purposes by this typedef declaration } Sync; ^ 1 warning generated. In file included from autogen/Serialization.cpp:5: autogen/Serialization.hpp:652:15: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Wnon-c-typedef-for-linkage] typedef struct { ^ Sync autogen/Serialization.hpp:653:26: note: type is not C-compatible due to this default member initializer uintptr_t devicememory = 0; ^ autogen/Serialization.hpp:660:3: note: type is given name 'Sync' for linkage purposes by this typedef declaration } Sync; ^ 1 warning generated. In file included from src/Synchronization.cpp:9: autogen/Serialization.hpp:652:15: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Wnon-c-typedef-for-linkage] typedef struct { ^ Sync autogen/Serialization.hpp:653:26: note: type is not C-compatible due to this default member initializer uintptr_t devicememory = 0; ^ autogen/Serialization.hpp:660:3: note: type is given name 'Sync' for linkage purposes by this typedef declaration } Sync; ^ src/Synchronization.cpp:26:15: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Wnon-c-typedef-for-linkage] typedef struct { ^ MemInfo src/Synchronization.cpp:31:21: note: type is not C-compatible due to this default member initializer uint64_t prev_hash =0; ^ src/Synchronization.cpp:33:3: note: type is given name 'MemInfo' for linkage purposes by this typedef declaration } MemInfo; ^ 2 warnings generated. src/Surface.cpp:33:15: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Wnon-c-typedef-for-linkage] typedef struct { ^ SwapchainInfo src/Surface.cpp:34:24: note: type is not C-compatible due to this default member initializer VkSurfaceKHR surface = VK_NULL_HANDLE; ^~~~~~ external/Vulkan-Headers/include/vulkan/vulkan_core.h:41:36: note: expanded from macro 'VK_NULL_HANDLE'

define VK_NULL_HANDLE nullptr

                               ^~~~~~~

src/Surface.cpp:39:3: note: type is given name 'SwapchainInfo' for linkage purposes by this typedef declaration } SwapchainInfo; ^ src/Surface.cpp:41:15: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Wnon-c-typedef-for-linkage] typedef struct { ^ DeviceInfo src/Surface.cpp:42:36: note: type is not C-compatible due to this default member initializer VkPhysicalDevice physical_device = VK_NULL_HANDLE; ^~~~~~ external/Vulkan-Headers/include/vulkan/vulkan_core.h:41:36: note: expanded from macro 'VK_NULL_HANDLE'

define VK_NULL_HANDLE nullptr

                               ^~~~~~~

src/Surface.cpp:48:3: note: type is given name 'DeviceInfo' for linkage purposes by this typedef declaration } DeviceInfo; ^ 2 warnings generated. In file included from src/Server.cpp:7: autogen/Serialization.hpp:652:15: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Wnon-c-typedef-for-linkage] typedef struct { ^ Sync autogen/Serialization.hpp:653:26: note: type is not C-compatible due to this default member initializer uintptr_t devicememory = 0; ^ autogen/Serialization.hpp:660:3: note: type is given name 'Sync' for linkage purposes by this typedef declaration } Sync; ^ 1 warning generated. Apple clang version 15.0.0 (clang-1500.1.0.2.5) Target: arm64-apple-darwin23.3.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch arm64 -platform_version macos 14.0.0 14.2 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -O3 -o vulkan_stream -L/Users/miami/VulkanSDK/1.3.275.0/macOS/lib/ -L/usr/local/lib autogen/Commands.o autogen/Serialization.o src/Synchronization.o src/ThreadStruct.o src/debug.o src/Surface.o src/Server.o external/shm_open_anon/shm_open_anon.o external/simdjson/src/simdjson.o external/lz4/lib/liblz4.a -llibvulkan -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/lib/darwin/libclang_rt.osx.a ld: library 'libvulkan' not found clang: fatal error: linker command failed with exit code 1 (use -v to see invocation)

DUOLabs333 commented 6 months ago

Do you have MoltenVK installed?

Moxnatiy commented 6 months ago

Thanks, for reply. Not sure if I doing it right.

image image image

DUOLabs333 commented 6 months ago

Ah, I see the problem --- you have to also install the vulkan-loader. Once you do, VK_LIB_PATH should point to that folder (make sure that the loader can load MoltenVK).

Moxnatiy commented 6 months ago

Thanks, its help but now I get different error. Also I successfully make build on client side (Ubuntu 23.04)

Apple clang version 15.0.0 (clang-1500.1.0.2.5) Target: arm64-apple-darwin23.3.0 Thread model: posix InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/ld" -demangle -lto_library /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/libLTO.dylib -dynamic -arch arm64 -platform_version macos 14.0.0 14.2 -syslibroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -o vulkan_stream -L/opt/homebrew/Cellar/vulkan-loader/1.3.278/loader/vulkan.framework/Versions/A/ -L/usr/local/lib autogen/Commands.o autogen/Serialization.o src/Synchronization.o src/ThreadStruct.o src/debug.o src/Surface.o src/Server.o external/shm_open_anon/shm_open_anon.o external/simdjson/src/simdjson.o external/lz4/lib/liblz4.a -lvulkan -lc++ -lSystem /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/15.0.0/lib/darwin/libclang_rt.osx.a ld: Undefined symbols: _tb64dec, referenced from: handle_sync_response(boost::json::object&) in Synchronization.o _tb64enc, referenced from: handle_sync_request(boost::json::object&) in Synchronization.o _tb64enclen, referenced from: handle_sync_request(boost::json::object&) in Synchronization.o handle_sync_request(boost::json::object&) in Synchronization.o handle_sync_request(boost::json::object&) in Synchronization.o clang: fatal error: linker command failed with exit code 1 (use -v to see invocation)

DUOLabs333 commented 6 months ago

Oh, this is a mistake on my part --- go to external/Turbo-Base64 and do make libtb64.a. I'll update build.sh soon.

DUOLabs333 commented 6 months ago

This also means that the client build also doesn't work, even though the compilation succeeded.

Moxnatiy commented 6 months ago

It's works! image

Moxnatiy commented 6 months ago

I also found few mistakes in update.sh and change 'python' -> 'python3' in ./build.sh

Screenshot 2024-02-29 at 21 01 50

DUOLabs333 commented 6 months ago

Great! Glad it works. I also updated update.sh to fix the issues you shown. How's the performance?

Moxnatiy commented 6 months ago

not sure how many fps looks like 15-30, Great work!. MangoHud, vkgears unfortunately not working.

DUOLabs333 commented 6 months ago

Really? 15 fps? Can you send a video --- I just want to be able to compare what I have locally. I'll look into vkgears.

DUOLabs333 commented 6 months ago

vkgears now works.

Moxnatiy commented 6 months ago

when try to start 'vkgears'

image

Moxnatiy commented 6 months ago

Really? 15 fps? Can you send a video --- I just want to be able to compare what I have locally. I'll look into vkgears.

https://youtu.be/2o6CPY_Uqhc

DUOLabs333 commented 6 months ago

Can you pull from HEAD and build again? Also, can you send me the log on the server?

Moxnatiy commented 6 months ago

remove old folder and do new clean build, looks same

Screenshot 2024-03-01 at 18 01 55

DUOLabs333 commented 6 months ago

Weird... it works here. What version of MoltenVK and vkgears do you have?

Moxnatiy commented 6 months ago

Server: VulkanSDK/1.3.275.0 Client: vulkaninfo -> https://pastebin.com/LHfeu5gM

Moxnatiy commented 6 months ago

vkgears from mesa-utils 9.0.0-1

DUOLabs333 commented 6 months ago

Did you pull from HEAD and rebuild on the client as well?

Moxnatiy commented 6 months ago

Yes, I double-checked everything ( 71a65ef changes are present )

DUOLabs333 commented 6 months ago

Can you try setting up an Arch Linux VM and see if it works there? Maybe I assumed something about how gcc on Arch Linux works?

DUOLabs333 commented 6 months ago

I tried something else. Can you see if it fixes your problem (as well as send the new log)?

Moxnatiy commented 6 months ago

Server side build log:

➜ vulkan-stream git:(master) ✗ VK_LIB_PATH=/opt/homebrew/Cellar/vulkan-loader/1.3.278/loader/vulkan.framework/Versions/A ./build.sh In file included from autogen/Commands.cpp:13: autogen/Serialization.hpp:652:15: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Wnon-c-typedef-for-linkage] typedef struct { ^ Sync autogen/Serialization.hpp:653:26: note: type is not C-compatible due to this default member initializer uintptr_t devicememory = 0; ^ autogen/Serialization.hpp:660:3: note: type is given name 'Sync' for linkage purposes by this typedef declaration } Sync; ^ 1 warning generated. In file included from autogen/Serialization.cpp:5: autogen/Serialization.hpp:652:15: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Wnon-c-typedef-for-linkage] typedef struct { ^ Sync autogen/Serialization.hpp:653:26: note: type is not C-compatible due to this default member initializer uintptr_t devicememory = 0; ^ autogen/Serialization.hpp:660:3: note: type is given name 'Sync' for linkage purposes by this typedef declaration } Sync; ^ 1 warning generated. In file included from src/Synchronization.cpp:9: autogen/Serialization.hpp:652:15: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Wnon-c-typedef-for-linkage] typedef struct { ^ Sync autogen/Serialization.hpp:653:26: note: type is not C-compatible due to this default member initializer uintptr_t devicememory = 0; ^ autogen/Serialization.hpp:660:3: note: type is given name 'Sync' for linkage purposes by this typedef declaration } Sync; ^ In file included from src/Synchronization.cpp:17: src/ThreadStruct.hpp:17:15: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Wnon-c-typedef-for-linkage] typedef struct { ^ ThreadStruct src/ThreadStruct.hpp:19:32: note: type is not C-compatible due to this default member initializer boost::json::parser parser = {{}, {.max_depth=180,.allow_invalid_utf8=true,.allow_infinity_and_nan=true}}; ^~~~~~~~~~~~~~~~~~ src/ThreadStruct.hpp:26:3: note: type is given name 'ThreadStruct' for linkage purposes by this typedef declaration } ThreadStruct; ^ src/Synchronization.cpp:26:15: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Wnon-c-typedef-for-linkage] typedef struct { ^ MemInfo src/Synchronization.cpp:31:21: note: type is not C-compatible due to this default member initializer uint64_t prev_hash =0; ^ src/Synchronization.cpp:33:3: note: type is given name 'MemInfo' for linkage purposes by this typedef declaration } MemInfo; ^ 3 warnings generated. In file included from src/ThreadStruct.cpp:2: src/ThreadStruct.hpp:17:15: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Wnon-c-typedef-for-linkage] typedef struct { ^ ThreadStruct src/ThreadStruct.hpp:19:32: note: type is not C-compatible due to this default member initializer boost::json::parser parser = {{}, {.max_depth=180,.allow_invalid_utf8=true,.allow_infinity_and_nan=true}}; ^~~~~~~~~~~~~~~~~~ src/ThreadStruct.hpp:26:3: note: type is given name 'ThreadStruct' for linkage purposes by this typedef declaration } ThreadStruct; ^ 1 warning generated. src/Surface.cpp:33:15: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Wnon-c-typedef-for-linkage] typedef struct { ^ SwapchainInfo src/Surface.cpp:34:24: note: type is not C-compatible due to this default member initializer VkSurfaceKHR surface = VK_NULL_HANDLE; ^~~~~~ external/Vulkan-Headers/include/vulkan/vulkan_core.h:41:36: note: expanded from macro 'VK_NULL_HANDLE'

define VK_NULL_HANDLE nullptr

                               ^~~~~~~

src/Surface.cpp:39:3: note: type is given name 'SwapchainInfo' for linkage purposes by this typedef declaration } SwapchainInfo; ^ src/Surface.cpp:41:15: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Wnon-c-typedef-for-linkage] typedef struct { ^ DeviceInfo src/Surface.cpp:42:36: note: type is not C-compatible due to this default member initializer VkPhysicalDevice physical_device = VK_NULL_HANDLE; ^~~~~~ external/Vulkan-Headers/include/vulkan/vulkan_core.h:41:36: note: expanded from macro 'VK_NULL_HANDLE'

define VK_NULL_HANDLE nullptr

                               ^~~~~~~

src/Surface.cpp:48:3: note: type is given name 'DeviceInfo' for linkage purposes by this typedef declaration } DeviceInfo; ^ 2 warnings generated. In file included from src/Server.cpp:4: src/ThreadStruct.hpp:17:15: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Wnon-c-typedef-for-linkage] typedef struct { ^ ThreadStruct src/ThreadStruct.hpp:19:32: note: type is not C-compatible due to this default member initializer boost::json::parser parser = {{}, {.max_depth=180,.allow_invalid_utf8=true,.allow_infinity_and_nan=true}}; ^~~~~~~~~~~~~~~~~~ src/ThreadStruct.hpp:26:3: note: type is given name 'ThreadStruct' for linkage purposes by this typedef declaration } ThreadStruct; ^ In file included from src/Server.cpp:7: autogen/Serialization.hpp:652:15: warning: anonymous non-C-compatible type given name for linkage purposes by typedef declaration; add a tag name here [-Wnon-c-typedef-for-linkage] typedef struct { ^ Sync autogen/Serialization.hpp:653:26: note: type is not C-compatible due to this default member initializer uintptr_t devicememory = 0; ^ autogen/Serialization.hpp:660:3: note: type is given name 'Sync' for linkage purposes by this typedef declaration } Sync; ^ 2 warnings generated. ➜ vulkan-stream git:(master) ✗

Client side:

image

Moxnatiy commented 6 months ago

Server build ok, but now can't build on Client side

DUOLabs333 commented 6 months ago

Sorry, I made a mistake. Can you try now?

DUOLabs333 commented 6 months ago

I'm going to close this issue now. Make a new one if the issue persists.