Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

thrust 1.8.3 exclusive_scan with custom temporary allocation, no default constructor error #800

Closed
Mochimazui opened this issue May 31, 2016 · 8 comments
Labels
type: bug: functional Does not work as intended.

Comments

@Mochimazui
Copy link

Using VS2013 with CUDA 8.0 + thrust 1.8.3.
Same error occurs with CUDA 7.5 + thrust 1.8.3.

See code at https://gist.github.com/Mochimazui/007b243e7be16527f5d5380d596c1993.
This is a simple modification from thrust/examples/cuda/custom_temporary_allocation.cu. Just add scan.h and replace the sort function with exclusive_scan.

nvcc shows following compile error:

1>C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include\thrust/detail/reference.inl(127): error : no default constructor exists for class "thrust::detail::execute_with_allocator<cached_allocator, thrust::system::cuda::detail::execute_on_stream_base>" 1>C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include\thrust/detail/reference.inl(98): error : no default constructor exists for class "thrust::detail::execute_with_allocator<cached_allocator, thrust::system::cuda::detail::execute_on_stream_base>"

@bramton
Copy link

bramton commented Jun 2, 2016

I ran into the same error while trying to compile OpenCV in combination with the CUDA 8.0 libraries.
I am using VS2015 Community.
I checked out the thrust 1.8.3 branch from GitHub into the CUDA 8.0 include directory and this works fine for me.
@Mochimazui Could you try this as well ?

@Mochimazui
Copy link
Author

@bramton tried same environment as you said, still getting them same error.

Using Microsoft Visual Studio Community 2015 Version 14.0.24720.00 Update 1, with thrust 1.8.3 from GitHub and copied to CUDA 8.0 include directory.

VS output window shows
1> D:\code\thrust_1.8.3_allocator\thrust_1.8.3_allocator>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\bin\nvcc.exe" -gencode=arch=compute_20,code=\"sm_20,compute_20\" --use-local-env --cl-version 2015 -ccbin "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0\include" --keep-dir x64\Release -maxrregcount=0 --machine 64 --compile -cudart static -DWIN32 -DNDEBUG -D_CONSOLE -D_LIB -D_UNICODE -DUNICODE -Xcompiler "/EHsc /W3 /nologo /O2 /Zi /MD " -o x64\Release\main.cu.obj "D:\code\thrust_1.8.3_allocator\thrust_1.8.3_allocator\main.cu"

Is that all the same with yours?

@bramton
Copy link

bramton commented Jun 2, 2016

This is the error I get when I use the thrust library provided with CUDA 8.0:
C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v8.0/include\thrust/detail/reference.inl(127): error : no default constructor exists for class "thrust::detail::execute_with_allocator<cv::cuda::device::ThrustAllocator, thrust::system::cuda::detail::execute_on_stream_base>"

What I did to get it working was the following:

  • Renamed ...CUDA\v8.0\include\thrust\ to thrust_old
  • Made a shortcut ..CUDA\v8.0\include\thrust\ to ...thrust-git-checkout\thrust

@bramton
Copy link

bramton commented Jun 3, 2016

I made a bug report at NVIDIA with this issue, this is their reply:

Actually, this is a known issue and has been fixed now in our development builds. Unfortunately the CUDA 8.0 RC build doesn't contain this fix yet, it would be available for you in the next release of CUDA 8.0.

Could someone close this issue ?

@jaredhoberock
Copy link
Contributor

Thanks @Mochimazui and @bramton! We'll keep this issue open until the fix is reflected in the repository to make others aware of the problem and let them know that a solution is in progress.

@3gx
Copy link
Contributor

3gx commented Jul 1, 2016

The solution is already in place. Please use "cuda-next-release" branch where the problem is fixed. The fix will also be in CUDA 8.0 GA.

@twmht
Copy link

twmht commented Jul 9, 2016

@bramton 's solution works for me.

@zhanghang1989
Copy link

Thanks a lot! It works for me on ubuntu 16.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug: functional Does not work as intended.
Projects
None yet
Development

No branches or pull requests

7 participants