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

Fixes for CUDA 12.0 on Ubuntu 20.04 #131

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/gpu_voxels/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ ENDIF(CUDA_FOUND)
IF(GLEW_FOUND AND GLM_FOUND AND OPENGL_FOUND AND GLUT_FOUND)
MESSAGE(STATUS "[OK] Building GPU-Voxels with visualization. GLEW, GLM, OpenGL and GLUT were found.")
ELSE(GLEW_FOUND AND GLM_FOUND AND OPENGL_FOUND AND GLUT_FOUND)
MESSAGE(STATUS "[WARNING] Building GPU-Voxels without visualization because the following packages are missing:")
MESSAGE(STATUS "[WARNING] Building GPU-Voxels without visualization because the following packages are missing:")
IF(NOT GLEW_FOUND)
MESSAGE(STATUS " Glew")
ENDIF(NOT GLEW_FOUND)
Expand Down Expand Up @@ -136,15 +136,15 @@ MESSAGE(STATUS "----------------------------------------------------------------
# Change these lines to increase performance if your GPU's compute capability is higher
# GPU-Voxels requires GPU CUDA capabilities >= 2.0
#SET(ICMAKER_CUDA_COMPUTE_VERSION 20)
SET(ICMAKER_CUDA_COMPUTE_VERSION 35)
SET(ICMAKER_CUDA_COMPUTE_VERSION 61)

SET(ICMAKER_CUDA_ARCH compute_${ICMAKER_CUDA_COMPUTE_VERSION})
SET(ICMAKER_CUDA_CODE compute_${ICMAKER_CUDA_COMPUTE_VERSION})

#Usage example for specifying PTX for compute_35 and cubin for sm_51:
# SET(ICMAKER_CUDA_CODE compute_35,sm_51)

## Uncomment this definition if you want to avoid PTX JIT compilation at first runtime.
## Uncomment this definition if you want to avoid PTX JIT compilation at first runtime.
## Having both a compute_ and a sm_ code target will include both PTX and CUBIN in the final binary.
## IMPORTANT: Check your device's compute capability. the sm_xy argument needs to match your device to have any effect!
## Version table: https://en.wikipedia.org/wiki/CUDA#GPUs_supported
Expand Down
2 changes: 1 addition & 1 deletion packages/gpu_voxels/src/gpu_visualization/Visualizer.cu
Original file line number Diff line number Diff line change
Expand Up @@ -1684,7 +1684,7 @@ void Visualizer::renderFunction(void)
{
float wait = 1000.f / m_max_fps - m_delta_time;
m_delta_time += wait;
boost::this_thread::sleep(boost::posix_time::milliseconds(wait));
boost::this_thread::sleep(boost::posix_time::milliseconds(long(wait)));
}
}

Expand Down
9 changes: 5 additions & 4 deletions packages/gpu_voxels/src/gpu_voxels/octree/NTree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,11 @@ namespace cub = thrust::system::cuda::detail::cub_;
#else // Cuda 9 or higher
#define THRUST_CUB_NS_PREFIX namespace thrust { namespace cuda_cub {
#define THRUST_CUB_NS_POSTFIX } }
#include <thrust/system/cuda/detail/cub/device/device_radix_sort.cuh>
#undef CUB_NS_PREFIX
#undef CUB_NS_POSTFIX
namespace cub = thrust::cuda_cub::cub;
/* #include <thrust/system/cuda/detail/cub/device/device_radix_sort.cuh> */
#include <cub/device/device_radix_sort.cuh>
/* #undef CUB_NS_PREFIX */
/* #undef CUB_NS_POSTFIX */
/* namespace cub = thrust::cuda_cub::cub; */
#endif

// Internal dependencies
Expand Down
9 changes: 5 additions & 4 deletions packages/gpu_voxels/src/gpu_voxels/octree/NTreeData.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ namespace cub = thrust::system::cuda::detail::cub_;
#else // Cuda 9 or higher
#define THRUST_CUB_NS_PREFIX namespace thrust { namespace cuda_cub {
#define THRUST_CUB_NS_POSTFIX } }
#include <thrust/system/cuda/detail/cub/util_type.cuh>
#undef CUB_NS_PREFIX
#undef CUB_NS_POSTFIX
namespace cub = thrust::cuda_cub::cub;
/* #include <thrust/system/cuda/detail/cub/util_type.cuh> */
#include <cub/util_type.cuh>
/* #undef CUB_NS_PREFIX */
/* #undef CUB_NS_POSTFIX */
/* namespace cub = thrust::cuda_cub::cub; */
#endif

namespace gpu_voxels {
Expand Down
9 changes: 5 additions & 4 deletions packages/gpu_voxels/src/gpu_voxels/octree/PointCloud.cu
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@ namespace cub = thrust::system::cuda::detail::cub_;
#else // Cuda 9 or higher
#define THRUST_CUB_NS_PREFIX namespace thrust { namespace cuda_cub {
#define THRUST_CUB_NS_POSTFIX } }
#include <thrust/system/cuda/detail/cub/device/device_radix_sort.cuh>
#undef CUB_NS_PREFIX
#undef CUB_NS_POSTFIX
namespace cub = thrust::cuda_cub::cub;
/* #include <thrust/system/cuda/detail/cub/device/device_radix_sort.cuh> */
#include <cub/device/device_radix_sort.cuh>
/* #undef CUB_NS_PREFIX */
/* #undef CUB_NS_POSTFIX */
/* namespace cub = thrust::cuda_cub::cub; */
#endif

#include <thrust/sort.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ namespace cub = thrust::system::cuda::detail::cub_;
#else // Cuda 9 or higher
#define THRUST_CUB_NS_PREFIX namespace thrust { namespace cuda_cub {
#define THRUST_CUB_NS_POSTFIX } }
#include <thrust/system/cuda/detail/cub/util_type.cuh>
#undef CUB_NS_PREFIX
#undef CUB_NS_POSTFIX
namespace cub = thrust::cuda_cub::cub;
/* #include <thrust/system/cuda/detail/cub/util_type.cuh> */
#include <cub/util_type.cuh>
/* #undef CUB_NS_PREFIX */
/* #undef CUB_NS_POSTFIX */
/* namespace cub = thrust::cuda_cub::cub; */
#endif

// __ballot has been replaced by __ballot_sync in Cuda9
Expand Down
1 change: 1 addition & 0 deletions packages/gpu_voxels/src/gpu_voxels/test/testing_thrust.cu
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <thrust/binary_search.h>
#include <thrust/generate.h>
#include <thrust/device_vector.h>
#include <thrust/host_vector.h>
#include <thrust/execution_policy.h>
#include <boost/test/unit_test.hpp>
#include <gpu_voxels/test/testing_fixtures.hpp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#ifndef GPU_VOXELS_VOXELLIST_BITVOXELLIST_H
#define GPU_VOXELS_VOXELLIST_BITVOXELLIST_H

#include <thrust/host_vector.h>
#include <gpu_voxels/voxel/BitVoxel.h>
#include <gpu_voxels/voxel/SVCollider.h>
#include <gpu_voxels/voxellist/TemplateVoxelList.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#include <thrust/remove.h>
#include <thrust/binary_search.h>
#include <thrust/system_error.h>
#include <thrust/host_vector.h>

namespace gpu_voxels {
namespace voxellist {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

#include <thrust/device_ptr.h>
#include <thrust/device_vector.h>
#include <thrust/host_vector.h>
#include <thrust/inner_product.h>
#include <thrust/fill.h>
#include <thrust/count.h>
Expand Down