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

Installed layer JSON has the wrong path #48

Closed
cwabbott0 opened this issue Sep 30, 2019 · 7 comments · Fixed by #49
Closed

Installed layer JSON has the wrong path #48

cwabbott0 opened this issue Sep 30, 2019 · 7 comments · Fixed by #49

Comments

@cwabbott0
Copy link

Doing the standard mkdir build; cd build; cmake ..; make; sudo make install will install /usr/local/share/vulkan/explicit_layer.d/VkLayer_fossilize.json and /usr/local/lib/libVkLayer_fossilize.so, but the json file has "library_path": "libVkLayer_fossilize.so", i.e. it has an incorrect relative path to libVkLayer_fossilize.so, which makes the installed json file useless as-is. This was apparently missed with #47.

@HansKristian-Work
Copy link
Collaborator

Sure? Try running cmake again to reconfigure, it works for me. I fixed it after the PR was merged.

@HansKristian-Work
Copy link
Collaborator

After installing, I get

{
    "file_format_version" : "1.0.0",
    "layer" : {
        "name": "VK_LAYER_fossilize",
        "type": "GLOBAL",
        "library_path": "libVkLayer_fossilize.so",
        "api_version": "1.1.98",
        "implementation_version": "1",
        "description": "Fossilize capture layer"
    }
}

the JSON file in the build directory however has:

{
    "file_format_version" : "1.0.0",
    "layer" : {
        "name": "VK_LAYER_fossilize",
        "type": "GLOBAL",
        "library_path": "./libVkLayer_fossilize.so",
        "api_version": "1.1.98",
        "implementation_version": "1",
        "description": "Fossilize capture layer"
    }
}

@cwabbott0
Copy link
Author

Yes, I have the latest commit from master, and I just installed it. I got the exact same thing as you, and it doesn't work. From reading https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/blob/master/loader/LoaderAndLayerInterface.md#layer-manifest-file-format more closely, it seems that when "library_path" doesn't start with . or / it tries to find it on the library search path (i.e. LD_LIBRARY_PATH). I hadn't added /usr/local/lib to my LD_LIBRARY_PATH (and at least on Fedora it isn't on the library search path by default), which is probably why it happens to work for you and not me. The path in the json file should be absolute, so that once the json file is found you know that it's going to correctly find the library. This is what every other Vulkan json file that I know of does.

@HansKristian-Work
Copy link
Collaborator

Hm, the validation layers do not do this on Arch at least, but I guess I can force absolute paths.

@cwabbott0
Copy link
Author

At least renderdoc and steam also use an absolute path. The validation layers are installed by the OS and are part of the base Vulkan system, so it's probably ok to assume that the library file is in the system path, but that's not a good assumption to make by any third-party thing. What if someone has a non-standard install prefix?

@HansKristian-Work
Copy link
Collaborator

Pushed a PR which uses absolute paths, please try it.

@cwabbott0
Copy link
Author

Works for me, thanks!

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 a pull request may close this issue.

2 participants