Skip to content

Include most Vulkan tests in ASan build. - #8489

Merged
ScottTodd merged 2 commits into
iree-org:mainfrom
ScottTodd:asan-vulkan
Mar 15, 2022
Merged

ScottTodd merged 2 commits into
iree-org:mainfrom
ScottTodd:asan-vulkan

Conversation

@ScottTodd

@ScottTodd ScottTodd commented Mar 8, 2022 •

Copy link
Copy Markdown
Member

Progress on #5715 and #5716

Leaks in the Vulkan-related libraries we use were hidden behind incomplete handling of shared library loading/unloading in ASan. By disabling calls to dlclose() in both iree/base/internal/dynamic_library_posix.c and the Vulkan Loader (libvulkan.so.1) so those libraries remained open for ASan to reference, I was able to get useful leak reports. Those reports showed that my NVIDIA system Vulkan ICD (libnvidia-glcore.so) was leaking and an up to date SwiftShader (libvk_swiftshader.so) was not leaking.

This PR updates SwiftShader to a commit that doesn't leak (with our usage, anyways) and enables most of the Vulkan tests that were previously excluded from running under ASan.


A few tests are still failing with crashes in ASan, with logs like this:

Tracer caught signal 11: addr=0x0 pc=0x50c558 sp=0x7fb28fdffd10
==50923==LeakSanitizer has encountered a fatal error.
==50923==HINT: For debugging, try setting environment variable LSAN_OPTIONS=verbosity=1:log_threads=1
==50923==HINT: LeakSanitizer does not work under ptrace (strace, gdb, etc)

(full logs here), so I'm keeping those disabled explicitly.

@ScottTodd ScottTodd added infrastructure Relating to build systems, CI, or testing hal/vulkan Runtime Vulkan GPU HAL backend cleanup 🧹 labels Mar 8, 2022
@ScottTodd ScottTodd changed the title Try including Vulkan tests in ASAN build. Include most Vulkan tests in ASAN build. Mar 14, 2022
@ScottTodd ScottTodd changed the title Include most Vulkan tests in ASAN build. Include most Vulkan tests in ASan build. Mar 14, 2022
@ScottTodd
ScottTodd marked this pull request as ready for review March 14, 2022 23:07
@ScottTodd
ScottTodd removed the request for review from stellaraccident March 14, 2022 23:07
# Only build SwiftShader Vulkan ICD.
RUN cmake -S swiftshader/ -B build-swiftshader/ \
-GNinja \
-DSWIFTSHADER_BUILD_VULKAN=ON \

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Have instructions for building swiftshader changed? I think we may wasn't to drop the comment about only building Vulkan if we're no longer explicitly setting anything to do that

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Some of the options no longer exist: https://swiftshader.googlesource.com/SwiftShader/+/c27e99245d423648fe5f0eafa73d49ce7b53d201/CMakeLists.txt#148, as of https://swiftshader-review.googlesource.com/c/SwiftShader/+/60688:

Remove OpenGL ES targets from the CMake build

The legacy SwiftShader OpenGL ES implementation has been deprecated for
two years, in favor of SwANGLE. Specifically the CMake build was only
meant for development and internal testing purposes, and should have no
further uses.

I was seeing warnings (not errors) for setting unknown options.

The # Only build SwiftShader Vulkan ICD. comment still applies to setting the -DSWIFTSHADER_BUILD_TESTS=OFF option and building just the vk_swiftshader target.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup 🧹 hal/vulkan Runtime Vulkan GPU HAL backend infrastructure Relating to build systems, CI, or testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants