bytedeco/javacpp

Issue with Thrust Example

Open

#485 opened on May 30, 2021

View on GitHub
 (2 comments) (0 reactions) (0 assignees)Java (620 forks)batch import
bughelp wanted

Repository metrics

Stars
 (4,279 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

Trying to get this working: https://github.com/bytedeco/javacpp/wiki/Interface-Thrust-and-CUDA

Everything seems to compile as expected. However, when I go to run the main application, I get the following error:

java.lang.RuntimeException: radix_sort: failed on 1st step: cudaErrorInvalidDeviceFunction: invalid device function
    at thrust.Thrust.sort(Native Method)
    at thrust.JavacppSampleTest.verifySample(JavacppSampleTest.java:25)

From the NVIDIA docs: cudaErrorInvalidDeviceFunction = 98

The requested device function does not exist or is not compiled for the proper device architecture.

I tried experimenting with different architectures, but to no avail. I've created a sample project with a unit test that demonstrates the problem here:

https://github.com/masterav10/thrust

Toolchain:

nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2021 NVIDIA Corporation Built on Sun_Feb_14_22:08:44_Pacific_Standard_Time_2021 Cuda compilation tools, release 11.2, V11.2.152 Build cuda_11.2.r11.2/compiler.29618528_0

Microsoft (R) C/C++ Optimizing Compiler Version 19.27.29111 for x64

Steps to recreate:

  1. Clone my 'thrust' project
  2. Run x64 Native Tools Command Prompt for VS 2019
  3. Navigate to the thrust project
  4. gradlew clean test

Contributor guide