I see that, even if gromacs ebuild calls cuda_sanitize, it still fails if I don't manually switch gcc version before: -- Adding work-around for issue compiling CUDA code with glibc 2.23 string.h -- Check for working NVCC/C++ compiler combination with nvcc '/opt/cuda/bin/nvcc' -- Check for working NVCC/C compiler combination - broken -- /opt/cuda/bin/nvcc standard output: '' -- /opt/cuda/bin/nvcc standard error: 'In file included from /opt/cuda/bin/../targets/x86_64-linux/include/cuda_runtime.h:83, from <command-line>: /opt/cuda/bin/../targets/x86_64-linux/include/crt/host_config.h:138:2: error: #error -- unsupported GNU version! gcc versions later than 8 are not supported! 138 | #error -- unsupported GNU version! gcc versions later than 8 are not supported! | ^~~~~ ' CMake Error at cmake/gmxManageNvccConfig.cmake:192 (message): NVCC/C++ compiler combination does not seem to be supported. CUDA frequently does not support the latest versions of the host compiler, so you might want to try an earlier C++ compiler version and make sure your CUDA compiler and driver are as recent as possible. Call Stack (most recent call first): cmake/gmxManageGPU.cmake:204 (include) CMakeLists.txt:590 (gmx_gpu_setup) -- Configuring incomplete, errors occurred! See also "/var/tmp/portage/sci-chemistry/gromacs-2019.5-r1/work/gromacs-2019.5_float/CMakeFiles/CMakeOutput.log". See also "/var/tmp/portage/sci-chemistry/gromacs-2019.5-r1/work/gromacs-2019.5_float/CMakeFiles/CMakeError.log". I have tried to export CUDA_NVCC_FLAGS="${NVCCFLAGS}" && export GMX_SET_CUDA_NVCC_FLAGS="${NVCCFLAGS}" but still fails :( Thanks
It will not work as expected. Even if you specify it via cmake env you get issues with gcc/g++/nvcc abi. So its better to use right combination of nvcc/gcc