mirror of
https://github.com/NVIDIA/nvbench.git
synced 2026-04-20 14:58:54 +00:00
Set CUDA_MODULE_LOADING=EAGER before main. (#157)
* Set `CUDA_MODULE_LOADING=EAGER` before `main`. Fixes #136 * Portability for `setenv`. * Remove pre-main CUDART usage and setup env in main. * Fail examples if they deadlock. This is the best way we have to diagnose a regression for NVIDIA/nvbench#136. * Add an initialize method to benchmark_manager for CUDA-related setup. Benchmarks are created statically, so their constructors cannot call the CUDA APIs without breaking the CUDA_MODULE_LOAD setup. This method is called from `main` after the environment has been configured.
This commit is contained in:
@@ -26,6 +26,12 @@ foreach(example_src IN LISTS example_srcs)
|
||||
COMMAND "$<TARGET_FILE:${example_name}>" --timeout 0.1 --min-time 1e-5
|
||||
)
|
||||
|
||||
# These should not deadlock. If they do, it may be that the CUDA context was created before
|
||||
# setting CUDA_MODULE_LOAD=EAGER in main, see NVIDIA/nvbench#136.
|
||||
set_tests_properties(${example_name} PROPERTIES
|
||||
FAIL_REGULAR_EXPRESSION "Possible Deadlock Detected"
|
||||
)
|
||||
|
||||
add_dependencies(nvbench.example.all ${example_name})
|
||||
endforeach()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user