Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NVHPC compiler failure when building #247

Closed
R0n12 opened this issue Dec 16, 2024 · 3 comments
Closed

NVHPC compiler failure when building #247

R0n12 opened this issue Dec 16, 2024 · 3 comments

Comments

@R0n12
Copy link

R0n12 commented Dec 16, 2024

Currently we are testing the installation on TACC Vista. However, the NVHPC compiler doesn't seem to work well with compilation.

using CC=nvc will have the following errors:

-- The C compiler identification is NVHPC 24.7.0
-- The CXX compiler identification is NVHPC 24.7.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /home1/apps/nvidia/Linux_aarch64/24.7/compilers/bin/nvc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home1/apps/nvidia/Linux_aarch64/24.7/compilers/bin/nvc++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Compiling with C standard: 99
-- Compiling with C++ standard: 98
-- Found OpenMP_C: -mp (found version "5.1")
-- Found OpenMP: TRUE (found version "5.1") found components: C
CMake Warning (dev) at CMakeLists.txt:222 (find_package):
  Policy CMP0146 is not set: The FindCUDA module is removed.  Run "cmake
  --help-policy CMP0146" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found CUDA: /home1/apps/nvidia/Linux_aarch64/24.7/cuda/12.5 (found version "12.5")
-- Performing Test HAVE_MATH
-- Performing Test HAVE_MATH - Success
-- Configuring done (2.5s)
-- Generating done (0.1s)
CMake Warning:
  Manually-specified variables were not used by the project:

    INSTALL_GTEST


-- Build files have been written to: /work/07936/tg872351/vista/project/zfp-opt/zfp_compression/build
[  2%] Building NVCC (Device) object src/CMakeFiles/zfp.dir/cuda/zfp_generated_interface.cu.o
nvcc fatal   : Unsupported NVHPC compiler found. nvc++ is the only NVHPC compiler that is supported.
CMake Error at zfp_generated_interface.cu.o.Release.cmake:220 (message):
  Error generating
  /work/07936/tg872351/vista/project/zfp-opt/zfp_compression/build/src/CMakeFiles/zfp.dir/cuda/./zfp_generated_interface.cu.o


make[2]: *** [src/CMakeFiles/zfp.dir/build.make:77: src/CMakeFiles/zfp.dir/cuda/zfp_generated_interface.cu.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:114: src/CMakeFiles/zfp.dir/all] Error 2

using CC=nvcc will have the following errors:

-- The C compiler identification is GNU 11.4.1
-- The CXX compiler identification is NVHPC 24.7.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /home1/apps/nvidia/Linux_aarch64/24.7/compilers/bin/nvcc
-- Check for working C compiler: /home1/apps/nvidia/Linux_aarch64/24.7/compilers/bin/nvcc - works
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /home1/apps/nvidia/Linux_aarch64/24.7/compilers/bin/nvc++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Compiling with C standard: 99
-- Compiling with C++ standard: 98
-- Could NOT find OpenMP_C (missing: OpenMP_C_FLAGS OpenMP_C_LIB_NAMES)
-- Could NOT find OpenMP (missing: OpenMP_C_FOUND C)
CMake Warning (dev) at CMakeLists.txt:222 (find_package):
  Policy CMP0146 is not set: The FindCUDA module is removed.  Run "cmake
  --help-policy CMP0146" for policy details.  Use the cmake_policy command to
  set the policy and suppress this warning.

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
-- Check if compiler accepts -pthread
-- Check if compiler accepts -pthread - no
CMake Error at /home1/apps/cmake/3.29.5/share/cmake-3.29/Modules/FindPackageHandleStandardArgs.cmake:230 (message):
  Could NOT find Threads (missing: Threads_FOUND)
Call Stack (most recent call first):
  /home1/apps/cmake/3.29.5/share/cmake-3.29/Modules/FindPackageHandleStandardArgs.cmake:600 (_FPHSA_FAILURE_MESSAGE)
  /home1/apps/cmake/3.29.5/share/cmake-3.29/Modules/FindThreads.cmake:226 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  /home1/apps/cmake/3.29.5/share/cmake-3.29/Modules/FindCUDA.cmake:1071 (find_package)
  CMakeLists.txt:222 (find_package)

I noticed the ABI info failure for nvcc

@lindstro
Copy link
Member

The CMake find_package issue has to do with the deprecation of FindCUDA in CMake as of version 3.27 (see #232). Any chance you can use an earlier version of CMake? I have partially updated the staging branch to use FindCUDAToolkit, which hopefully will address this. I will push these changes in the next few days but would like to do more testing first.

Any other issues with NVHPC may or may not be related to #112, #163, though as best I can tell this is purely a CMake issue. Or perhaps try CC=nvc++ per the error message nvc++ is the only NVHPC compiler that is supported. Sorry, I have no experience with NVHPC.

@R0n12
Copy link
Author

R0n12 commented Jan 7, 2025

The issue can be solved by adding following flags:

export NVCC_APPEND_FLAGS="-ccbin=/home1/apps/nvidia/Linux_aarch64/24.7/compilers/bin/nvc++ -arch=sm_90a -allow-unsupported-compiler"

ref:

https://forums.developer.nvidia.com/t/nvcc-fatal-unsupported-nvhpc-compiler-found-nvc-is-the-only-nvhpc-compiler-that-is-supported/291416/2?u=xulang7

NVIDIA/cuda-samples#179 (comment)

@lindstro
Copy link
Member

lindstro commented Jan 8, 2025

@R0n12 Glad to hear you found a workaround. Since this appears to be a problem with NVHPC rather than zfp, I'm closing the issue.

@lindstro lindstro closed this as completed Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants