JCuda addition

Hello,

I am trying to do simple program of vector addition in JCUDA from jcuda.org - Java bindings for CUDA In it I just replace their cu file with mine, including location of it, but it is showing me some exeption as follows:

Executing
nvcc -m32 -ptx C:\Users\590942\workspace\TheProject\src\jcuda\add.cu -o C://Users//590942//workspace//TheProject//src//jcuda//add.ptx


Exception in thread "main" java.io.IOException: Cannot run program "nvcc": CreateProcess error=2, The system cannot find the file specified
	at java.lang.ProcessBuilder.start(Unknown Source)
	at java.lang.Runtime.exec(Unknown Source)
	at java.lang.Runtime.exec(Unknown Source)
	at java.lang.Runtime.exec(Unknown Source)
	at vectotrAdd.preparePtxFile(vectotrAdd.java:155)
	at vectotrAdd.main(vectotrAdd.java:29)
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
	at java.lang.ProcessImpl.create(Native Method)
	at java.lang.ProcessImpl.<init>(Unknown Source)
	at java.lang.ProcessImpl.start(Unknown Source)
	... 6 more

.cu file is present at mentioned path in my program.Even respective JCudaDriver-windows-x86.dll and runtimeDriver.dll is added with 32bit jar files.
Specification: 1.CUDA toolkit 6.5v 2.Eclipse 3.Gforce 210(compute capability 1.2)

Thanks in advance :slight_smile:

When you execute
nvcc -m32 -ptx C:\Users\590942\workspace\TheProject\src\jcuda\add.cu -o C://Users//590942//workspace//TheProject//src//jcuda//add.ptx
manually at the command line, you should see the same result (and this is not directly related to CUDA or JCuda).

The paths look suspicious. It should be
either C:/Users/590942/workspace/TheProject/src/jcuda/add.ptx
or C:\Users\590942\workspace\TheProject\src\jcuda\add.ptx

But in general, it should NOT be necessary to specify the full, absolute path, when you put the .CU file into the right directory (basically, in the same directory as the .JAVA and .CLASS files, if you are not using an IDE where these are placed in different directories.