NVIDIA / NVIDIA/nvbench

Project assumes CXX compiler and and CUDACXXHOST compiler are the same

Open
#126 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Cuda
Stars
927
Forks
123
Avg merge
2d 10h
Merged PRs (30d)
2

Description

When using this project as a with CUDAHOSTCXX=g++-11 and CXX=clang++-17 as dependency, I'm getting the following compilation error.

FAILED: _deps/nvbench-build/nvbench/CMakeFiles/nvbench.dir/blocking_kernel.cu.o 
ccache /usr/local/cuda/bin/nvcc -forward-unknown-to-host-compiler -ccbin=/usr/lib/ccache/g++ -Dnvbench_EXPORTS -I/home/stephan/projects/proviz-app-samples/debug/_deps/nvbench-src -I/home/stephan/projects/proviz-app-samples/debug/_deps/nvbench-build -I/home/stephan/projects/proviz-app-samples/debug/_deps/fmt-src/include -I/home/stephan/projects/proviz-app-samples/debug/_deps/nvbench-build/nvbench/detail -isystem=/usr/local/cuda/include -isystem=/home/stephan/projects/proviz-app-samples/debug/_deps/nlohmann_json-src/include -Wno-deprecated-gpu-targets -allow-unsupported-compiler -arch=native -lineinfo -g -Xcompiler=-fPIC -Wall -Wextra -Wpedantic -Xcompiler=-Wall -Xcompiler=-Wextra -Xcompiler=-Wconversion -Xcompiler=-Woverloaded-virtual -Xcompiler=-Wcast-qual -Xcompiler=-Wpointer-arith -Xcompiler=-Wunused-local-typedef -Xcompiler=-Wunused-parameter -Xcompiler=-Wvla -Xcompiler=-Wgnu -Xcudafe=--display_error_number -Wno-deprecated-gpu-targets -std=c++17 -MD -MT _deps/nvbench-build/nvbench/CMakeFiles/nvbench.dir/blocking_kernel.cu.o -MF _deps/nvbench-build/nvbench/CMakeFiles/nvbench.dir/blocking_kernel.cu.o.d -x cu -c /home/stephan/projects/proviz-app-samples/debug/_deps/nvbench-src/nvbench/blocking_kernel.cu -o _deps/nvbench-build/nvbench/CMakeFiles/nvbench.dir/blocking_kernel.cu.o
g++: error: unrecognized command-line option ‘-Wunused-local-typedef’; did you mean ‘-Wunused-local-typedefs’?
g++: error: unrecognized command-line option ‘-Wgnu’

This seems to be the case because it is implicitly assumed here

https://github.com/NVIDIA/nvbench/blob/e477bb386289a11ad8d7e358cff6527cfc593974/cmake/NVBenchConfigTarget.cmake#L28-L34

that the CUDA host compiler will accept any flags that the CXX compiler accepts.

I'm also not sure whether the second ${} for the if is necessary as if will implicitly resolve the variable https://github.com/NVIDIA/nvbench/blob/e477bb386289a11ad8d7e358cff6527cfc593974/cmake/NVBenchConfigTarget.cmake#L28

This project also fails to build with NVBench_TOPLEVEL_PROJECT (and thus NVBench_ENABLE_WERROR because it causes a lot of clang warnings. Since I'm using nvbench as a dependency WERROR doesn't cause problems for me.

A simplified solution to this problem could be to disable the CUDA host compiler warnings if CUDA host C++ compiler and C++ compiler are not the same.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in cmake/NVBenchConfigTarget.cmake at lines 28-34 and reproduce the issue with CUDAHOSTCXX=g++-11 and CXX=clang++-17. Check how C++ warning flags are passed to the CUDA host compiler; done means the dependency builds without unsupported host-compiler flags when the compilers differ.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.