Building root with cuda11.5

_ROOT Version:6.24.06
_Platform:fedora 35
_Compiler:gcc (GCC) 11.2.1 20211203


After an upgrade I am getting a compilation errors on Cuda.cu , CudaMatrix.cu, and CudaTensor.Cu. From the comments on these routines they seem to play tricks with the compiler.
My build command is
cmake -DCMAKE_CUDA_COMPILER="/usr/local/cuda-11/bin/nvcc" -DCMAKE_CUDA_STANDARD=“14” -DCMAKE_CXX_STANDARD=“14” -DCMAKE_INSTALL_PREFIX="/home/olin/packages/rootv6.24_install" -Dcuda=“ON” -Dcudnn=“OFF” -Dgvis=“ON” -Dminuit2=“ON” -Dtmva-cpu=“ON” -Dtmva-gpu=“ON” -Dvmc=“ON” /home/olin/packages/root_src
Also tried standards 11 and 17 with the same result.
Cuda sample code for matrix multiplications does run on my upgraded installation.
I would appreciate any help with this. Is it an actual bug to report?

The errors are

Blockquote
97%] Building CUDA object tmva/tmva/CMakeFiles/TMVA.dir/src/DNN/Architectures/Cuda.cu.o
[ 97%] Building CUDA object tmva/tmva/CMakeFiles/TMVA.dir/src/DNN/Architectures/Cuda/CudaMatrix.cu.o
[ 97%] Building CUDA object tmva/tmva/CMakeFiles/TMVA.dir/src/DNN/Architectures/Cuda/CudaTensor.cu.o
/usr/include/c++/11/bits/std_function.h:435:145: error: parameter packs not expanded with ‘…’:
435 | function(_Functor&& __f)
| ^
/usr/include/c++/11/bits/std_function.h:435:145: note: ‘_ArgTypes’
/usr/include/c++/11/bits/std_function.h:530:146: error: parameter packs not expanded with ‘…’:
530 | operator=(_Functor&& __f)
| ^
/usr/include/c++/11/bits/std_function.h:530:146: note: ‘_ArgTypes’
/home/olin/packages/root_src/core/base/inc/TStorage.h:131:37: warning: declaration of ‘static void TStorage::UpdateIsOnHeap(const volatile UInt_t&, volatile UInt_t&)’ with attribute ‘noinline’ follows inline declaration [-Wattributes]
131 | R__NEVER_INLINE void TStorage::UpdateIsOnHeap(volatile const UInt_t &uniqueID, volatile UInt_t &bits) {
| ^~~~~~~~
/home/olin/packages/root_src/core/base/inc/TStorage.h:91:20: note: previous declaration of ‘static void TStorage::UpdateIsOnHeap(const volatile UInt_t&, volatile UInt_t&)’ here
91 | static void UpdateIsOnHeap(volatile const UInt_t &uniqueID, volatile UInt_t &bits);
| ^~~~~~~~~~~~~~
/usr/include/c++/11/bits/std_function.h:435:145: error: parameter packs not expanded with ‘…’:
435 | function(_Functor&& __f)
| ^
/usr/include/c++/11/bits/std_function.h:435:145: note: ‘_ArgTypes’
/usr/include/c++/11/bits/std_function.h:530:146: error: parameter packs not expanded with ‘…’:
530 | operator=(_Functor&& __f)
| ^
/usr/include/c++/11/bits/std_function.h:530:146: note: ‘_ArgTypes’
make[2]: *** [tmva/tmva/CMakeFiles/TMVA.dir/build.make:2414: tmva/tmva/CMakeFiles/TMVA.dir/src/DNN/Architectures/Cuda/CudaMatrix.cu.o] Error 1
make[2]: *** Waiting for unfinished jobs…
/home/olin/packages/root_src/core/base/inc/TStorage.h:131:37: warning: declaration of ‘static void TStorage::UpdateIsOnHeap(const volatile UInt_t&, volatile UInt_t&)’ with attribute ‘noinline’ follows inline declaration [-Wattributes]
131 | R__NEVER_INLINE void TStorage::UpdateIsOnHeap(volatile const UInt_t &uniqueID, volatile UInt_t &bits) {
| ^~~~~~~~
/home/olin/packages/root_src/core/base/inc/TStorage.h:91:20: note: previous declaration of ‘static void TStorage::UpdateIsOnHeap(const volatile UInt_t&, volatile UInt_t&)’ here
91 | static void UpdateIsOnHeap(volatile const UInt_t &uniqueID, volatile UInt_t &bits);
| ^~~~~~~~~~~~~~
make[2]: *** [tmva/tmva/CMakeFiles/TMVA.dir/build.make:2428: tmva/tmva/CMakeFiles/TMVA.dir/src/DNN/Architectures/Cuda/CudaTensor.cu.o] Error 1
/home/olin/packages/root_src/core/base/inc/TStorage.h:131:37: warning: declaration of ‘static void TStorage::UpdateIsOnHeap(const volatile UInt_t&, volatile UInt_t&)’ with attribute ‘noinline’ follows inline declaration [-Wattributes]
131 | R__NEVER_INLINE void TStorage::UpdateIsOnHeap(volatile const UInt_t &uniqueID, volatile UInt_t &bits) {
| ^~~~~~~~
/home/olin/packages/root_src/core/base/inc/TStorage.h:91:20: note: previous declaration of ‘static void TStorage::UpdateIsOnHeap(const volatile UInt_t&, volatile UInt_t&)’ here
91 | static void UpdateIsOnHeap(volatile const UInt_t &uniqueID, volatile UInt_t &bits);
| ^~~~~~~~~~~~~~
/usr/include/c++/11/bits/std_function.h:435:145: error: parameter packs not expanded with ‘…’:
435 | function(_Functor&& __f)
| ^
/usr/include/c++/11/bits/std_function.h:435:145: note: ‘_ArgTypes’
/usr/include/c++/11/bits/std_function.h:530:146: error: parameter packs not expanded with ‘…’:
530 | operator=(_Functor&& __f)
| ^
/usr/include/c++/11/bits/std_function.h:530:146: note: ‘_ArgTypes’
make[2]: *** [tmva/tmva/CMakeFiles/TMVA.dir/build.make:2386: tmva/tmva/CMakeFiles/TMVA.dir/src/DNN/Architectures/Cuda.cu.o] Error 1
BlockQuote

Thanks! I have invited @moneta over to have a look.

Hi,
I am using Cuda 11.4 and I have no problem building ROOT. I can try to upgrade and check with the new version

Cheers

Lorenzo

I am not getting any error, even when using the latest cuda on both ROOT master and 6.24
Maybe something is not correct with your configuration.
It seems to me you are using c+±14 but the error comes from C++11 headers. Maybe this is the issue.
I would try first making a fresh new clean build

Best

Lorenzo

Thanks Lorenzo. This is good news that it is just my installation. I have successfully built 6.24 without cuda and with c++14.
In the configuration step
cmake -DCMAKE_CUDA_COMPILER="/usr/local/cuda-11/bin/nvcc" -DCMAKE_CUDA_STANDARD=“14” -DCMAKE_CXX_STANDARD=“14” -DCMAKE_INSTALL_PREFIX="/home/olin/packages/rootv6.24_install" -Dcuda=“ON” -Dcudnn=“OFF” -Dgvis=“ON” -Dminuit2=“ON” -Dtmva-cpu=“ON” -Dtmva-gpu=“ON” -Dvmc=“ON” /home/olin/packages/root_src

I see a message
– Cling version (from VERSION file): ROOT_0.9~dev
– Cling will look for C++ headers in ‘/usr/lib/gcc/x86_64-redhat-linux/11/…/…/…/…/include/c++/11:/usr/lib/gcc/x86_64-redhat-linux/11/…/…/…/…/include/c++/11/x86_64-redhat-linux:/usr/lib/gcc/x86_64-redhat-linux/11/…/…/…/…/include/c++/11/backward’ at runtime.
– And then fallback to: ‘c++’

My gcc installation seems to have only C++11 headers
ls /usr/lib/gcc/x86_64-redhat-linux/
11

I will try a clean build with the 11 standard, though I think I started there. What standard did you build with?
PS I still get the warning
*CMake Warning (dev) in tmva/tmva/CMakeLists.txt:
Policy CMP0104 is not set: CMAKE_CUDA_ARCHITECTURES now detected for NVCC,
empty CUDA_ARCHITECTURES not allowed. Run “cmake --help-policy CMP0104”
for policy details. Use the cmake_policy command to set the policy and
suppress this warning.

CUDA_ARCHITECTURES is empty for target “TMVA”.
This warning is for project developers. Use -Wno-dev to suppress it.*

My build Cuda11.5 is successful using
cmake -DCMAKE_CUDA_COMPILER="/usr/local/cuda-11.5/bin/nvcc" -DCMAKE_CUDA_STANDARD=“11” -DCMAKE_CXX_STANDARD=“17” -DCMAKE_INSTALL_PREFIX="/home/olin/packages/rootv6.24_install" -Dcuda=“ON” -Dcudnn=“OFF” -Dgvis=“ON” -Dminuit2=“ON” -Dtmva-cpu=“ON” -Dtmva-gpu=“ON” -Dvmc=“ON” /home/olin/packages/root_src

Oddly cmake --build . – install -j6 tries to install to /usr/local. I had to manually edit the cmake_install.cmake files in the build and build/core paths to change it to my path. Setting the environment export CMAKE_INSTALL_PREFIX=/home/olin/packages/rootv6.24_install did not work, though the code seems to support that.

Thanks for everyone’s guidance.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.