openvdb icon indicating copy to clipboard operation
openvdb copied to clipboard

nanovdb fails to build if cuda version is 10.1 or earlier

Open udnaan opened this issue 4 years ago • 6 comments

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.

udnaan avatar Sep 12 '20 22:09 udnaan

Thanks Adnan - especially for the detailed document of the issue and proposed solution - I’ll look into this ASAP!

Cheers, Ken

On Sep 12, 2020, at 3:54 PM, Adnan [email protected] wrote:

 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 -use_fast_math -lineinfo")
  	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.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

kmuseth avatar Sep 13 '20 00:09 kmuseth

My pleasure and thank you for the nanovdb initiative! This would help me eliminate a lot of boilerplate code.

udnaan avatar Sep 13 '20 02:09 udnaan

I’ll push a fix up tomorrow, but note that it will also include other changes (and improvements). This includes changes to the memory layout which implies that the major version number is bumped (21->22) and consequently .nvdb files will have to be generated again.

Cheers, Ken

On Sep 12, 2020, at 7:51 PM, Adnan [email protected] wrote:

 My pleasure and thank you for the nanovdb initiative! This would help me eliminate a lot of boilerplate code.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

OpenVDB-DevTeam avatar Sep 13 '20 03:09 OpenVDB-DevTeam

Awesome. Thanks for the quick fix! Also, I'm not that far into the integration to worry about file compatibility yet.

Best regards,

udnaan avatar Sep 13 '20 03:09 udnaan

Hi Adnan,

This is being delayed because I’ve literally had to evacuate my house do to the Bobcat wildfire! Assuming my house doesn’t burn down I expect to be working normally again end of this week

On Sep 12, 2020, at 8:29 PM, Adnan [email protected] wrote:

 Awesome. Thanks for the quick fix! Also, I'm not that far into the integration to worry about file compatibility yet.

Best regards,

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

kmuseth avatar Sep 15 '20 06:09 kmuseth

Of course. Stay safe. This can wait.

udnaan avatar Sep 15 '20 09:09 udnaan