AcademySoftwareFoundation / AcademySoftwareFoundation/openvdb

nanovdb fails to build if cuda version is 10.1 or earlier

Open
#824 6 comments 0 reactions 0 assignees View on GitHub
nanovdb
Dominant language
C++
Stars
3.4k
Forks
774
Avg merge
3d 9h
Merged PRs (30d)
34

Description

## What
nanovdb fails to build if cuda version is 10.1 or less.

## Where
Debian Linux 10.5, Cuda 10.1

## Why
The cmake test uses an experimental param for nvcc --extended-lambda which gives an error on nvcc 10.1 or earlier

## Fix
The parameter exists in nvcc 10 and 10.1 but is prefixed by --expt-. Adding a check to cmake fixes the build.

```
set (CUDA_EXTENDED_LAMBDA "--extended-lambda")
if (CUDA_VERSION_MAJOR EQUAL 10)
if (CUDA_VERSION_MINOR LESS_EQUAL 1)
set ( CUDA_EXTENDED_LAMBDA "--expt-extended-lambda")
endif()
endif()
set ( CMAKE_CUDA_FLAGS "${CUDA_EXTENDED_LAMBDA} -use_fast_math -lineinfo")
```

## Other
I'm not sure about 9 or earlier as I don't have an installation to test.

Contributor guide

Open the contributing guide

Research direction

Start by locating the CMake configuration that sets CMAKE_CUDA_FLAGS and the CUDA_EXTENDED_LAMBDA option. Reproduce or inspect the build with CUDA 10.1, then verify that the appropriate nvcc flag is selected and that the project builds successfully; consider the issue's uncertainty about CUDA 9 or earlier.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.