Serving the Quantitative Finance Community

 
427cid
Topic Author
Posts: 4
Joined: January 3rd, 2017, 11:16 pm

Python CUDA

March 21st, 2017, 9:47 am

Hi Everyone, apologies in advance if this has already been asked/answered.
I am running Feb 2017 release of Intel Python (developed by Continuum Analytics) on JetBrains in a Windows 10 environment with an NVIDIA CUDA compatible GPU.
I am attempting to direct my code to the gpu but am getting errors on the following line: @vectorize ([...], target='gpu'). According to my compiler, 'gpu' is not a recognized target. I have tried running numerous code examples that I found online, but the error message remains and is always the same.

I would be grateful for any thoughts or recommendations. Link to code example is below:
https://docs.continuum.io/numbapro/CUDAufunc
 
User avatar
Cuchulainn
Posts: 20250
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Re: Python CUDA

March 21st, 2017, 1:32 pm

I don't know this environment., Looks more like 'gpu' has not been configured in your stuff, like some hardware extension.
 
427cid
Topic Author
Posts: 4
Joined: January 3rd, 2017, 11:16 pm

Re: Python CUDA

March 21st, 2017, 2:16 pm

@Cuchulainn - My understanding with the Numba library is that it takes care of the configuring and 'target' directs the code to library-recognized destinations.
Any Numba experts out there?
 
User avatar
AlexEro
Posts: 145
Joined: November 25th, 2014, 4:27 pm
Location: Ukraine

Re: Python CUDA

March 22nd, 2017, 6:46 am

I am not an expert on Python or Numba. But this may help you:
instead of @vectorize, use @jit, or for CUDA dialect of Numba: @cuda.jit.
The rest of details are here:
https://docs.continuum.io/numbapro/CUDAJit
https://docs.continuum.io/numbapro/CUDAufunc
http://www.quantatrisk.com/2014/12/06/g ... -numbapro/
http://numba.pydata.org/numba-doc/0.13/CUDAJit.html
http://stackoverflow.com/questions/3589 ... target-gpu
 
427cid
Topic Author
Posts: 4
Joined: January 3rd, 2017, 11:16 pm

Re: Python CUDA

March 23rd, 2017, 10:00 pm

Thanks AlexEro. 

Still unable to get the code running on the GPU, but my search continues!
 
User avatar
dweeb
Posts: 11
Joined: July 11th, 2009, 8:10 pm

Re: Python CUDA

March 26th, 2017, 5:44 pm

Without getting lost in the details, is it a 32 bit v 64 bit issue??
 
427cid
Topic Author
Posts: 4
Joined: January 3rd, 2017, 11:16 pm

Re: Python CUDA

April 3rd, 2017, 9:52 am

Hi Dweeb, apologies for the late reply. Not entirely sure what you mean. I am running 64-bit Python on 64-bit architecture.
 
sfindler
Posts: 1
Joined: April 7th, 2017, 2:31 pm

Re: Python CUDA

April 7th, 2017, 3:04 pm

Hi 427cid, I have a quick couple of questions for you.  First, did you make sure to install the NVIDIA sdk?  (As it says in their docs: "NumbaPro does not ship the CUDA driver. It is users responsibility to ensure their systems are using the latest driver. Currently, users should use the driver shipped with CUDA 5.5 SDK").  Additionally, to test if your gpu is configured correctly, you should try running:
import numbapro

numbapro.check_cuda()
If that causes an error than I would look into which of the steps here you missed.