-
Notifications
You must be signed in to change notification settings - Fork 765
[SYCL][UR] Add Windows debug libs to install target #17512
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
base: sycl
Are you sure you want to change the base?
Conversation
8a462bf
to
3c4e12e
Compare
613d83b
to
a448455
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bratpiorka as mentioned in my last email, here's where to hook in the UMF debug postfix option and copy/install the library to the relevant places.
-DUMF_LINK_HWLOC_STATICALLY:BOOL=${UMF_LINK_HWLOC_STATICALLY} | ||
-DUMF_DISABLE_HWLOC:BOOL=${UMF_DISABLE_HWLOC} | ||
# TODO: Enable d suffix in UMF | ||
# -DUMF_USE_DEBUG_POSTFIX=ON |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Enable building umfd.dll
/umfd.lib
in the UR subbuild.
urd_copy_library_to_build(ur_adapter_${adatper}d) | ||
endforeach() | ||
# TODO: Also copy umfd.dll/umfd.lib | ||
# urd_copy_library_to_build(umfd) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copy umfd.dll
/umfd.lib
into the parent <build>/bin
/<build>/lib
directories for use in testing.
# TODO: Also install umfd.dll/umfd.lib | ||
# install( | ||
# FILES ${URD_INSTALL_DIR}/bin/umfd.dll | ||
# DESTINATION "bin" COMPONENT unified-memory-framework) | ||
# install( | ||
# FILES ${URD_INSTALL_DIR}/lib/umfd.lib | ||
# DESTINATION "lib${LLVM_LIBDIR_SUFFIX}" COMPONENT unified-memory-framework) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add umfd.dll
/umfd.lib
to the install target.
-P ${CMAKE_BINARY_DIR}/cmake_install.cmake | ||
# TODO: Also install debug UMF runtime libraries component | ||
DEPENDS unified-runtime-libraries | ||
# TODO: Add dependency on building debug UMF libraries |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add command to install only umfd.dll
/umfd.lib
, we don't want a full install here since we only care about the runtime libraries being installed with the debug postfix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, see changes in oneapi-src/unified-memory-framework#1238
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, I'll test this today.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is mostly working, I've commented on the PR with one issue.
This patch adds the `install-unified-runtime-libraries` target which installs only the runtime library subset of targets. This can be used to provide `ur_loaderd.dll` and `ur_adatper_<name>d.dll` which link against the multithreaded debug DLL C runtime by using the `DEBUG_POSTFIX` target property to append `d` to the library names.
Instead of implicitly adding the `d` suffix to library names make this optional. `DEBUG_POSTFIX` appears to be broken on Windows, the place it's most useful, as `urinfo.exe` still attempts to load `ur_loader.dll` when it should be looking for `ur_loaderd.dll`. Switching this over to `OUTPUT_NAME ${name}d` fixes this.
Looks like combining `DEBUG_POSTFIX=d` and then setting `LIBRARY_OUTPUT_NAME`/`RUNTIME_OUTPUT_NAME` exposes a bug in CMake where the `DEBUG_POSTFIX` is ignored for the `ur_loader.dll`. Removing these redundant propert setters fixed the previous issue.
Using ExternalProject this commit adds a subbuild of UR in compiled in debug mode and with the `UR_USE_DEBUG_POSTFIX` option enabled. The resulting libraries are then copied to the `<build>/bin`/`<build>/lib` directories so they can be used in testing (not yet implemented). Additionally, they are also included in the `deploy-sycl-toolchain` install target alongside the normally named runtime libraries.
a448455
to
468c07c
Compare
--build <BINARY_DIR> | ||
--target install-unified-runtime-libraries | ||
CMAKE_CACHE_ARGS | ||
-DCMAKE_BUILD_TYPE:STRING=Debug |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Windows generators might ignore CMAKE_BUILD_TYPE
. Consider using a cmake argument --config Debug
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would need to be included in the install command?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, in the install command add: --config Debug
. And perhaps leave -DCMAKE_BUILD_TYPE:STRING=Debug
here as well, just for the case where Unix Makefiles
generator is used on Windows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks reasonable to me, but I would like to also hear @cperkinsintel thoughts on this.
There is a PR with requested changes in UMF if you would like to test them: oneapi-src/unified-memory-framework#1219 |
@kbenzie - Is this ready to go in (after a conflict resolution?) |
It needs to pull in the UMF changes which I've not tested yet due a few high priority bug reports that have come in this week. |
install-unified-runtime-libraries
which installs only the runtime library subset of targets. This can be used to provideur_loaderd.dll
andur_adatper_<name>d.dll
which link against the multithreaded debug DLL C runtime by using theDEBUG_POSTFIX
target property to appendd
to the library names.UR_USE_DEBUG_POSTFIX
option to enable adding thed
suffix to library names.OUTPUT_NAME
s as combiningDEBUG_POSTFIX=d
and then settingLIBRARY_OUTPUT_NAME
/RUNTIME_OUTPUT_NAME
exposes a bug in CMake where theDEBUG_POSTFIX
is ignored for theur_loader.dll
. Removing these redundant property setters fixed the previous issue.ExternalProject
compiled in debug mode and with theUR_USE_DEBUG_POSTFIX
option enabled.<build>/bin
/<build>/lib
directories so they can be used in testing (not yet implemented).deploy-sycl-toolchain
install target alongside the normally named runtime libraries.ur_proxy_loaderd.dll
to use Windows debug libs