But the following compilation gives this CUDA error:
make
.
.
.
[ 16%] Building CUDA object src/gromacs/CMakeFiles/libgromacs.dir/nbnxm/cuda/nbnxm_cuda_kernel_pruneonly.cu.o
ptxas error : Value of threads per SM for entry _ZN3gmx23nbnxn_kernel_prune_cudaILb1EEEvNS_13NBAtomDataGpuENS_10NBParamGpuENS_11GpuPairlistEi is out of range. .minnctapersm will be ignored
ptxas error : Value of threads per SM for entry _ZN3gmx23nbnxn_kernel_prune_cudaILb0EEEvNS_13NBAtomDataGpuENS_10NBParamGpuENS_11GpuPairlistEi is out of range. .minnctapersm will be ignored
ptxas fatal : Ptx assembly aborted due to errors
make[2]: *** [src/gromacs/CMakeFiles/libgromacs.dir/build.make:3733: src/gromacs/CMakeFiles/libgromacs.dir/nbnxm/cuda/nbnxm_cuda_kernel_pruneonly.cu.o] Error 255
make[1]: *** [CMakeFiles/Makefile2:5762: src/gromacs/CMakeFiles/libgromacs.dir/all] Error 2
make: *** [Makefile:166: all] Error 2
[ 39%] Building CUDA object src/gromacs/CMakeFiles/libgromacs.dir/nbnxm/cuda/nbnxm_cuda.cu.o [ 39%] Building CUDA object src/gromacs/CMakeFiles/libgromacs.dir/nbnxm/cuda/nbnxm_cuda_data_mgmt.cu.o [ 39%] Building CUDA object src/gromacs/CMakeFiles/libgromacs.dir/nbnxm/cuda/nbnxm_cuda_kernel_F_noprune.cu.o [ 39%] Building CUDA object src/gromacs/CMakeFiles/libgromacs.dir/nbnxm/cuda/nbnxm_cuda_kernel_F_prune.cu.o [ 39%] Building CUDA object src/gromacs/CMakeFiles/libgromacs.dir/nbnxm/cuda/nbnxm_cuda_kernel_VF_noprune.cu.o [ 39%] Building CUDA object src/gromacs/CMakeFiles/libgromacs.dir/nbnxm/cuda/nbnxm_cuda_kernel_VF_prune.cu.o [ 39%] Building CUDA object src/gromacs/CMakeFiles/libgromacs.dir/nbnxm/cuda/nbnxm_cuda_kernel_pruneonly.cu.o ptxas error : Value of threads per SM for entry _ZN3gmx23nbnxn_kernel_prune_cudaILb1EEEvNS_13NBAtomDataGpuENS_10NBParamGpuENS_11GpuPairlistEi is out of range. .minnctapersm will be ignored ptxas error : Value of threads per SM for entry _ZN3gmx23nbnxn_kernel_prune_cudaILb0EEEvNS_13NBAtomDataGpuENS_10NBParamGpuENS_11GpuPairlistEi is out of range. .minnctapersm will be ignored ptxas fatal : Ptx assembly aborted due to errors make[2]: *** [src/gromacs/CMakeFiles/libgromacs.dir/build.make:3733: src/gromacs/CMakeFiles/libgromacs.dir/nbnxm/cuda/nbnxm_cuda_kernel_pruneonly.cu.o] Error 255 make[2]: *** Waiting for unfinished jobs… make[1]: *** [CMakeFiles/Makefile2:5762: src/gromacs/CMakeFiles/libgromacs.dir/all] Error 2 make: *** [Makefile:166: all] Error 2
At least some of the issues you’ve encountered should already be fixed in the current release-2026 git branch, but might not have been pulled into main yet, so switching to that branch should also help.
How do you know the CMAKE_CUDA_ARCHITECTURES flag for my not so powerful laptop GPU ? Will the GPU be properly detected with cmake in future Gromacs release ?
But I have RTX 3060 in my workstation, so I happened to know this one :)
They should. It would be great if you can update your source directory to the currentmain (and clean build directory). The fixes have been merged over the last week, so cmake -DGMX_GPU=CUDA should work both with and without CMAKE_CUDA_ARCHITECTURES=native. If you still see problems, share which CMake version you’re using.