NVIDIA / gvdb-voxels

Sparse volume compute and rendering on NVIDIA GPUs
Other
672 stars 144 forks source link

cuda 10.2 build error #106

Closed AndreV84 closed 3 years ago

AndreV84 commented 3 years ago

steps to reproduce the issue at Jetson

 git clone https://github.com/NVIDIA/gvdb-voxels
 cd gvdb-voxels
mkdir build
cd build
 cmake -DCMAKE_CUDA_COMPILER=/usr/local/cuda-10.2/bin/nvcc -DCMAKE_CUDA_ARCHITECTURES=72 ..
make -j8

output:

/gvdb-voxels/source/gvdb_library/src/gvdb_vec.h:550:13: error: extra qualification ‘nvdb::Matrix4F::’ on member ‘InvScaleInPlace’ [-fpermissive]
   Matrix4F& Matrix4F::InvScaleInPlace(const Vector3DF& scale);
             ^~~~~~~~
gvdb_library/CMakeFiles/gvdb.dir/build.make:107: recipe for target 'gvdb_library/CMakeFiles/gvdb.dir/src/gvdb_allocator.cpp.o' failed
make[2]: *** [gvdb_library/CMakeFiles/gvdb.dir/src/gvdb_allocator.cpp.o] Error 1
In file included from /home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_scene.h:31:0,
                 from /home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_render.h:24,
                 from /home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_render_opengl.cpp:22:
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_allocator.h: In member function ‘CUdeviceptr nvdb::Allocator::getAtlasMapGPU(uchar)’:
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_allocator.h:156:98: warning: converting to non-pointer type ‘long long unsigned int’ from NULL [-Wconversion-null]
   CUdeviceptr getAtlasMapGPU(uchar chan) { return (mAtlasMap.size()==0) ? NULL : mAtlasMap[chan].gpu; }
                                                                                                  ^~~
gvdb_library/CMakeFiles/gvdb.dir/build.make:172: recipe for target 'gvdb_library/CMakeFiles/gvdb.dir/src/gvdb_render_opengl.cpp.o' failed
make[2]: *** [gvdb_library/CMakeFiles/gvdb.dir/src/gvdb_render_opengl.cpp.o] Error 1
[ 13%] Built target gvdbPTX
Scanning dependencies of target gRenderKernelPTX
[ 14%] Building CUDA object gRenderKernel/CMakeFiles/gRenderKernelPTX.dir/render_custom.ptx
/home/nvidia/gvdb-voxels/source/gvdb_library/kernels/cuda_gvdb_nodes.cuh(131): warning: integer conversion resulted in truncation

[ 14%] Built target gRenderKernelPTX
CMakeFiles/Makefile2:264: recipe for target 'gvdb_library/CMakeFiles/gvdb.dir/all' failed
make[1]: *** [gvdb_library/CMakeFiles/gvdb.dir/all] Error 2
Makefile:148: recipe for target 'all' failed
make: *** [all] Error 2
NBickford-NV commented 3 years ago

Ah, looks like I made an error when revisiting https://github.com/NVIDIA/gvdb-voxels/blob/master/source/gvdb_library/src/gvdb_vec.h#L538-L550 - the Matrix4F:: qualifiers shouldn't be there! I'll have this fixed shortly, or if you want, you can remove the Matrix4F:: text in that file and try building it again.

AndreV84 commented 3 years ago

hi, thank you for the prompt response. Is it likely that we could vizualize with it from ROS topic / realsense d435 camera? To get pointcloud/ vozels vizualized?

AndreV84 commented 3 years ago

it fails with different errors after removing the argument above:


          ^~~~
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_volume_gvdb.cpp: In member function ‘bool nvdb::VolumeGVDB::LoadBRK(std::__cxx11::string)’:
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_volume_gvdb.cpp:1905:15: error: ‘FLT_MAX’ was not declared in this scope
  float vmin = FLT_MAX, vmax = -FLT_MAX;
               ^~~~~~~
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_volume_gvdb.cpp:1905:15: note: suggested alternative: ‘INT_MAX’
  float vmin = FLT_MAX, vmax = -FLT_MAX;
               ^~~~~~~
               INT_MAX
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_volume_gvdb.cpp: In member function ‘void nvdb::VolumeGVDB::writeCube(FILE*, unsigned char*, slong&, int*, int*&, slong)’:
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_volume_gvdb.cpp:3138:97: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 3 has type ‘slong {aka long int}’ [-Wformat=]
  if ( vpix[1] == 0 ) {fprintf(fp, "f %lld//0 %lld//0 %lld//0 %lld//0\n", v[1], v[2], v[6], v[5] );  numfaces++; } // x+
                                                                          ~~~~                   ^
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_volume_gvdb.cpp:3138:97: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 4 has type ‘slong {aka long int}’ [-Wformat=]
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_volume_gvdb.cpp:3138:97: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 5 has type ‘slong {aka long int}’ [-Wformat=]
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_volume_gvdb.cpp:3138:97: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 6 has type ‘slong {aka long int}’ [-Wformat=]
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_volume_gvdb.cpp:3139:97: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 3 has type ‘slong {aka long int}’ [-Wformat=]
  if ( vpix[2] == 0 ) {fprintf(fp, "f %lld//1 %lld//1 %lld//1 %lld//1\n", v[0], v[3], v[7], v[4] );  numfaces++; } // x-
                                                                          ~~~~                   ^
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_volume_gvdb.cpp:3139:97: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 4 has type ‘slong {aka long int}’ [-Wformat=]
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_volume_gvdb.cpp:3139:97: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 5 has type ‘slong {aka long int}’ [-Wformat=]
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_volume_gvdb.cpp:3139:97: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 6 has type ‘slong {aka long int}’ [-Wformat=]
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_volume_gvdb.cpp:3140:97: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 3 has type ‘slong {aka long int}’ [-Wformat=]
  if ( vpix[3] == 0 ) {fprintf(fp, "f %lld//2 %lld//2 %lld//2 %lld//2\n", v[2], v[3], v[7], v[6] );  numfaces++; } // y+
                                                                          ~~~~                   ^
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_volume_gvdb.cpp:3140:97: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 4 has type ‘slong {aka long int}’ [-Wformat=]
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_volume_gvdb.cpp:3140:97: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 5 has type ‘slong {aka long int}’ [-Wformat=]
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_volume_gvdb.cpp:3140:97: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 6 has type ‘slong {aka long int}’ [-Wformat=]
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_volume_gvdb.cpp:3141:97: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 3 has type ‘slong {aka long int}’ [-Wformat=]
  if ( vpix[4] == 0 ) {fprintf(fp, "f %lld//3 %lld//3 %lld//3 %lld//3\n", v[1], v[0], v[4], v[5] );  numfaces++; } // y-
                                                                          ~~~~                   ^
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_volume_gvdb.cpp:3141:97: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 4 has type ‘slong {aka long int}’ [-Wformat=]
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_volume_gvdb.cpp:3141:97: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 5 has type ‘slong {aka long int}’ [-Wformat=]
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_volume_gvdb.cpp:3141:97: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 6 has type ‘slong {aka long int}’ [-Wformat=]
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_volume_gvdb.cpp:3142:97: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 3 has type ‘slong {aka long int}’ [-Wformat=]
  if ( vpix[5] == 0 ) {fprintf(fp, "f %lld//4 %lld//4 %lld//4 %lld//4\n", v[4], v[5], v[6], v[7] );  numfaces++; } // z+
                                                                          ~~~~                   ^
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_volume_gvdb.cpp:3142:97: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 4 has type ‘slong {aka long int}’ [-Wformat=]
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_volume_gvdb.cpp:3142:97: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 5 has type ‘slong {aka long int}’ [-Wformat=]
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_volume_gvdb.cpp:3142:97: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 6 has type ‘slong {aka long int}’ [-Wformat=]
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_volume_gvdb.cpp:3143:97: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 3 has type ‘slong {aka long int}’ [-Wformat=]
  if ( vpix[6] == 0 ) {fprintf(fp, "f %lld//5 %lld//5 %lld//5 %lld//5\n", v[0], v[1], v[2], v[3] );  numfaces++; } // z-
                                                                          ~~~~                   ^
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_volume_gvdb.cpp:3143:97: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 4 has type ‘slong {aka long int}’ [-Wformat=]
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_volume_gvdb.cpp:3143:97: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 5 has type ‘slong {aka long int}’ [-Wformat=]
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_volume_gvdb.cpp:3143:97: warning: format ‘%lld’ expects argument of type ‘long long int’, but argument 6 has type ‘slong {aka long int}’ [-Wformat=]
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_volume_gvdb.cpp: In member function ‘void nvdb::VolumeGVDB::PrepareRender(int, int, char)’:
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_volume_gvdb.cpp:4317:59: warning: converting to non-pointer type ‘long long unsigned int’ from NULL [-Wconversion-null]
  mScnInfo.dbuf   = (dbuf == 255 ? NULL : mRenderBuf[dbuf].gpu);
                                                           ^~~
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_volume_gvdb.cpp: In member function ‘void nvdb::VolumeGVDB::ScatterDensity(int, float, float, nvdb::Vector3DF, bool, bool)’:
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_volume_gvdb.cpp:5653:33: warning: NULL used in arithmetic [-Wpointer-arith]
     if (mAux[AUX_PNTCLR].gpu != NULL && avgColor) {
                                 ^~~~
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_volume_gvdb.cpp:5665:30: warning: NULL used in arithmetic [-Wpointer-arith]
  if (mAux[AUX_PNTCLR].gpu != NULL && avgColor) {
                              ^~~~
gvdb_library/CMakeFiles/gvdb.dir/build.make:250: recipe for target 'gvdb_library/CMakeFiles/gvdb.dir/src/gvdb_volume_gvdb.cpp.o' failed
make[2]: *** [gvdb_library/CMakeFiles/gvdb.dir/src/gvdb_volume_gvdb.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
CMakeFiles/Makefile2:264: recipe for target 'gvdb_library/CMakeFiles/gvdb.dir/all' failed
make[1]: *** [gvdb_library/CMakeFiles/gvdb.dir/all] Error 2
Makefile:148: recipe for target 'all' failed
make: *** [all] Error 2
NBickford-NV commented 3 years ago

OK, try it now? Looks like <float.h> wasn't quite being included.

I'm also curious where the definition of slong as a long int comes from - slong should be defined as an int64_t in gvdb_types.h, and then int64_t is a long long in stdint.h for me - maybe on Jetson, stdint.h defines an int64_t to be a long, which then causes the printf warning here?

AndreV84 commented 3 years ago

thank you it builds by now can we use it to vizualize anything? pointcloud from realsense cameras? inputs from ROS topics?

NBickford-NV commented 3 years ago

Awesome! It should be able to do that - check out the gPointFusion sample (note: requires OptiX, but the code from the sample can be used as well)! We don't have built-in integration with RGBD cameras, though, unfortunately, so one would need to handle transmitting the points from the camera to GVDB (which, in some sense, is a data structure).

AndreV84 commented 3 years ago

I am tryin gto build it also on nvidia Jetson but it seems running into errors log3.txt

NBickford-NV commented 3 years ago

Oh, yeah, that would be the problem - it looks like OptiX isn't supported on Jetson (ARM) yet! I guess in this case, something like the gSprayDeposit sample would be more appropriate (since that doesn't require OptiX). (Sorry about that! I should also mention that OptiX here is only used for rendering - GVDB itself doesn't require OptiX in order to run.)

AndreV84 commented 3 years ago

so is there a chance to build gvdb on Jetson? I get the OptiX installed on x86_64 that got already the gvbd_voxels instaled; Is there a way to use it with pointcloud files or rosbag files? in order to visualize at either of devices?

AndreV84 commented 3 years ago

so we can not even build the package on Jetson?

NBickford-NV commented 3 years ago

Yes, we support Jetson (e.g. the gJetsonTX sample should be designed specifically for Jetson devices) - OptiX is not supported on Jetson, but not all of the samples use OptiX. For most file formats, you'll probably have to write something to load the points from the file into memory, then call e.g. gvdb.SetPoints (see Sample::load_points in the gPointCloud sample for an example).

AndreV84 commented 3 years ago

so should I remove from the folder all samples but the TX sample? In my case the build fails at Jetosn

AndreV84 commented 3 years ago

%] Building CXX object gResample/CMakeFiles/gResample.dir/main_resample.cpp.o
[ 51%] Building CXX object gSprayDeposit/CMakeFiles/gSprayDeposit.dir/main_spray_deposit.cpp.o
[ 52%] Building CXX object gInteractiveGL/CMakeFiles/gInteractiveGL.dir/main_interactive_gl.cpp.o
[ 53%] Building CXX object gDepthMap/CMakeFiles/gDepthMap.dir/main_depthmap.cpp.o
In file included from /home/nvidia/gvdb-voxels/source/sample_utils/main.h:27:0,
                 from /home/nvidia/gvdb-voxels/source/g3DPrint/main_3dprint.cpp:36:
/home/nvidia/gvdb-voxels/source/sample_utils/platform.h:184:6: error: #error "Unknown platform"
 #    error "Unknown platform"
      ^~~~~
In file included from /home/nvidia/gvdb-voxels/source/sample_utils/main.h:27:0,
                 from /home/nvidia/gvdb-voxels/source/gResample/main_resample.cpp:9:
/home/nvidia/gvdb-voxels/source/sample_utils/platform.h:184:6: error: #error "Unknown platform"
 #    error "Unknown platform"
      ^~~~~
In file included from /home/nvidia/gvdb-voxels/source/sample_utils/main.h:27:0,
                 from /home/nvidia/gvdb-voxels/source/gSprayDeposit/main_spray_deposit.cpp:27:
/home/nvidia/gvdb-voxels/source/sample_utils/platform.h:184:6: error: #error "Unknown platform"
 #    error "Unknown platform"
      ^~~~~
In file included from /home/nvidia/gvdb-voxels/source/sample_utils/main.h:27:0,
                 from /home/nvidia/gvdb-voxels/source/gInteractiveGL/main_interactive_gl.cpp:8:
/home/nvidia/gvdb-voxels/source/sample_utils/platform.h:184:6: error: #error "Unknown platform"
 #    error "Unknown platform"
      ^~~~~
In file included from /home/nvidia/gvdb-voxels/source/sample_utils/main.h:27:0,
                 from /home/nvidia/gvdb-voxels/source/gDepthMap/main_depthmap.cpp:9:
/home/nvidia/gvdb-voxels/source/sample_utils/platform.h:184:6: error: #error "Unknown platform"
 #    error "Unknown platform"
      ^~~~~
In file included from /home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb.h:26:0,
                 from /home/nvidia/gvdb-voxels/source/gRenderKernel/main_renderkernel.cpp:22:
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_vec.h: In constructor ‘nvdb::Vector3D<VTYPE>::Vector3D(const nvdb::Vector4DF&)’:
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_vec.h:60:46: warning: invalid use of incomplete type ‘const class nvdb::Vector4DF’
   Vector3D(const Vector4DF& op) { x = (VTYPE)op.x; y = (VTYPE)op.y; z = (VTYPE)op.z; }
                                              ^~
NBickford-NV commented 3 years ago

Err, don't remove all of the samples other than gJetsonTX - the gJetsonTX isn't included in the CMake list of builds by default, so that won't fix it! What's going on here is that all of the samples rely on main.h in the sample_utils folder, which in turn includes platform.h. It looks like (assuming GCC is being used) none of the following are defined:

__CELLOS_LV2__
__arm__
__i386__
__x86_64__
__ppc__
__ppc64__

This is why you're getting the "Unknown platform" error. (I wonder what the appropriate define from GCC would be here for the system - do you happen to have the name of the exact type of Jetson device you're using?) In any case, if you try commenting out line 186 (#error "Unknown platform"), the build might get further.

AndreV84 commented 3 years ago

I am using Jetson AGX Xavier with default stock kernel; the default devkit version although withupdated cmake Also I can try on jetson NX/ nano also development kit versions so do I comment the line 186 of the file gvdb-voxels/source/sample_utils/platform.h and & that is it? It looks like


#    if defined(ANDROID)
#       define NV_ANDROID
#       define NV_UNIX
#    elif defined(__linux__)
#       define NV_LINUX
#       define NV_UNIX
#    elif defined(__APPLE__)
#       define NV_APPLE
#       define NV_UNIX
#        if defined(__arm__)
#            define NV_APPLE_IOS
#        else
#            define NV_OSX
#        endif
#    elif defined(__CYGWIN__)
#       define NV_CYGWIN
#       define NV_LINUX
#       define NV_UNIX
#    endif
#elif defined NV_GHS
AndreV84 commented 3 years ago

seems line 184

// error "Unknown platform"

AndreV84 commented 3 years ago

it has got build


                       ^
[ 80%] Built target gSprayDeposit
[ 81%] Linking CXX executable gDepthMap
[ 86%] Built target gDepthMap
[ 88%] Linking CXX executable g3DPrint
[ 89%] Linking CXX executable gResample
[ 90%] Linking CXX executable gInteractiveGL
[ 97%] Built target g3DPrint
[ 97%] Built target gResample
[100%] Built target gInteractiveGL
AndreV84 commented 3 years ago

would you extend on how to enable the jetson example, please?

NBickford-NV commented 3 years ago

Hooray! The Jetson example's not enabled by default (because it hasn't been tested in a while and it would be nice if the samples people can see worked by default), but you can try to add it by adding the line

add_subdirectory("source/gJetsonTX" "gJetsonTX")

to the top-level CMakeLists.txt. (You'll also probably want to download the latest version of source/gJetsonTX/CMakeLists.txt as well - I've just pushed an update that should make it compatible with the new build system.)

AndreV84 commented 3 years ago

could you explain, how do we get data into gvbd format, please? given we have pointcloud & rosbags for example?

AndreV84 commented 3 years ago

 cmake -DCMAKE_CUDA_COMPILER=/usr/local/cuda-10.2/bin/nvcc -DCMAKE_CUDA_ARCHITECTURES=72 -D GVDB_ROOT_DIR=/home/nvidia/gvdb-voxels ..
-- -------------------------------
-- Processing Project gJetsonTX:
-- Searching for GVDB at.. /home/nvidia/gvdb-voxels
  NOT FOUND. GVDB Header files
  NOT FOUND. GVDB Library. (so/dll or lib missing)
  NOT FOUND. GVDB Ptx/Glsl. (ptx or glsl missing)
CMake Error at source/sample_utils/FindGVDB.cmake:66 (message):

        Please set GVDB_ROOT_DIR to the root location 
        of installed GVDB library containing /include and /lib.
        Not found at GVDB_ROOT_DIR: /home/nvidia/gvdb-voxels

Call Stack (most recent call first):
  source/gJetsonTX/CMakeLists.txt:47 (find_package)

-- Configuring incomplete, errors occurred!
See also "/home/nvidia/gvdb-voxels/build/CMakeFiles/CMakeOutput.log".
See also "/home/nvidia/gvdb-voxels/build/CMakeFiles/CMakeError.log".
AndreV84 commented 3 years ago

 cmake -DCMAKE_CUDA_COMPILER=/usr/local/cuda-10.2/bin/nvcc -DCMAKE_CUDA_ARCHITECTURES=72  -DGVDB_ROOT_DIR= /home/nvidia/gvdb-voxels/_output/ ..
bin/     include/ lib/     
nvidia@nvidia-desktop:~/gvdb-voxels/build$ cmake -DCMAKE_CUDA_COMPILER=/usr/local/cuda-10.2/bin/nvcc -DCMAKE_CUDA_ARCHITECTURES=72  -DGVDB_ROOT_DIR=/home/nvidia/gvdb-voxels/_output/ ..
-- -------------------------------
-- Processing Project gJetsonTX:
-- Searching for GVDB at.. /home/nvidia/gvdb-voxels/_output/
--   Found. GVDB Header files. /home/nvidia/gvdb-voxels/_output/include
  NOT FOUND. GVDB Library. (so/dll or lib missing)
  NOT FOUND. GVDB Ptx/Glsl. (ptx or glsl missing)
CMake Error at source/sample_utils/FindGVDB.cmake:66 (message):

        Please set GVDB_ROOT_DIR to the root location 
        of installed GVDB library containing /include and /lib.
        Not found at GVDB_ROOT_DIR: /home/nvidia/gvdb-voxels/_output/

Call Stack (most recent call first):
  source/gJetsonTX/CMakeLists.txt:47 (find_package)
AndreV84 commented 3 years ago

it only sees headers as it seems to me
ll /home/nvidia/gvdb-voxels/_output/
total 20
drwxr-xr-x 5 nvidia nvidia 4096 Oct 13 16:53 ./
drwxr-xr-x 7 nvidia nvidia 4096 Oct 13 16:53 ../
drwxr-xr-x 3 nvidia nvidia 4096 Oct 13 16:53 bin/
drwxr-xr-x 2 nvidia nvidia 4096 Oct 13 16:53 include/
drwxr-xr-x 3 nvidia nvidia 4096 Oct 13 16:53 lib/
AndreV84 commented 3 years ago

after copying files from bin folder to lib folder:


cmake -DCMAKE_CUDA_COMPILER=/usr/local/cuda-10.2/bin/nvcc -DCMAKE_CUDA_ARCHITECTURES=72  ..
-- -------------------------------
-- Processing Project gJetsonTX:
-- Searching for GVDB at.. /home/nvidia/gvdb-voxels/_output
--   Found. GVDB Header files. /home/nvidia/gvdb-voxels/_output/include
--   Found. GVDB Library. /home/nvidia/gvdb-voxels/_output/lib
--   Found. GVDB Ptx/Glsl. /home/nvidia/gvdb-voxels/_output/lib
--   GVDB_ROOT_DIR: /home/nvidia/gvdb-voxels/_output
--   GVDB_DLL:  libgvdb.so
--   GVDB_LIB:  libgvdb.so
--   GVDB_PTX:  cuda_gvdb_copydata.ptx;cuda_gvdb_module.ptx
--   GVDB_GLSL: simple.frag.glsl;simple.vert.glsl;voxelize.frag.glsl;voxelize.geom.glsl;voxelize.vert.glsl
--   GVDB_EXTRA:libgvdb.so
-- --> Using package GVDB (inc: /home/nvidia/gvdb-voxels/_output/include) 
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE  
-- Found CUDA: /usr/local/cuda-10.2 (found version "10.2") 
-- --> Using package CUDA (ver 10.2)
-- Build CUDA kernels: 
-- --> Find Sample Utils
--  Using PNG
--  Using TGA
--  Using GLEW
--  Using NVGUI
-- --> Using Sample Utils. /home/nvidia/gvdb-voxels/source/sample_utils

-- Processor: aarch64
-- PTX files: 
CMake Error at source/gJetsonTX/CMakeLists.txt:203 (_CMAKE_INSTALL_PTX):
  Unknown CMake command "_CMAKE_INSTALL_PTX".

-- Configuring incomplete, errors occurred!
See also "/home/nvidia/gvdb-voxels/build/CMakeFiles/CMakeOutput.log".
See also "/home/nvidia/gvdb-voxels/build/CMakeFiles/CMakeError.log".
NBickford-NV commented 3 years ago

The error in https://github.com/NVIDIA/gvdb-voxels/issues/106#issuecomment-708000761 is probably due to the space after the -D in the cmake command line, and the error in https://github.com/NVIDIA/gvdb-voxels/issues/106#issuecomment-708003938 is probably due to the space after the = sign - see https://stackoverflow.com/a/17181954/650762 ; maybe removing these spaces will help? (As you've noticed, it's also possible to compile the sample and include GVDB with your own process and copy the files over manually.)

I'm not a ROS expert, unfortunately, but for transferring the point data to GVDB, the main thing will be to read in the point positions (and possibly velocities and colors as well, in case those are relevant) as floating-point coordinates using ROS (e.g. using pcl_ros). Alternatively, if you have a .ply file with point cloud data, it's possible to write code that will read the point cloud data from the .ply file (a general .ply reader is out of the scope of GVDB, since .ply files can contain mesh data like triangles). Once you have a CPU array of floating-point coordinates (like [x1, y1, z1, x2, y2, z2, x3, y3, z3, ...]), you can upload it to the GPU using GVDB's Allocator::CreateMemLinear, then pass that to GVDB's SetPoints. Once you have that, there are a lot of different ways to draw the points, or to voxelize the points into a volume and perform post-processing; see the samples for some different ways to do this.

(Note that if you only want to visualize a point cloud without performing any voxelization, GVDB might not be the easiest way to go!)

AndreV84 commented 3 years ago

by now the only error left


 PTX files: 
CMake Error at source/gJetsonTX/CMakeLists.txt:203 (_CMAKE_INSTALL_PTX):
  Unknown CMake command "_CMAKE_INSTALL_PTX".
NBickford-NV commented 3 years ago

Ah, you're probably using the old version of the gJetsonTX CMakeLists! I just updated the CMake file for it about half an hour ago to try to fix this in advance - see https://github.com/NVIDIA/gvdb-voxels/commit/0d8b3ea24a5901d842c23c114cb0e81e06547755

AndreV84 commented 3 years ago

I just replaced the CMakeLists file so it has become different:


 cmake -DCMAKE_CUDA_COMPILER=/usr/local/cuda-10.2/bin/nvcc -DCMAKE_CUDA_ARCHITECTURES=72  ..
-- The C compiler identification is GNU 7.5.0
-- The CXX compiler identification is GNU 7.5.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The CUDA compiler identification is NVIDIA 10.2.89
-- Detecting CUDA compiler ABI info
-- Detecting CUDA compiler ABI info - done
-- Check for working CUDA compiler: /usr/local/cuda-10.2/bin/nvcc - skipped
-- Detecting CUDA compile features
-- Detecting CUDA compile features - done
-- Found OpenGL: /usr/lib/aarch64-linux-gnu/libOpenGL.so   
-- Found GLEW: /home/nvidia/gvdb-voxels/source/gvdb_library/glew/include  
-- Found X11: /usr/include   
-- Looking for XOpenDisplay in /usr/lib/aarch64-linux-gnu/libX11.so;/usr/lib/aarch64-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /usr/lib/aarch64-linux-gnu/libX11.so;/usr/lib/aarch64-linux-gnu/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- --> Find Sample Utils
--  Using OpenGL
--  Using PNG
--  Using TGA
--  Using GLEW
--  Using NVGUI
-- --> Using Sample Utils. /home/nvidia/gvdb-voxels/source/sample_utils

CMake Error at source/gvdb_library/CMakeLists.txt:37 (add_library):
  add_library cannot create target "gvdbPTX" because another target with the
  same name already exists.  The existing target is created in source
  directory "/home/nvidia/gvdb-voxels/source/gvdb_library".  See
  documentation for policy CMP0002 for more details.

CMake Error at source/gvdb_library/CMakeLists.txt:71 (add_library):
  add_library cannot create target "gvdb" because another target with the
  same name already exists.  The existing target is a shared library created
  in source directory "/home/nvidia/gvdb-voxels/source/gvdb_library".  See
  documentation for policy CMP0002 for more details.

CMake Error at source/gvdb_library/CMakeLists.txt:120 (target_link_libraries):
  Attempt to add link library "/usr/lib/aarch64-linux-gnu/libOpenGL.so" to
  target "gvdb" which is not built in this directory.

  This is allowed only when policy CMP0079 is set to NEW.

CMake Error at source/gvdb_library/CMakeLists.txt:126 (target_link_libraries):
  Attempt to add link library "cuda" to target "gvdb" which is not built in
  this directory.

  This is allowed only when policy CMP0079 is set to NEW.

CMake Error at source/gvdb_library/CMakeLists.txt:311 (add_custom_target):
  add_custom_target cannot create target "gvdbCopy" because another target
  with the same name already exists.  The existing target is a custom target
  created in source directory "/home/nvidia/gvdb-voxels/source/gvdb_library".
  See documentation for policy CMP0002 for more details.

-- --> Find Sample Utils
--  Using OpenGL
--  Using PNG
--  Using TGA
--  Using GLEW
--  Using NVGUI
-- --> Using Sample Utils. /home/nvidia/gvdb-voxels/source/sample_utils

-- --> Find Sample Utils
--  Using OpenGL
--  Using PNG
--  Using TGA
--  Using GLEW
--  Using NVGUI
-- --> Using Sample Utils. /home/nvidia/gvdb-voxels/source/sample_utils

-- --> Find Sample Utils
--  Using OpenGL
--  Using PNG
--  Using TGA
--  Using GLEW
--  Using NVGUI
-- --> Using Sample Utils. /home/nvidia/gvdb-voxels/source/sample_utils

-- --> Find Sample Utils
--  Using OpenGL
--  Using PNG
--  Using GLEW
-- --> Using Sample Utils. /home/nvidia/gvdb-voxels/source/sample_utils

-- --> Find Sample Utils
--  Using OpenGL
--  Using PNG
--  Using GLEW
-- --> Using Sample Utils. /home/nvidia/gvdb-voxels/source/sample_utils

-- --> Find Sample Utils
--  Using OpenGL
--  Using PNG
--  Using TGA
--  Using GLEW
--  Using NVGUI
-- --> Using Sample Utils. /home/nvidia/gvdb-voxels/source/sample_utils

-- --> Find Sample Utils
--  Using OpenGL
--  Using PNG
--  Using TGA
--  Using GLEW
--  Using NVGUI
-- --> Using Sample Utils. /home/nvidia/gvdb-voxels/source/sample_utils

-- Configuring incomplete, errors occurred!
See also "/home/nvidia/gvdb-voxels/build/CMakeFiles/CMakeOutput.log".
See also "/home/nvidia/gvdb-voxels/build/CMakeFiles/CMakeError.log".
NBickford-NV commented 3 years ago

Ah - in the top-level CMakeLists.txt file, did you happen to add the add_subdirectory("source/gJetsonTX" "gJetsonTX") line before add_subdirectory("source/gvdb_library" "gvdb_library")? It should be after add_subdirectory("source/gvdb_library" "gvdb_library"), so that the gJetsonTX CMake knows that gvdb_library has already been added. (Sorry, I should probably have said "append" instead of "add" in my message!)

AndreV84 commented 3 years ago

it worked little bit further, after I added it as last at the list of added things


                           ^
/home/nvidia/gvdb-voxels/source/gJetsonTX/main_jetson.cpp: In member function ‘virtual bool Sample::init()’:
/home/nvidia/gvdb-voxels/source/gJetsonTX/main_jetson.cpp:264:41: error: no matching function for call to ‘nvdb::VolumeGVDB::AddPath(std::__cxx11::string)’
  gvdb.AddPath ( std::string(ASSET_PATH) );
                                         ^
In file included from /home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb.h:32:0,
                 from /home/nvidia/gvdb-voxels/source/gJetsonTX/main_jetson.cpp:30:
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_volume_gvdb.h:398:9: note: candidate: void nvdb::VolumeGVDB::AddPath(const char*)
    void AddPath ( const char* path );
         ^~~~~~~
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_volume_gvdb.h:398:9: note:   no known conversion for argument 1 from ‘std::__cxx11::string {aka std::__cxx11::basic_string<char>}’ to ‘const char*’
/home/nvidia/gvdb-voxels/source/gJetsonTX/main_jetson.cpp:298:7: error: ‘class nvdb::VolumeGVDB’ has no member named ‘SetVoxelSize’; did you mean ‘SolidVoxelize’?
  gvdb.SetVoxelSize ( m_voxelsize, m_voxelsize, m_voxelsize );
       ^~~~~~~~~~~~
       SolidVoxelize
/home/nvidia/gvdb-voxels/source/gJetsonTX/main_jetson.cpp: In member function ‘void Sample::ExposeLayer(int, int)’:
/home/nvidia/gvdb-voxels/source/gJetsonTX/main_jetson.cpp:352:52: error: no matching function for call to ‘nvdb::VolumeGVDB::Render(int, int, int, int, int, int, double)’
  gvdb.Render ( 1, SHADE_SECTION2D, 0, 0, 1, 1, 1.0 );
                                                    ^
In file included from /home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb.h:32:0,
                 from /home/nvidia/gvdb-voxels/source/gJetsonTX/main_jetson.cpp:30:
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_volume_gvdb.h:357:9: note: candidate: void nvdb::VolumeGVDB::Render(char, uchar, uchar)
    void Render ( char shade_mode = SHADE_TRILINEAR, uchar in_channel = 0, uchar outbuf = 0 );
         ^~~~~~
/home/nvidia/gvdb-voxels/source/gvdb_library/src/gvdb_volume_gvdb.h:357:9: note:   candidate expects 3 arguments, 7 provided
/home/nvidia/gvdb-voxels/source/gJetsonTX/main_jetson.cpp: In function ‘int sample_main(int, const char**)’:
/home/nvidia/gvdb-voxels/source/gJetsonTX/main_jetson.cpp:480:91: error: no matching function for call to ‘Sample::run(const char [33], int&, const char**&, int, int, int, int)’
  return sample_obj.run ( "NVIDIA(R) GVDB Voxels - g3DPrint", argc, argv, 1920, 1080, 4, 4 );
                                                                                           ^
In file included from /home/nvidia/gvdb-voxels/source/gJetsonTX/main_jetson.cpp:34:0:
AndreV84 commented 3 years ago

so at the termination it shows


[ 71%] Built target gDepthMap
[ 72%] Linking CXX executable gInteractiveGL
[ 77%] Built target gInteractiveGL
[ 78%] Linking CXX executable g3DPrint
[ 83%] Built target g3DPrint
[ 84%] Linking CXX executable gSprayDeposit
[ 89%] Built target gSprayDeposit
[ 90%] Linking CXX executable gResample
[ 91%] Built target gResample
Makefile:148: recipe for target 'all' failed
make: *** [all] Error 2
NBickford-NV commented 3 years ago

OK, that's much more expected - those are bugs in the sample. Give me one moment to fix them.

NBickford-NV commented 3 years ago

OK, it should build now! Please note that it'll exit because it can't find http://ramakarl.com/vox3/, but it should build. The other samples that don't use OptiX should also work on Jetson devices.

AndreV84 commented 3 years ago

yes, it builds, but exits


./gJetsonTX 
Starting here
Got here
Sys Exe Path : .
DPY : 0x5581600840 .
GLX Config Sample Buffers : 0.
GLX Config Samples : 0.
GLX Config Sample Buffers : 0.
GLX Config Samples : 0.
GLX Config Sample Buffers : 0.
GLX Config Samples : 0.
GLX Config Sample Buffers : 0.
GLX Config Samples : 0.
GLX Config Sample Buffers : 1.
GLX Config Samples : 2.
GLX Config Sample Buffers : 1.
GLX Config Samples : 2.
GLX Config Sample Buffers : 1.
GLX Config Samples : 2.
GLX Config Sample Buffers : 1.
GLX Config Samples : 2.
GLX Config Sample Buffers : 1.
GLX Config Samples : 4.
GLX Config Sample Buffers : 1.
GLX Config Samples : 4.
GLX Config Sample Buffers : 1.
GLX Config Samples : 4.
GLX Config Sample Buffers : 1.
GLX Config Samples : 4.
GLX Config Sample Buffers : 1.
GLX Config Samples : 8.
GLX Config Sample Buffers : 1.
GLX Config Samples : 8.
GLX Config Sample Buffers : 1.
GLX Config Samples : 8.
GLX Config Sample Buffers : 1.
GLX Config Samples : 8.
Creating Window.
Width : 1920 Height : 1080.
Window : 96468994.
Window Created.
Reading TGA: /home/nvidia/gvdb-voxels/source/shared_assets/arial.tga
Error: Cannot connect to printer.
Error. Application will exit
NBickford-NV commented 3 years ago

Yep! That's normal - that sample's meant to send G-code commands to a 3D printer. Since it can't find a 3D printer, it exits. Some of the other non-OptiX samples should display more interesting things using the Jetson, though!

AndreV84 commented 3 years ago

could you extend on how could we generate any gvdb file, please? given we have .ply, & pcd files, also there is OptiX installed [ I did not work with it before though]

AndreV84 commented 3 years ago

@NeilBickford-NV , shall I raise a separate issue for the conversion concern or could you answer here, please? Thank you very much!

NBickford-NV commented 3 years ago

Please don't create a new issue for the conversion concern. As described in https://github.com/NVIDIA/gvdb-voxels/issues/106#issuecomment-708009354, there are three main steps to importing your data: reading the point data from the .ply or .pcd files, copying this data to the GPU using Allocator::CreateMemLinear (getting a DataPtr), and then giving the DataPtr to this data to GVDB using SetPoints. Unfortunately, the first step (reading data from the file) doesn't use GVDB or CUDA, so I'm not really the best person to ask about it. Maybe consider using a library such as tinyply for PLY files, or consulting documentation for the PCD file format?

For GVDB, please see the version 1.1 documentation at https://github.com/NVIDIA/gvdb-voxels/blob/master/GVDB_Programming_Guide_1.1.pdf, as well as the source code for the samples that work with point clouds, such as gPointCloud, to see how to perform the second and third steps.

Once constructed, GVDB volumes can be saved and loaded from VBX files. Once you've created a GVDB object, you can call SaveVBX to save its data to a .vbx file. (They can also be interchanged with OpenVDB files and exported to NanoVDB objects in-memory, and one can write their own importers and exporters between GVDB objects in memory and other file formats.)

AndreV84 commented 3 years ago

thank you for the pointers. maybe there is an example that somehow could take inputs as .ply and provide outputs as gvdb? once we got gvdb file how would we execute it?

NBickford-NV commented 3 years ago

A sample might exist in the future, but it would probably be a long time before one is created for that specific format. Additionally, although more importers could be built, it's outside the scope of GVDB to handle every 3D format; loading general, non-voxel 3D formats is probably best maintained by dedicated 3D format libraries, such as tinyply and Assimp.

Once you've loaded data into GVDB, there are an almost infinite number of ways you can process it, whether that's turning it into a voxel volume,. advecting points using a velocity field, applying arbitrary compute kernels on the sparse volume, and more! There's also a nearly infinite number of ways to visualize a volume - GVDB supports arbitrary ray tracing kernels. Please see the GVDB documentation for a full list of functions provided by the API.

AndreV84 commented 3 years ago

as long as we were able to get openvdb [.vdb] files from .ply files; which will be a simple way to get them to gvdb/ vizualize them using gvdb? Thanks

NBickford-NV commented 3 years ago

Yep, absolutely! The gImportVDB sample shows how to load and render an OpenVDB level set, and can be modified to use different kinds of rendering. (Additionally, any sample that loads a voxel file can be modified to load an OpenVDB file by using the LoadVDB function.)

Note that you'll need to build GVDB with OpenVDB in order to read OpenVDB files; please see the read instructions in the README for how to do that.

AndreV84 commented 3 years ago

what if out .vdb file from tiny ply goes 30-300gb? will it still be vizualized? which hardware will be required?

AndreV84 commented 3 years ago

do you by any chance know which input formats are supported by IndeX? does it also vizualize vdb/binvox ? also where to pick up a trial license for Index?

NBickford-NV commented 3 years ago

Well, if your VDB file is 30-300 GB, you'll either need a GPU that can fit it in memory (some Quadro and professional GPUs can do this on the 30 GB side), or a way to render it out-of-core. IndeX is a good solution for out-of-core rendering. It's also hypothetically possible, but rather complex, to implement out-of-core rendering with GVDB (it is not built in; GVDB is sort of mostly the base data structure). I'd probably recommend trying to start out by using a smaller VDB file (e.g. try lower-resolution voxelization, or downsample the volume). Loading and iteration times should both be faster. Then once that works, you'll probably have a good idea of what you need to do to support the larger VDB file.

I know IndeX supports both OpenVDB and NanoVDB files. You can contact the IndeX team at https://developer.nvidia.com/index-contact. There are also a couple of different ways to access IndeX, most using virtualization (e.g. Docker) of some kind - see https://developer.nvidia.com/nvidia-index-get-started for some different ways. (I'm not part of the IndeX team, so they would probably be the best people to ask)

AndreV84 commented 3 years ago

I deployed the Index so I open the vizualizer in web browser also mounted data folder so I can see the list of vdb in the web vizualizer, but when I click on vdb files nothing happens I also tried with smaller files e.g http://graphics.stanford.edu/pub/3Dscanrep/bunny.tar.gz we have access to instance with almost infinite ram that could be used in the cloud; but stil how to input any vdb file to any solution so it will be viewed? in Index? in other proposed viewer? with tiny file? with mega file?

used soft https://ngc.nvidia.com/catalog/containers/nvidia-hpcvis:paraview-index

NBickford-NV commented 3 years ago

Sorry, I'm not an IndeX maintainer, so I don't know how to answer questions about IndeX! The IndeX team should be able to answer your questions better.

AndreV84 commented 3 years ago

the complication is that they do not respond; also their published solution at NGC cloud has already expired license that expired in February 2020; So it might be unlikely that they will respond at all; Thank you very much

fishfishson commented 3 years ago

Hi, I also meet the problem about building with cuda10.2

The command I use is

cmake -DCMAKE_CUDA_COMPILER=/usr/local/cuda/bin/nvcc -DCMAKE_CUDA_ARCHITECTURES=72 ..
make -j

The terminal reports errors liek:

[ 25%] Building CXX object gvdb_library/CMakeFiles/gvdb.dir/src/gvdb_types.cpp.o
...
/home/xxx/gvdb-voxels/source/gvdb_library/src/gvdb_vec.h:48:48: error: invalid use of incomplete type ‘const class nvdb::Vector4DF’Vector3D(const Vector4DF& op) { x = (VTYPE)op.x; y = (VTYPE)op.y; z = (VTYPE)op.z; }
/home/xxx/gvdb-voxels/source/gvdb_library/src/gvdb_vec.h:23:8: note: forward declaration of ‘class nvdb::Vector4DF’class Vector4DF;
NBickford-NV commented 3 years ago

Hi fishfishson,

I think this was a bug - I've fixed these messages from GCC in the latest commit now!

Also, under GCC 10.2, these are warnings instead of errors - is it possible warnings-as-errors are enabled somehow?