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

Support for RTX #1693

Closed
schoetbi opened this issue Jul 18, 2019 · 7 comments
Closed

Support for RTX #1693

schoetbi opened this issue Jul 18, 2019 · 7 comments
Labels

Comments

@schoetbi
Copy link

schoetbi commented Jul 18, 2019

I successfully used Catch v2.1.2 together with the Intervalzero RTX operting system. Now I try to upgrade from Catch v2.1.2 to v2.9.1.

Unfortunately I get the following linker errors when I enable the benchmark feature with CATCH_CONFIG_ENABLE_BENCHMARKING:


Severity	Code	Description	Project	File	Line	Suppression State
Error	LNK2019	unresolved external symbol "public: bool __cdecl Concurrency::critical_section::try_lock(void)" (?try_lock@critical_section@Concurrency@@QEAA_NXZ) referenced in function "public: virtual bool __cdecl Concurrency::details::stl_critical_section_concrt::try_lock(void)" (?try_lock@stl_critical_section_concrt@details@Concurrency@@UEAA_NXZ)	CalcTask.Test	S:\sara_rt\src\CalcTask.Test\libcpmtd.lib(mutex.obj)	1	
Error	LNK2019	unresolved external symbol "public: bool __cdecl Concurrency::critical_section::try_lock_for(unsigned int)" (?try_lock_for@critical_section@Concurrency@@QEAA_NI@Z) referenced in function "public: virtual bool __cdecl Concurrency::details::stl_critical_section_concrt::try_lock_for(unsigned int)" (?try_lock_for@stl_critical_section_concrt@details@Concurrency@@UEAA_NI@Z)	CalcTask.Test	S:\sara_rt\src\CalcTask.Test\libcpmtd.lib(mutex.obj)	1	
Error	LNK2019	unresolved external symbol "public: bool __cdecl Concurrency::details::_Condition_variable::wait_for(class Concurrency::critical_section &,unsigned int)" (?wait_for@_Condition_variable@details@Concurrency@@QEAA_NAEAVcritical_section@3@I@Z) referenced in function "public: virtual bool __cdecl Concurrency::details::stl_condition_variable_concrt::wait_for(class Concurrency::details::stl_critical_section_interface *,unsigned int)" (?wait_for@stl_condition_variable_concrt@details@Concurrency@@UEAA_NPEAVstl_critical_section_interface@23@I@Z)	CalcTask.Test	S:\sara_rt\src\CalcTask.Test\libcpmtd.lib(cond.obj)	1	
Error	LNK2019	unresolved external symbol "public: void __cdecl Concurrency::critical_section::lock(void)" (?lock@critical_section@Concurrency@@QEAAXXZ) referenced in function "public: virtual void __cdecl Concurrency::details::stl_critical_section_concrt::lock(void)" (?lock@stl_critical_section_concrt@details@Concurrency@@UEAAXXZ)	CalcTask.Test	S:\sara_rt\src\CalcTask.Test\libcpmtd.lib(mutex.obj)	1	
Error	LNK2019	unresolved external symbol "public: void __cdecl Concurrency::critical_section::unlock(void)" (?unlock@critical_section@Concurrency@@QEAAXXZ) referenced in function "public: virtual void __cdecl Concurrency::details::stl_critical_section_concrt::unlock(void)" (?unlock@stl_critical_section_concrt@details@Concurrency@@UEAAXXZ)	CalcTask.Test	S:\sara_rt\src\CalcTask.Test\libcpmtd.lib(mutex.obj)	1	
Error	LNK2019	unresolved external symbol "public: void __cdecl Concurrency::details::_Condition_variable::notify_all(void)" (?notify_all@_Condition_variable@details@Concurrency@@QEAAXXZ) referenced in function "public: virtual void __cdecl Concurrency::details::stl_condition_variable_concrt::notify_all(void)" (?notify_all@stl_condition_variable_concrt@details@Concurrency@@UEAAXXZ)	CalcTask.Test	S:\sara_rt\src\CalcTask.Test\libcpmtd.lib(cond.obj)	1	
Error	LNK2019	unresolved external symbol "public: void __cdecl Concurrency::details::_Condition_variable::notify_one(void)" (?notify_one@_Condition_variable@details@Concurrency@@QEAAXXZ) referenced in function "public: virtual void __cdecl Concurrency::details::stl_condition_variable_concrt::notify_one(void)" (?notify_one@stl_condition_variable_concrt@details@Concurrency@@UEAAXXZ)	CalcTask.Test	S:\sara_rt\src\CalcTask.Test\libcpmtd.lib(cond.obj)	1	
Error	LNK2019	unresolved external symbol "public: void __cdecl Concurrency::details::_Condition_variable::wait(class Concurrency::critical_section &)" (?wait@_Condition_variable@details@Concurrency@@QEAAXAEAVcritical_section@3@@Z) referenced in function "public: virtual void __cdecl Concurrency::details::stl_condition_variable_concrt::wait(class Concurrency::details::stl_critical_section_interface *)" (?wait@stl_condition_variable_concrt@details@Concurrency@@UEAAXPEAVstl_critical_section_interface@23@@Z)	CalcTask.Test	S:\sara_rt\src\CalcTask.Test\libcpmtd.lib(cond.obj)	1	
Error	LNK2019	unresolved external symbol "public: __cdecl Concurrency::critical_section::critical_section(void)" (??0critical_section@Concurrency@@QEAA@XZ) referenced in function "public: __cdecl Concurrency::details::stl_critical_section_concrt::stl_critical_section_concrt(void)" (??0stl_critical_section_concrt@details@Concurrency@@QEAA@XZ)	CalcTask.Test	S:\sara_rt\src\CalcTask.Test\libcpmtd.lib(mutex.obj)	1	
Error	LNK2019	unresolved external symbol "public: __cdecl Concurrency::critical_section::~critical_section(void)" (??1critical_section@Concurrency@@QEAA@XZ) referenced in function "public: void * __cdecl Concurrency::critical_section::`scalar deleting destructor'(unsigned int)" (??_Gcritical_section@Concurrency@@QEAAPEAXI@Z)	CalcTask.Test	S:\sara_rt\src\CalcTask.Test\libcpmtd.lib(mutex.obj)	1	
Error	LNK2019	unresolved external symbol "public: __cdecl Concurrency::details::_Condition_variable::_Condition_variable(void)" (??0_Condition_variable@details@Concurrency@@QEAA@XZ) referenced in function "public: __cdecl Concurrency::details::stl_condition_variable_concrt::stl_condition_variable_concrt(void)" (??0stl_condition_variable_concrt@details@Concurrency@@QEAA@XZ)	CalcTask.Test	S:\sara_rt\src\CalcTask.Test\libcpmtd.lib(cond.obj)	1	
Error	LNK2019	unresolved external symbol "public: __cdecl Concurrency::details::_Condition_variable::~_Condition_variable(void)" (??1_Condition_variable@details@Concurrency@@QEAA@XZ) referenced in function "public: void * __cdecl Concurrency::details::_Condition_variable::`scalar deleting destructor'(unsigned int)" (??_G_Condition_variable@details@Concurrency@@QEAAPEAXI@Z)	CalcTask.Test	S:\sara_rt\src\CalcTask.Test\libcpmtd.lib(cond.obj)	1	
Error	LNK2019	unresolved external symbol __imp_DuplicateHandle referenced in function _Thrd_current	CalcTask.Test	S:\sara_rt\src\CalcTask.Test\libcpmtd.lib(cthread.obj)	1	
Error	LNK2019	unresolved external symbol __imp_GetNativeSystemInfo referenced in function _Thrd_hardware_concurrency	CalcTask.Test	S:\sara_rt\src\CalcTask.Test\libcpmtd.lib(cthread.obj)	1	
Error	LNK2019	unresolved external symbol __imp_QueueUserWorkItem referenced in function "int __cdecl Concurrency::details::_Schedule_chore(struct Concurrency::details::_Threadpool_chore *)" (?_Schedule_chore@details@Concurrency@@YAHPEAU_Threadpool_chore@12@@Z)	CalcTask.Test	S:\sara_rt\src\CalcTask.Test\libcpmtd.lib(taskscheduler.obj)	1	
Error	LNK2019	unresolved external symbol __imp_RtlCaptureStackBackTrace referenced in function "unsigned __int64 __cdecl Concurrency::details::platform::CaptureCallstack(void * *,unsigned __int64,unsigned __int64)" (?CaptureCallstack@platform@details@Concurrency@@YA_KPEAPEAX_K1@Z)	CalcTask.Test	S:\sara_rt\src\CalcTask.Test\libcpmtd.lib(ppltasks.obj)	1	

When disabling async with CATCH_CONFIG_NO_USE_ASYNC the build succeeds. But when running the test I get a crash because the class std::random_device is not supported under RTX.

This leads me to the question if there is a kind of OSAL (Operating System Abstraction Layer) so that any operating system with console IO and timing measurement could use Catch (with the benchmarking feature).

In the past I had to opt use CATCH_CONFIG_NO_WINDOWS_SEH and CATCH_CONFIG_COLOUR_NONE to be able to use Catch with RTX but I do not see a solution to opt out the std::random_device

Expected behavior
New flag to opt out types from random-header CATCH_CONFIG_NO_RANDOM ?

Platform information:

  • OS: Windows 10
  • Compiler+version: MSVC v140
  • Catch version: v2.9.1
  • Intervalzero RTX: RTX64 3.6
@fodinabor
Copy link
Contributor

When does the application crash, right at the start or after starting the benchmark?
Could you verify if it is enough to start the application with the --benchmark-no-analysis command line option?

@schoetbi
Copy link
Author

The application crashes at the line static std::random_device entropy;

Running the tests with --benchmark-no-analysis works .

I found in the documentation that there is no bootstrapping done. But what exactly do I disable here? Where can I find out more about the internals of the benchmarking process? Also I would read more about the numbers at the end of the benchmark. Where could I find this?

@fodinabor
Copy link
Contributor

what is called bootstrapping here is the statistical analysis of the measured values, this means (using the default values): 100 samples are actually measured, but afterwards 10000 times a sample is randomly selected and then on these 10000 samples statistical metrics like the mean and std deviation is calculated.

if disabling this analysis, you still get the mean calculated over the 100 measured samples, but you don't get statistical proven data.

@schoetbi
Copy link
Author

Thank you for this explanation. I think this issue can be closed.

@horenmar
Copy link
Member

Is there a macro that identifies compiler targeting the RTX platform? If so, we can make Catch2 autoconfigure some toggles for you (so SEH will be disabled by default, same for async and colours).

@schoetbi
Copy link
Author

@horenmar: This is a great idea and indeed there are several defines:

  • UNDER_RTSS (Defined if build for realtime kernel)
  • RTX64_BUILD=4762, RTX64_BUILD_STR="4762" for the version

If such a define is present the following things should be done:

  • CATCH_CONFIG_NO_WINDOWS_SEH
  • CATCH_CONFIG_COLOUR_NONE
  • CATCH_CONFIG_NO_USE_ASYNC
  • --benchmark-no-analysis should be true by default. For this there should be another define: "CATCH_CONFIG_NO_BENCHMARK_ANALYSIS"

@schoetbi
Copy link
Author

schoetbi commented Aug 6, 2019

Thank you for integrating this!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants