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

Compilation issues #45

Closed
adw62 opened this issue Feb 20, 2022 · 4 comments
Closed

Compilation issues #45

adw62 opened this issue Feb 20, 2022 · 4 comments

Comments

@adw62
Copy link

adw62 commented Feb 20, 2022

Hello,

I'm having trouble compiling this project on my system. I'm using Ubuntu 20.04, RTX 2070 super, CUDA 11.6/ Driver Version: 510.47, cmake 3.23.0-rc1 and gcc 9.3.0.

The errors I get are when running:
tiny-cuda-nn$ cmake --build build --config RelWithDebInfo -j 16
and I see:

[  5%] Building CUDA object src/CMakeFiles/tiny-cuda-nn.dir/common_device.cu.o
[ 15%] Building CUDA object src/CMakeFiles/tiny-cuda-nn.dir/common.cu.o
[ 15%] Building CUDA object src/CMakeFiles/tiny-cuda-nn.dir/cpp_api.cu.o
[ 21%] Building CUDA object src/CMakeFiles/tiny-cuda-nn.dir/cutlass_mlp.cu.o
[ 26%] Building CUDA object src/CMakeFiles/tiny-cuda-nn.dir/encoding.cu.o
[ 31%] Building CUDA object src/CMakeFiles/tiny-cuda-nn.dir/cutlass_resnet.cu.o
[ 36%] Building CUDA object src/CMakeFiles/tiny-cuda-nn.dir/loss.cu.o
[ 42%] Building CUDA object src/CMakeFiles/tiny-cuda-nn.dir/network.cu.o
[ 47%] Building CUDA object src/CMakeFiles/tiny-cuda-nn.dir/object.cu.o
[ 52%] Building CUDA object src/CMakeFiles/tiny-cuda-nn.dir/optimizer.cu.o
[ 57%] Building CUDA object src/CMakeFiles/tiny-cuda-nn.dir/reduce_sum.cu.o
[ 63%] Building CUDA object src/CMakeFiles/tiny-cuda-nn.dir/fully_fused_mlp.cu.o
/home/a/Downloads/tiny-cuda-nn-1.4/src/fully_fused_mlp.cu(416): error: explicit type is missing ("int" assumed)

/home/a/Downloads/tiny-cuda-nn-1.4/src/fully_fused_mlp.cu(416): error: expected a ")"

/home/a/Downloads/tiny-cuda-nn-1.4/src/fully_fused_mlp.cu(496): error: explicit type is missing ("int" assumed)

/home/a/Downloads/tiny-cuda-nn-1.4/src/fully_fused_mlp.cu(496): error: expected a ")"

etc ... I have attached the full output for reference err.txt

Ultimately I would like to use tiny-cuda-nn with https://github.com/NVlabs/instant-ngp but I see the same problems with tiny-cuda-nn when compiling that also. Any help with this would be appreciated.

Cheers,
Alex

@OctoberKat
Copy link

OctoberKat commented Feb 21, 2022

I have met these errors too. It is caused by the namespace nvcuda not imported successfully. Refer to this website: https://stackoverflow.com/questions/53634287/cuda-fails-to-recognize-nvcuda-namespace-during-compilation
Specifying the correct architecture makes the error disappear:
nvcc -arch=sm_70 blablabla.cu
Just append the following code in 130 line of CMakeLists.txt solved my issue:
list(APPEND CUDA_NVCC_FLAGS "-arch=sm_70")

@adw62
Copy link
Author

adw62 commented Feb 21, 2022

Great find, this fix also works for me.

@Holmes-Alan
Copy link

I have met these errors too. It is caused by the namespace nvcuda not imported successfully. Refer to this website: https://stackoverflow.com/questions/53634287/cuda-fails-to-recognize-nvcuda-namespace-during-compilation Specifying the correct architecture makes the error disappear: nvcc -arch=sm_70 blablabla.cu Just append the following code in 130 line of CMakeLists.txt solved my issue: list(APPEND CUDA_NVCC_FLAGS "-arch=sm_70")

which CMakeLists.txt should I modify? The one under the the major folder "tiny-cuda-nn" or somewhere under "tiny-cuda-nn/src"? I tried to add this: list(APPEND CUDA_NVCC_FLAGS "-arch=sm_70") but it does not work.

@adw62
Copy link
Author

adw62 commented Mar 31, 2022

The main CMake if I remember. It has since been updated I put the APPEND line here

list(APPEND CUDA_NVCC_FLAGS "--extended-lambda")
which is now here
list(APPEND CUDA_NVCC_FLAGS "--extended-lambda")
Maybe moving it to line 137 would work?

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

3 participants