<div dir="ltr">Hello,<div><br></div><div>I have been working on building gromacs with GMX_GPU=ON in MSVC 2019 (and cuda 10.1)  I&#39;ve used the Ninja and Visual studio 2019 Win64 generators, and I&#39;m using the x64 cl.exe as the host compiler, cxx compiler, etc. </div><div><br></div><div>With GMX_GPU=OFF, I only needed to make sure there were no spaces in some of the cmake flags (I changed CUDA_TOOLKIT_ROOT_DIR, MKL_LIBRARIES, MKL_INCLUDE_DIR), and everything builds and runs fine.</div><div><br></div><div>With GMX_GPU=ON, I&#39;ve seen a couple of issues. First, and I&#39;ve gotten around this by changing CUDA_HOST_COMPILER, the location ${VCInstallDir}bin no longer points to a valid compiler. MS has opted to change the location and provide separate x86 and x64 compilers and cross compilers. I&#39;ve pointed the CUDA_HOST_COMPILER variable to the same compiler as the other CMAKE_C**_COMPILER variables, </div><div>C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.21.27702\bin\Hostx64\x64\cl.exe<br></div><div>I&#39;m not sure that this is the compiler I should be using, as GPU should be single precision, but I wanted to be consistent.</div><div><br></div><div>I&#39;m running into an issue in the CUDA code. Specifically, there are a few lines in <a href="http://nbnxm_cuda.cu">nbnxm_cuda.cu</a> that set up for launching the kernel (lines 834, 879, etc):<br></div><div><br></div><div>const auto kernelArgs          = prepareGpuKernelArguments(kernelFn, config,<br>                                                               &amp;numColumns,<br>                                                               &amp;xqPtr,<br>                                                               &amp;setFillerCoords,<br>                                                               &amp;d_x,<br>                                                               &amp;d_atomIndices,<br>                                                               &amp;d_cxy_na,<br>                                                               &amp;d_cxy_ind,<br>                                                               &amp;cellOffset,<br>                                                               &amp;numAtomsPerCell);<br>    launchGpuKernel(kernelFn, config, nullptr, &quot;XbufferOps&quot;, kernelArgs);<br></div><div><br></div><div>the relevant template generating prepareGpuKernelArguments is (I think, from cudautils.cuh):</div><div><br></div><div>template &lt;typename ... Args&gt;<br>std::array&lt;void *, sizeof ... (Args)&gt; prepareGpuKernelArguments(void                     (*kernel)(Args...),<br>                                                                const KernelLaunchConfig &amp; /*config */,<br>                                                                const Args *...          argsPtrs)<br>{<br>    std::array&lt;void *, sizeof ... (Args)&gt; kernelArgs;<br>    prepareGpuKernelArgument(kernel, &amp;kernelArgs, 0, argsPtrs ...);<br>    return kernelArgs;<br>}<br></div><div><br></div><div>the compiler throws a fit with this, stating that (I&#39;ve changed the order to what I understand to be cause/effect):</div><div><br></div><div>1. &quot;Error        C2782        &#39;std::array&lt;void*,sizeof...(Args)&gt; prepareGpuKernelArguments(void (__cdecl *)(Args...),const KernelLaunchConfig &amp;,const Args *...)&#39;: template parameter &#39;Args&#39; is ambiguous &quot;</div><div>2. &quot; &#39;prepareGpuKernelArguments&#39;: no matching overloaded function found</div><div>3. &quot; &#39;kernelArgs&#39;: cannot be used before it is initialized</div><div>4. &quot; &#39;kernelArgs&#39;: an object of const-qualified type must be initialized</div><div>5. &quot; &#39;void launchGpuKernel&lt;const float3*__restrict ,rvec(*),const int*__restrict ,int,int&gt;(void (__cdecl *)(const float3 *__restrict ,rvec (*),const int *__restrict ,int,int),const KernelLaunchConfig &amp;,CommandEvent *,const char *,const std::array&lt;void *,5&gt; &amp;)&#39;: cannot convert argument 5 from &#39;int&#39; to &#39;const std::array&lt;void *,5&gt; &amp;&#39; <a href="http://nbnxm_cuda.cu">nbnxm_cuda.cu</a>        886 </div><div><br></div><div>Seems to me that VS isn&#39;t recognizing some feature here. Is this something that might be easy to fix? </div><div><br></div><div>Thanks,</div><div>Adriaan Riet</div></div>