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

Melodic build gets cuda error about only supports gcc < 6 #2

Open
Levi-Armstrong opened this issue Jul 29, 2019 · 3 comments
Open

Melodic build gets cuda error about only supports gcc < 6 #2

Levi-Armstrong opened this issue Jul 29, 2019 · 3 comments
Labels
bug Something isn't working

Comments

@Levi-Armstrong
Copy link
Contributor

Add cuda options OPTIONS --compiler-bindir /usr/bin/gcc-6 below to get it no build without changing your host gcc version.

cuda_add_library(${PROJECT_NAME}
  src/kfusion/core.cpp
  src/kfusion/device_memory.cpp
  src/kfusion/imgproc.cpp
  src/kfusion/kinfu.cpp
  src/kfusion/precomp.cpp
  src/kfusion/projective_icp.cpp
  src/kfusion/tsdf_volume.cpp
  src/cuda/imgproc.cu
  src/cuda/proj_icp.cu
  src/cuda/tsdf_volume.cu
  OPTIONS --compiler-bindir /usr/bin/gcc-6
)
@schornakj
Copy link
Contributor

It's worth noting that the supported version of GCC is a function of both the OS distribution and the CUDA version. There's a table in the CUDA installation guide (here for the latest, here for 9.2, here for 8.0) that says what version is supported in different situations. In other words, not necessarily something you'd want to have hard-coded.

I think the most common situation where this crops up is when building to support an older GPU with a newer OS (e.g. using hardware that only supports up to CUDA 9.1 on Ubuntu 18.04).

@mpowelson
Copy link
Contributor

So what is the long term fix for this? Should we add a series of checks that set the correct option based on CUDA_VERSION_MAJOR?

@schornakj
Copy link
Contributor

In any case the user has to have the correct version of GCC installed, so I don't think it can be handled totally automatically.

The nature of this problem may have changed a bit with the improved CUDA support in CMake 3.10 and newer, though we'll need to test on the appropriate combination of drivers and hardware. Pointing to a specific GCC version can now be done via set_target_properties:

add_library(${PROJECT_NAME} SHARED  # the core yak library
  src/kfusion/core.cpp
  src/kfusion/device_memory.cpp
  src/kfusion/imgproc.cpp
  src/kfusion/kinfu.cpp
  src/kfusion/precomp.cpp
  src/kfusion/projective_icp.cpp
  src/kfusion/tsdf_volume.cpp
  src/cuda/imgproc.cu
  src/cuda/proj_icp.cu
  src/cuda/tsdf_volume.cu)
set_target_properties(${PROJECT_NAME} PROPERTIES CMAKE_CUDA_HOST_COMPILER /usr/bin/gcc-6)

@schornakj schornakj added the bug Something isn't working label Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants