szellmann / visionaray

A C++-based, cross platform ray tracing library
https://vis.uni-koeln.de/visionaray.html
MIT License
432 stars 37 forks source link

Building NVCC Error #22

Closed Hao-HUST closed 6 years ago

Hao-HUST commented 6 years ago

Hi,

Thanks for your amazing work.

But, when I compile visionaray on the stage of Building NVCC, the errors occurred:


[ 84%] Linking CXX static library libvisionaray_common.a [ 84%] Built target visionaray_common [ 86%] Building NVCC (Device) object src/viewer/CMakeFiles/cuda_compile_4.dir/cuda_compile_4_generated_viewer.cu.o /root/Project/Massive_Point_Cloud_Rendering/visionaray/include/visionaray/math/aabb.h(28): warning: device annotation on a defaulted function("basic_aabb") is ignored

/root/Project/Massive_Point_Cloud_Rendering/visionaray/include/visionaray/math/aabb.h(28): warning: host annotation on a defaulted function("basic_aabb") is ignored

/root/Project/Massive_Point_Cloud_Rendering/visionaray/include/visionaray/math/ray.h(28): warning: device annotation on a defaulted function("basic_ray") is ignored

/root/Project/Massive_Point_Cloud_Rendering/visionaray/include/visionaray/math/ray.h(28): warning: host annotation on a defaulted function("basic_ray") is ignored

Segmentation fault CMake Error at cuda_compile_4_generated_viewer.cu.o.Release.cmake:282 (message): Error generating file /root/Project/Massive_Point_Cloud_Rendering/visionaray/build/src/viewer/CMakeFiles/cuda_compile_4.dir//./cuda_compile_4_generated_viewer.cu.o

_src/viewer/CMakeFiles/viewer.dir/build.make:84: recipe for target 'src/viewer/CMakeFiles/cuda_compile_4.dir/cuda_compile_4_generated_viewer.cu.o' failed make[2]: [src/viewer/CMakeFiles/cuda_compile_4.dir/cuda_compile_4_generated_viewer.cu.o] Error 1 CMakeFiles/Makefile2:1061: recipe for target 'src/viewer/CMakeFiles/viewer.dir/all' failed make[1]: [src/viewer/CMakeFiles/viewer.dir/all] Error 2 Makefile:140: recipe for target 'all' failed make: *** [all] Error 2_

Is there any idea about that? Thanks, Hao

szellmann commented 6 years ago

Hi Hao,

thanks for reporting! This looks like an nvcc ICE. I just checked, on my dev machine (Ubuntu 16.04, nvcc V9.2), the CUDA build runs through smoothly. Could you provide me with some more information so I can better reproduce the issue? The output of the following commands would be helpful, as well as the commit of visionaray you're on:

cat /etc/issue nvcc --version c++ --version (or else the version of your "host compiler", if different from the one linked to by /usr/bin/c++)

Best, Stefan

Hao-HUST commented 6 years ago

Hi,

Thanks for your replying.

Let me list the additional information as follow:

cat /etc/issue:: Ubuntu 16.04.4 LTS \n \l nvcc --version: Cuda compilation tools, release 9.0, V9.0.176 c++ --version: c++ (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609

Thanks again Hao

szellmann commented 6 years ago

I just installed cuda 9.0 and can confirm the issue. I will try and pinpoint the source of the error. If I find a concise solution / workaround for the problem, I will let you know. The best solution IMO would however be to just upgrade to the most recent version of nvcc, since this is definitely a compiler issue and they seem to have fixed it in the meantime (at least it's fixed in 9.2.88, not a hundred percent sure if this is the most recent version).

Best, Stefan

Hao-HUST commented 6 years ago

Hi, szellmann.

Thanks for all your efforts.

I will upgrade the version of NVCC, and if it works, I will let you know.

Best

szellmann commented 6 years ago

I committed a workaround for this via https://github.com/szellmann/visionaray/commit/2dfd0f889e0866c662c91c8903875618aac11e4c. This somehow happens when the types stored in the variant have an alignment other than the default (like e.g. my vec3 and vec4 type). I now switched the position of index and storage in the variant, so that the variant doesn't inherit the stored type's alignment anymore. This should be ok because there are no strict alignment requirements regarding the variant itself, and it makes nvcc 9.0 happy. They seem to have fixed this in newer CUDA versions.

Could you please confirm that this works for you and close the issue (or otherwise, if you're already in the process of upgrading to v9.2 and can't go back to v9.0, just close the issue)?

Best Stefan

Hao-HUST commented 6 years ago

Hi, szellmann.

Thanks a lot.

I upgrade the CUDA from 9.0 to 9.2 and the make succeed.

Thanks again.