Closed bnase closed 3 years ago
Any hints on this? I'm interested in having a windows build working as well
Hi Niklas, Thanks for your fixes. I'm setting up environment with VS2015 to look into issue.
Thanks, have you had time to look inte this yet?
Hi Niklas,
Yes, i was able to add some minor modifications to compile non-mpi build on MS VS 2015 (vc14) + Cmake 3.10 + CUDA 9.0, however looks like MPI module of the latest CMake was reworked and i couldn't figure out how to make it work together. I'm trying to build AMGX configured with older CMake (which we have used before) overnight.
I was able to build amgx on MS VS 2015 + CMake 3.4.2 + CUDA 9.0 and merged changes (including those from https://github.com/bnase/AMGX) to upstream. It's hard to support all of possible msvc + cmake combinations and sometimes changes are required for the build if one of them changes. We previously this kind of issues with MSVS 2012/2013 and CMake 2.x/3.x, and current code doesn't compile when generated with CMake 3.10, but we will try to keep code working with latest host and device compilers. What msvc compiler are you working with?
Thanks,
@marsaev Thanks! This combo you mention is one of the ones interesting to me and @niklaskarla. We had tested both MS VS 2015 and 2017. The working combination you mention seems to be modern and generic enough.
@marsaev the compilation is indeed working for the configuration you specified and the latest master. I am not sure what I should expect from the tests and the example in windows, though? Currently most of the test fails, and the amgx_capi.exe in the examples folder using .\amgx_capi.exe -m output.mtx -c .\PBICGSTAB_CLASSICAL_JACOBI.json
crashes. Does mean that the outputs of the compilation is corrupted somehow, or are the tests/examples not correctly configured for windows?
It seems that by compiling amgx_base on a 1060 gtx, with VS 2015, CMake 3.4.2 and CUDA TK 9.0, the binary amgx_capi.exe works fine. Thanks!
@marsaev There are some hardcoded limitations for CC<=3.0 in the source code, but it feels they are redundant, the only real implemetation differences are for CC<=2.0. Do you think it's safe to replace them?
A good start for checking library correctness: 1) call get_version_strings(), which doesn't require prior call to initialize() and can check that API works in general 2) try to solve some small sample matrix with Jacob solver using "host" mode (for example by providing flag "-mode hDDI" to any of examples 3) try doing the same but on device.
These steps can help identify some basic issues with library.
Yes, since CC<3.0 is not supported anymore some parts of the code could be disabled and removed. I'll open a separate issue for that.
Hello:
I am using MS VS 2013 + CMake 3.4.2 + CUDA ToolKit 9.0.
And I got the error when building AmgX
C:/Users/seiferlin/Desktop/AMGX-master/core/../base/include\vector.h(441): error C2614: 'amgx::Vector<amgx::TemplateConfig<AMGX_device,AMGX_vecDouble,AMGX_matDouble,AMGX_indInt>>' : illegal member initialization: 'device_vector_alloc
Is there any fix plan for MS VS 2013 + CMake 3.4.2 + CUDA ToolKit 9.0 ? thank you :)
Hi seiferlin,
We tested release build only on MS VS 2015, but i think VS 2013 should do it to. In particular, for 'device_vector_alloc' alias templates are used, see base/include/vector_thrust_allocator.h#L152 . Could you check that your VS 2013 c++ compiler supports alias templates? It is specified as a supported (https://msdn.microsoft.com/en-us/library/hh567368.aspx), but i just want to make sure that yours does as well.
Hi marsaev:
It may be the same issue. http://kaba.hilvi.org/homepage/blog/vs2013.htm
It might as well be.
MS gives everyone hard time with their features adoption, we already delayed introduction of c++11 to the amgx enough so i would rather abstain from adding workarounds for compilers with these types of issues.
If MSVS2013 is an absolute requirement for you i could suggest forking and searching/replacing 'device_vector_alloc
Hi marsaev:
After replacing all 'device_vector_alloc
Thank you very much :)
Hi,
It's great that AmgX has been released publicly.
I am experiencing issues building under Windows 10 64bit.
The configuration of the system is as follows:
I have downloaded an unzipped the AmgX sources in a folder named "D:\NES_Libs\AMGX-src" and created an empty build folder named "D:\NES_Libs\AMGX-bin"
I have used CMake to configure AmgX leaving all the default choices, and ticking "CMAKE_NO_MPI"
The build fails with 12 errors that are all similar to this:
Hey @AndreaNES ,
There are known issues with latest CMake. Can you try CMake 3.4? Also, i haven't tried MSVS 2017, but maybe using old CMake will do the job.
p.s. please, refrain to quote such large pieces of text in the comments, instead use gists, for example. Thanks!
Hi,
The combination CMake 3.4.2 + VS 2015 allows to build AmgX (though numerous unit tests fail, as I have reported in a different issue discussion few minutes ago). I will try also the combination CMake 3.4.2 + VS2017 and report back on that.
Best Regards,
Andrea
Hi @AndreaNES so did this combination (CMake 3.4.2 + VS2017) work?
Thanks!
Hi,
thanks for following up. In the last weeks I had to rebuild the machine on which I was testing, and our current configuration is:
GPU: Titan Black OS: Win10 Pro 64bit CUDA: 9.2 Compiler: VS 2017 Update 3 Cmake: 4.11.2
Unfortunately we cannot fall back to CMake 3.4.2 as it does not support VS 2017
AmgX does not currently compile with the above configuration, but it looks it might be a minor glitch to fix.
In the first place we had to manually edit:
c:\program files\nvidia gpu computing toolkit\cuda\v9.2\include\crt/host_config.h(133)
As the file is checking for versions of VS 2017 up to Update 1 (or no update at all), and we just removed that check for now.
Having done this, the compiling phase fails with these two error messages:
3>C:/Users/andrea/Desktop/Amgx_src/core/src/solvers/polynomial_solver.cu(291): error C2668: 'amgx::polynomial_solver::poly_postsmooth': ambiguous call to overloaded function 3>C:/Users/andrea/Desktop/Amgx_src/core/src/solvers/polynomial_solver.cu(351): error C2668: 'amgx::polynomial_solver::poly_presmooth': ambiguous call to overloaded function
Specifically the calls in the code which lead to the above errors are:
_polypostsmooth(A, B, C, this->poly);
and
_polypresmooth(A, b, x, this->poly);
Do you have any quick suggestion we might try to fix this ?
I have noticed also that if the binary directory specified in CMake contains spaces (e.g. "my bin dir" vs. "my_bin_dir") CMake will generate configuration files outside of the binary directory. I guess somewhere in CMakeLists some quotes might be missing in some filepath.
Cheers,
Andrea
This is a post scriptum to the previous message: the file that gets generated outside of the specified binary folder when the folder path contains spaces is named "srcTarball"
Hi @AndreaNES,
sorry for a late follow up. I've just tried building it again and I get the exact same errors. I have no suggestions for a fix at the moment but will have a further look into it. Or meanwhile have you managed to get it fixed?
Cheers, Jiho
Hi Jiho,
I haven't been able to spend more time on it, but if I solve the issue I will definitely report back.
Best,
Andrea
On Wed, May 30, 2018 at 9:38 AM, Jiho Yang notifications@github.com wrote:
Hi @AndreaNES https://github.com/AndreaNES,
sorry for a late follow up. I've just tried building it again and I get the exact same errors. I have no suggestions for a fix at the moment but will have a further look into it. Or meanwhile have you managed to get it fixed?
Cheers, Jiho
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/NVIDIA/AMGX/issues/4#issuecomment-393165023, or mute the thread https://github.com/notifications/unsubscribe-auth/APIHuRiEjYx9yiBvQuiDedU4oiuxXKhaks5t3qDcgaJpZM4QLL7n .
@marsaev @AndreaNES
I'm trying to compile the fixed code provided by @bnase on Visual Studio 2017 with cmake 3.11.1, cuda 9.2 and the compilation seems to fail during building amgx_core (and the subsequent ones fails by failing to read the object files from amgx_core).
I get the following error message:
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.12.25827\include\xtree(1960): error : no instance of function "amgx::classical::compare::operator()" matches the argument list and object (the object has type qualifiers that prevent a match) 1> argument types are: (const std::pair<int, int>, const std::pair<int, int>) 1> object type is: const amgx::classical::compare 1> detected during: 1> instantiation of "std::_Tree<_Traits>::_Paircc std::_Tree<_Traits>::_Eqrange(const _Other &) const [with _Traits=std::_Tset_traits<std::pair<int, int>, amgx::classical::compare, std::allocator<std::pair<int, int>>, false>, _Other=std::pair<int, int>]" 1>(2000): here 1> instantiation of "std::_Tree<_Traits>::_Pairii std::_Tree<_Traits>::_Eqrange(const _Other &) [with _Traits=std::_Tset_traits<std::pair<int, int>, amgx::classical::compare, std::allocator<std::pair<int, int>>, false>, _Other=std::pair<int, int>]" 1>(1525): here 1> instantiation of "std::_Tree<_Traits>::_Pairii std::_Tree<_Traits>::equal_range(const std::_Tree<_Traits>::key_type &) [with _Traits=std::_Tset_traits<std::pair<int, int>, amgx::classical::compare, std::allocator<std::pair<int, int>>, false>]" 1>(1395): here 1> instantiation of "std::_Tree<_Traits>::size_type std::_Tree<_Traits>::erase(const std::_Tree<_Traits>::key_type &) [with _Traits=std::_Tset_traits<std::pair<int, int>, amgx::classical::compare, std::allocator<std::pair<int, int>>, false>]" 1>C:/software/repos/AMGX-fork/AMGX-master/core/src/classical/selectors/rs.cu(185): here 1> instantiation of "void amgx::classical::RS_Selector<amgx::TemplateConfig<(AMGX_MemorySpace)0, t_vecPrec, t_matPrec, t_indPrec>>::markCoarseFinePoints_1x1(amgx::classical::RS_Selector<amgx::TemplateConfig<(AMGX_MemorySpace)0, t_vecPrec, t_matPrec, t_indPrec>>::Matrix_h &, amgx::classical::RS_Selector<amgx::TemplateConfig<(AMGX_MemorySpace)0, t_vecPrec, t_matPrec, t_indPrec>>::FVector &, const amgx::classical::RS_Selector<amgx::TemplateConfig<(AMGX_MemorySpace)0, t_vecPrec, t_matPrec, t_indPrec>>::BVector &, amgx::classical::RS_Selector<amgx::TemplateConfig<(AMGX_MemorySpace)0, t_vecPrec, t_matPrec, t_indPrec>>::IVector &, amgx::classical::RS_Selector<amgx::TemplateConfig<(AMGX_MemorySpace)0, t_vecPrec, t_matPrec, t_indPrec>>::IVector &, int) [with t_vecPrec=(AMGX_VecPrecision)0, t_matPrec=(AMGX_MatPrecision)0, t_indPrec=(AMGX_IndPrecision)2]" 1>C:/software/repos/AMGX-fork/AMGX-master/core/src/classical/selectors/rs.cu(334): here 1> 1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.12.25827\include\xtree(1967): error : no instance of function "amgx::classical::compare::operator()" matches the argument list and object (the object has type qualifiers that prevent a match) 1> argument types are: (const std::pair<int, int>, const std::pair<int, int>) 1> object type is: const amgx::classical::compare 1> detected during: 1> instantiation of "std::_Tree<_Traits>::_Paircc std::_Tree<_Traits>::_Eqrange(const _Other &) const [with _Traits=std::_Tset_traits<std::pair<int, int>, amgx::classical::compare, std::allocator<std::pair<int, int>>, false>, _Other=std::pair<int, int>]" 1>(2000): here 1> instantiation of "std::_Tree<_Traits>::_Pairii std::_Tree<_Traits>::_Eqrange(const _Other &) [with _Traits=std::_Tset_traits<std::pair<int, int>, amgx::classical::compare, std::allocator<std::pair<int, int>>, false>, _Other=std::pair<int, int>]" 1>(1525): here 1> instantiation of "std::_Tree<_Traits>::_Pairii std::_Tree<_Traits>::equal_range(const std::_Tree<_Traits>::key_type &) [with _Traits=std::_Tset_traits<std::pair<int, int>, amgx::classical::compare, std::allocator<std::pair<int, int>>, false>]" 1>(1395): here 1> instantiation of "std::_Tree<_Traits>::size_type std::_Tree<_Traits>::erase(const std::_Tree<_Traits>::key_type &) [with _Traits=std::_Tset_traits<std::pair<int, int>, amgx::classical::compare, std::allocator<std::pair<int, int>>, false>]" 1>C:/software/repos/AMGX-fork/AMGX-master/core/src/classical/selectors/rs.cu(185): here 1> instantiation of "void amgx::classical::RS_Selector<amgx::TemplateConfig<(AMGX_MemorySpace)0, t_vecPrec, t_matPrec, t_indPrec>>::markCoarseFinePoints_1x1(amgx::classical::RS_Selector<amgx::TemplateConfig<(AMGX_MemorySpace)0, t_vecPrec, t_matPrec, t_indPrec>>::Matrix_h &, amgx::classical::RS_Selector<amgx::TemplateConfig<(AMGX_MemorySpace)0, t_vecPrec, t_matPrec, t_indPrec>>::FVector &, const amgx::classical::RS_Selector<amgx::TemplateConfig<(AMGX_MemorySpace)0, t_vecPrec, t_matPrec, t_indPrec>>::BVector &, amgx::classical::RS_Selector<amgx::TemplateConfig<(AMGX_MemorySpace)0, t_vecPrec, t_matPrec, t_indPrec>>::IVector &, amgx::classical::RS_Selector<amgx::TemplateConfig<(AMGX_MemorySpace)0, t_vecPrec, t_matPrec, t_indPrec>>::IVector &, int) [with t_vecPrec=(AMGX_VecPrecision)0, t_matPrec=(AMGX_MatPrecision)0, t_indPrec=(AMGX_IndPrecision)2]" 1>C:/software/repos/AMGX-fork/AMGX-master/core/src/classical/selectors/rs.cu(334): here 1> 1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Tools\MSVC\14.12.25827\include\xtree(1981): error : no instance of function "amgx::classical::compare::operator()" matches the argument list and object (the object has type qualifiers that prevent a match) 1> argument types are: (const std::pair<int, int>, const std::pair<int, int>) 1> object type is: const amgx::classical::compare 1> detected during: 1> instantiation of "std::_Tree<_Traits>::_Paircc std::_Tree<_Traits>::_Eqrange(const _Other &) const [with _Traits=std::_Tset_traits<std::pair<int, int>, amgx::classical::compare, std::allocator<std::pair<int, int>>, false>, _Other=std::pair<int, int>]" 1>(2000): here 1> instantiation of "std::_Tree<_Traits>::_Pairii std::_Tree<_Traits>::_Eqrange(const _Other &) [with _Traits=std::_Tset_traits<std::pair<int, int>, amgx::classical::compare, std::allocator<std::pair<int, int>>, false>, _Other=std::pair<int, int>]" 1>(1525): here 1> instantiation of "std::_Tree<_Traits>::_Pairii std::_Tree<_Traits>::equal_range(const std::_Tree<_Traits>::key_type &) [with _Traits=std::_Tset_traits<std::pair<int, int>, amgx::classical::compare, std::allocator<std::pair<int, int>>, false>]" 1>(1395): here 1> instantiation of "std::_Tree<_Traits>::size_type std::_Tree<_Traits>::erase(const std::_Tree<_Traits>::key_type &) [with _Traits=std::_Tset_traits<std::pair<int, int>, amgx::classical::compare, std::allocator<std::pair<int, int>>, false>]" 1>C:/software/repos/AMGX-fork/AMGX-master/core/src/classical/selectors/rs.cu(185): here 1> instantiation of "void amgx::classical::RS_Selector<amgx::TemplateConfig<(AMGX_MemorySpace)0, t_vecPrec, t_matPrec, t_indPrec>>::markCoarseFinePoints_1x1(amgx::classical::RS_Selector<amgx::TemplateConfig<(AMGX_MemorySpace)0, t_vecPrec, t_matPrec, t_indPrec>>::Matrix_h &, amgx::classical::RS_Selector<amgx::TemplateConfig<(AMGX_MemorySpace)0, t_vecPrec, t_matPrec, t_indPrec>>::FVector &, const amgx::classical::RS_Selector<amgx::TemplateConfig<(AMGX_MemorySpace)0, t_vecPrec, t_matPrec, t_indPrec>>::BVector &, amgx::classical::RS_Selector<amgx::TemplateConfig<(AMGX_MemorySpace)0, t_vecPrec, t_matPrec, t_indPrec>>::IVector &, amgx::classical::RS_Selector<amgx::TemplateConfig<(AMGX_MemorySpace)0, t_vecPrec, t_matPrec, t_indPrec>>::IVector &, int) [with t_vecPrec=(AMGX_VecPrecision)0, t_matPrec=(AMGX_MatPrecision)0, t_indPrec=(AMGX_IndPrecision)2]" 1>C:/software/repos/AMGX-fork/AMGX-master/core/src/classical/selectors/rs.cu(334): here 1> 1>3 errors detected in the compilation of "C:/Users/q455729/AppData/Local/Temp/tmpxft_00004b6c_00000000-10_rs.cpp1.ii". 1>rs.cu 1>CMake Error at amgx_core_generated_rs.cu.obj.Release.cmake:283 (message): 1> Error generating file 1> C:/software/repos/AMGX-fork/AMGX-master/build/core/CMakeFiles/amgx_core.dir/src/classical/selectors/Release/amgx_core_generated_rs.cu.obj 1> 1> 1>Done building project "amgx_core.vcxproj" -- FAILED. ========== Build: 0 succeeded, 1 failed, 1 up-to-date, 0 skipped ==========
Do you guys have any suggestions fixing this? I tried removing typedef alias (typedef std::pair< int, int> pair_type;) on rs.cu and replacing pair_type with std::pair <int, int>.
Regarding https://github.com/NVIDIA/AMGX/issues/4#issuecomment-392049588 , srcTarball is just an artifact of an old build to generate sources file list, i will remove it.
Regarding https://github.com/NVIDIA/AMGX/issues/4#issuecomment-397261801. As a workaround you might just comment interiors of the markCoarseFinePoints_1x1() method in this file - it's host only implementation and it is here only for a reference.
Compare operator https://github.com/NVIDIA/AMGX/blob/master/core/src/classical/selectors/rs.cu#L50 matches Compare requirement (http://en.cppreference.com/w/cpp/named_req/Compare), and, for example, declaration matches std::less (http://en.cppreference.com/w/cpp/utility/functional/less), so i think this is compiler issue.
Regarding https://github.com/NVIDIA/AMGX/issues/4#issuecomment-392048446 , i would try to move poly_postsmooth() and poly_presmooth() functions to partially specialized class/struct with general template throwing "not supported" error.
@pyramidpoint it's possible that windows interprets backslashes as special characters. Try specify path to the configuration in OS-canonical way.
@marsaev thank u,I've worked it out
We will try making sure AMGX builds on latest MSVS. At this moment (release 2.2.0) it works with MSVS 2019 / CUDA 10.2, 11.0
@marsaev What is the current status regarding Windows builds? We have been trying to build latest AMGX with both VS 2015/2017 and CUDA TK 8/9 versions, with no success. In https://github.com/bnase/AMGX you can find a fork with the latest fixes we have employed in order to build AMGX under Windows. Seems we have solved some, but not all of the issues.