Thanks Bogdan, that got it working. I figured it must be something to do with 
the path, but I had already added the relevant directories to the "Paths" tab 
in the Project Interpreter settings page, apparently those don't get included 
in the environment.
For the record, I had to add /usr/local/cuda/bin (for nvcc), then 
/usr/local/bin (for clang compiler) and finally /usr/bin (for rm).

Ben
________________________________________
From: Bogdan Opanchuk [manti...@gmail.com]
Sent: 16 January 2014 11:16
To: Rowland Ben
Cc: pycuda@tiker.net
Subject: Re: [PyCUDA] mvcc Errno 2 problem using PyCharm IDE

Hi Ben,

In Terminal, you have /usr/local/cuda/bin in .bash_profile (or
analogous config file if you are using some other shell), so you can
access nvcc without specifying the path to it. PyCharm does not use
your .bash_profile, and requires you to set the environment by other
means. See http://stackoverflow.com/questions/8732119/pycharm-path-on-os-x
, it has two ways to do it (one that will work for other applications
too, and one PyCharm-specific).

On Thu, Jan 16, 2014 at 9:00 PM, Rowland Ben
<rowland....@claudiusregaud.fr> wrote:
> Dear list,
>
> I have been using PyCuda for a couple of months now and really enjoying 
> myself (albeit with a few frustrating moments along the way). However as I am 
> moving from test programs to a more complicated real case I want to use my 
> customary Python IDE (PyCharm by JetBrains) rather than just using text 
> editors to write the code. Unfortunately I haven’t been able to get the two 
> playing nicely together so far, and am now turning to you guys for help.
>
> I can import the PyCuda modules into my project with no problem, this part of 
> the code runs fine. Unfortunately when I get to the point where I actually 
> try and compile using a SourceModule, I get the following error:
>
> Traceback (most recent call last):
>   File "/Users/ben/MRSI/python/mrsi/cuda_flowchart.py", line 847, in 
> recompile_cuda_code
>     no_extern_c=True)
>   File 
> "/Users/ben/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pycuda-2013.1.1-py2.7-macosx-10.6-x86_64.egg/pycuda/compiler.py",
>  line 262, in __init__
>     arch, code, cache_dir, include_dirs)
>   File 
> "/Users/ben/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pycuda-2013.1.1-py2.7-macosx-10.6-x86_64.egg/pycuda/compiler.py",
>  line 252, in compile
>     return compile_plain(source, options, keep, nvcc, cache_dir)
>   File 
> "/Users/ben/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pycuda-2013.1.1-py2.7-macosx-10.6-x86_64.egg/pycuda/compiler.py",
>  line 118, in compile_plain
>     result, stdout, stderr = call_capture_output(cmdline, cwd=file_dir, 
> error_on_nonzero=False)
>   File 
> "/Users/ben/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pytools-2013.5.6-py2.7.egg/pytools/prefork.py",
>  line 196, in call_capture_output
>     return forker[0].call_capture_output(cmdline, cwd, error_on_nonzero)
>   File 
> "/Users/ben/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pytools-2013.5.6-py2.7.egg/pytools/prefork.py",
>  line 53, in call_capture_output
>     % ( " ".join(cmdline), e))
> pytools.prefork.ExecError: error invoking 'nvcc --cubin -arch sm_30 -m64 
> -I/Users/ben/MRSI/pycuda 
> -I/Users/ben/Library/Enthought/Canopy_64bit/User/lib/python2.7/site-packages/pycuda-2013.1.1-py2.7-macosx-10.6-x86_64.egg/pycuda/cuda
>  kernel.cu': [Errno 2] No such file or directory
>
> I have no idea why this should be as the identical code file runs fine when I 
> run it from the Terminal (I am on OS X), all the files and directories that I 
> am aware of are in the correct places, nvcc is on the path.
>
> All suggestions or solutions gratefully received.
>
> Thanks in advance,
>
> Ben
> _______________________________________________
> PyCUDA mailing list
> PyCUDA@tiker.net
> http://lists.tiker.net/listinfo/pycuda

_______________________________________________
PyCUDA mailing list
PyCUDA@tiker.net
http://lists.tiker.net/listinfo/pycuda

Reply via email to