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

Run gRPC service independently #158

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

elviscapiaq
Copy link
Collaborator

No description provided.

@elviscapiaq elviscapiaq marked this pull request as draft January 9, 2025 04:38
@elviscapiaq
Copy link
Collaborator Author

I put this PR as a draft to validate the implementation. Please let me know if I am moving in the right track.
Also, I did the testing with several apps, including the Unity app with two-instance creation. For all tests, the gRPC service runs successfully.

@elviscapiaq elviscapiaq force-pushed the main branch 2 times, most recently from c3ac50b to cf7a861 Compare January 9, 2025 04:50
layer/openxr_layer.cc Outdated Show resolved Hide resolved
@RenfengLiu
Copy link
Collaborator

you'll also need to update the Vulkan side as well, otherwise the server will be started twice for Vulkan application.
please also test with Vulkan application, OpenXR application, and also the shared Unity application that we know has problem.

@elviscapiaq elviscapiaq force-pushed the main branch 2 times, most recently from b32a615 to 952b9b9 Compare January 10, 2025 02:05
@elviscapiaq
Copy link
Collaborator Author

elviscapiaq commented Jan 10, 2025

you'll also need to update the Vulkan side as well, otherwise the server will be started twice for Vulkan application. please also test with Vulkan application, OpenXR application, and also the shared Unity application that we know has problem.

I added also a global object to initialize the server for an Vulkan app, however, it is not working. It seems the server is closed. When I move the server initialization to DiveInterceptCreateInstance at vk_layer_base.cc it works.

@@ -515,6 +523,10 @@ extern "C"
return (PFN_vkVoidFunction)&DiveInterceptEnumerateInstanceExtensionProperties;
if (0 == strcmp(func, "vkCreateInstance"))
return (PFN_vkVoidFunction)&DiveInterceptCreateInstance;
if (0 == strcmp(func, "vkDestroyInstance"))
{
LOGI("vkDestroyInstance");
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this func? only for debug log?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you mean to stop the server in vkDestroyInstance, you will need to implement the interception functions, similar in the openxr layer.


XrSessionData() :
server(GetServerRunner())
struct Server
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to put the server initialization in a separate shared place, so there's no duplicated code. probably you can put it into layer_common.cc

@RenfengLiu
Copy link
Collaborator

initialize

Did you find out why? In theory it should, as it's just move the place of initialization.

int server_main();
}
void StopServer();
int server_main();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you help unify the code style here

void StopServer();
};

extern Server server;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of using extern, maybe it's better to using the tricky of GetServer() as you've implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants