Hi,
After updating the Ubuntu distribution (from 20.04 to 21.10), compiling the examples throws errors …
…
cd /usr/local/cuda/samples
make
make[1]: Entering directory ‘/usr/local/cuda-11.5/samples/0_Simple/vectorAdd_nvrtc’
GCC Version is greater or equal to 5.1.0 <<<
make[1]: Nothing to be done for ‘all’.
make[1]: Leaving directory ‘/usr/local/cuda-11.5/samples/0_Simple/vectorAdd_nvrtc’
make[1]: Entering directory ‘/usr/local/cuda-11.5/samples/0_Simple/template’
/usr/local/cuda-11.5/bin/nvcc -ccbin g++ -I…/…/common/inc -m64 --threads 0 --std=c++11 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75 -gencode arch=compute_80,code=sm_80 -gencode arch=compute_86,code=sm_86 -gencode arch=compute_86,code=compute_86 -o template.o -c template.cu
nvcc warning : The ‘compute_35’, ‘compute_37’, ‘compute_50’, ‘sm_35’, ‘sm_37’ and ‘sm_50’ architectures are deprecated, and may be removed in a future release (Use -Wno-deprecated-gpu-targets to suppress warning).
/usr/include/stdio.h(183): error: attribute “malloc” does not take arguments
/usr/include/stdio.h(195): error: attribute “malloc” does not take arguments
/usr/include/stdio.h(217): error: attribute “malloc” does not take arguments
/usr/include/stdio.h(254): error: attribute “malloc” does not take arguments
/usr/include/stdio.h(279): error: attribute “malloc” does not take arguments
/usr/include/stdio.h(288): error: attribute “malloc” does not take arguments
/usr/include/stdio.h(297): error: attribute “malloc” does not take arguments
/usr/include/stdio.h(303): error: attribute “malloc” does not take arguments
/usr/include/stdio.h(309): error: attribute “malloc” does not take arguments
/usr/include/stdio.h(824): error: attribute “malloc” does not take arguments
/usr/include/stdlib.h(565): error: attribute “malloc” does not take arguments
/usr/include/stdlib.h(569): error: attribute “malloc” does not take arguments
/usr/include/stdlib.h(797): error: attribute “malloc” does not take arguments
/usr/include/wchar.h(155): error: attribute “malloc” does not take arguments
/usr/include/wchar.h(582): error: attribute “malloc” does not take arguments
15 errors detected in the compilation of “template.cu”.
make[1]: *** [Makefile:322: template.o] Error 255
make[1]: Leaving directory ‘/usr/local/cuda-11.5/samples/0_Simple/template’
make: *** [Makefile:51: 0_Simple/template/Makefile.ph_build] Error 2
I would like to compile GPUStressTest and I get the same:
Cloning into ‘GPUStressTest’…
remote: Enumerating objects: 207, done.
remote: Counting objects: 100% (207/207), done.
remote: Compressing objects: 100% (84/84), done.
remote: Total 207 (delta 126), reused 192 (delta 116), pack-reused 0
Receiving objects: 100% (207/207), 62.95 KiB | 153.00 KiB/s, done.
Resolving deltas: 100% (126/126), done.
– The CXX compiler identification is GNU 11.2.0
– The CUDA compiler identification is unknown
– The C compiler identification is GNU 11.2.0
– Detecting CXX compiler ABI info
– Detecting CXX compiler ABI info - done
– Check for working CXX compiler: /usr/bin/c++ - skipped
– Detecting CXX compile features
– Detecting CXX compile features - done
– Detecting CUDA compiler ABI info
– Detecting CUDA compiler ABI info - failed
– Check for working CUDA compiler: /etc/alternatives/cuda/bin/nvcc
– Check for working CUDA compiler: /etc/alternatives/cuda/bin/nvcc - broken
CMake Error at /usr/share/cmake-3.18/Modules/CMakeTestCUDACompiler.cmake:52 (message):
The CUDA compiler
"/etc/alternatives/cuda/bin/nvcc"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /root/spec.env/src/GPUStressTest/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/gmake cmTC_28ce6/fast && /usr/bin/gmake -f CMakeFiles/cmTC_28ce6.dir/build.make CMakeFiles/cmTC_28ce6.dir/build
gmake[1]: Entering directory '/root/spec.env/src/GPUStressTest/CMakeFiles/CMakeTmp'
Building CUDA object CMakeFiles/cmTC_28ce6.dir/main.cu.o
/etc/alternatives/cuda/bin/nvcc -c /root/spec.env/src/GPUStressTest/CMakeFiles/CMakeTmp/main.cu -o CMakeFiles/cmTC_28ce6.dir/main.cu.o
/usr/include/stdio.h(183): error: attribute "__malloc__" does not take arguments
/usr/include/stdio.h(195): error: attribute "__malloc__" does not take arguments
/usr/include/stdio.h(217): error: attribute "__malloc__" does not take arguments
/usr/include/stdio.h(254): error: attribute "__malloc__" does not take arguments
/usr/include/stdio.h(279): error: attribute "__malloc__" does not take arguments
/usr/include/stdio.h(288): error: attribute "__malloc__" does not take arguments
/usr/include/stdio.h(297): error: attribute "__malloc__" does not take arguments
/usr/include/stdio.h(303): error: attribute "__malloc__" does not take arguments
/usr/include/stdio.h(309): error: attribute "__malloc__" does not take arguments
/usr/include/stdio.h(824): error: attribute "__malloc__" does not take arguments
/usr/include/stdlib.h(565): error: attribute "__malloc__" does not take arguments
/usr/include/stdlib.h(569): error: attribute "__malloc__" does not take arguments
/usr/include/stdlib.h(797): error: attribute "__malloc__" does not take arguments
13 errors detected in the compilation of "/root/spec.env/src/GPUStressTest/CMakeFiles/CMakeTmp/main.cu".
gmake[1]: *** [CMakeFiles/cmTC_28ce6.dir/build.make:85: CMakeFiles/cmTC_28ce6.dir/main.cu.o] Error 1
gmake[1]: Leaving directory '/root/spec.env/src/GPUStressTest/CMakeFiles/CMakeTmp'
gmake: *** [Makefile:140: cmTC_28ce6/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:8 (project)
– Configuring incomplete, errors occurred!
See also “/root/spec.env/src/GPUStressTest/CMakeFiles/CMakeOutput.log”.
See also “/root/spec.env/src/GPUStressTest/CMakeFiles/CMakeError.log”.
make: *** No targets specified and no makefile found. Stop.
What is problematic is that the download of the Toolkit 11.5 does not offer Ubuntu version 21.10 (max 20.04 → https://developer.nvidia.com/cuda-downloads?target_os=Linux&target_arch=x86_64&Distribution=Ubuntu&target_version=20.04&target_type=deb_local)
Is this the real problem ?
Matéo