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

Fixup AGS library linking and install #1789

Merged
merged 4 commits into from
Oct 15, 2024

Conversation

davidd-lunarg
Copy link
Contributor

@davidd-lunarg davidd-lunarg commented Oct 7, 2024

Link against the static AGS library. Update code, documentation, and log messages.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 273427.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4970 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4970 failed.

@bradgrantham-lunarg bradgrantham-lunarg added d3d12 Issue with D3D 12 support P1 Prevents an important capture from being replayed labels Oct 7, 2024
@davidd-lunarg davidd-lunarg self-assigned this Oct 8, 2024
@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 274174.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4986 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 4986 failed.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 276073.

Link against the static AGS library. Update code, documentation, and log
messages.
@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 276075.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 5038 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 5038 passed.

CMakeLists.txt Outdated Show resolved Hide resolved
@chrislb-amd
Copy link
Collaborator

chrislb-amd commented Oct 11, 2024

I wonder if instead of caching binaries for AGS, we should submodule https://github.com/GPUOpen-LibrariesAndSDKs/AGS_SDK directly. Are there any aversions to submodule use?

@bradgrantham-lunarg
Copy link
Contributor

I wonder if instead of caching binaries for AGS, we should submodule https://github.com/GPUOpen-LibrariesAndSDKs/AGS_SDK directly. Are there any aversions to submodule use?

No aversions to submodules, but we've mostly done that to import registry XMLs and headers.

We've mostly avoided having to build binaries for other projects from the source as part of our build - you can see we've included the binaries for the compression libraries in the repo, with varying degrees of success. That's always been slightly awkward - it seems like an added burden for one platform to need to download the binaries for the other platforms, but that does only occur generally once.

Recently we've added SPIRV-Reflect, which we compile as part of our build. I think that may have been done as an expedient because we know it's very cross-platform and a straightforward build. @fabian-lunarg ?

How often does AGS change? If the binaries would change very infrequently, I would argue having the built artifacts makes some sense. If it changes frequently, then making building it directly from a submodule is a good idea.

@fabian-lunarg
Copy link
Contributor

fabian-lunarg commented Oct 14, 2024

no aversion against submodules, but it's still not an easy or general choice.
for SPIRV-Reflect (and SPIRV-Headers) we chose the submodule-approach over binaries in external/precompiled. the reasons were:

  • in general submodules(or FetchContent) give more confidence about which exact version we have, compared with precompiled binaries
  • it's one(1) C-file (compiled as static lib) vs. many library-permutations for all platforms. that's much easier to maintain
  • it might occasionally require updates (e.g. we ran into segfaults and could fix those upstream)
  • we already were using submodules for Vulkan-Headers, otherwise FetchContent might have been an alternative

AGS seems to have a slightly different profile here regarding its build-process, frequency of required updates, number of platforms to cover in external/precompiled etc.

@davidd-lunarg
Copy link
Contributor Author

We've mostly avoided having to build binaries for other projects from the source as part of our build

The AGS GitHub repo includes the binaries at https://github.com/GPUOpen-LibrariesAndSDKs/AGS_SDK/tree/master/ags_lib/lib so GFXR wouldn't need to build them. As far as I am aware, source code is not available for the AGS libraries.

Are there any aversions to submodule use?

The size of the AGS repo is ~180MB. The files added in this PR are ~36MB, so maybe that influences the decision.

  1. Is there a way for a submodule to only download certain files from a repo?
  2. Can a submodule be not-default? Non-Windows platforms don't need the AGS libs so it would be good if it was ignored when git submodule update --init is run.

CMake has FetchContent which might allow us to accomplish 1 and/or 2 but it does add a new method for managing dependencies in GFXR.


It isn't clear to me that submodule provides any major benefit, so my thought is to leave the dependency as is. I could look into FetchContent if that is desired.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 278184.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 5056 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 5056 failed.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 278233.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 278233 cancelled.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 278282.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 5059 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 5059 failed.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 278435.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 5061 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 5061 passed.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 278475.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 5062 running.

Don't include the AGS files in the GFXR repo. Instead, attempt to fetch
them from the AGS GitHub.
@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 278514.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 5063 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 5063 passed.

@davidd-lunarg
Copy link
Contributor Author

I've updated the code to use CMake's FetchContent module. Now the AGS GitHub is cloned during the configuration step of CMake. It will only be cloned if AGS is enabled and supported, so other platforms won't need to download the files. In my testing it only seemed to clone once for a clean CMake build and subsequent cmake configuration runs finished more quickly.

Copy link
Contributor

@fabian-lunarg fabian-lunarg left a comment

Choose a reason for hiding this comment

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

nice, good solution with FetchContent

@ci-tester-lunarg
Copy link

CI gfxreconstruct build queued with queue ID 279217.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 5075 running.

@ci-tester-lunarg
Copy link

CI gfxreconstruct build # 5075 passed.

@davidd-lunarg davidd-lunarg merged commit 34ac472 into LunarG:dev Oct 15, 2024
9 checks passed
@davidd-lunarg davidd-lunarg deleted the davidd-ags-cmake branch October 15, 2024 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
d3d12 Issue with D3D 12 support P1 Prevents an important capture from being replayed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants