Hello,
the ATI drivers don't have a problem with it, but the code of the
previous mail
was tested on python 3.2, 32-bit (windows 7).
It doesn't work on python 2.7, 64-bit (windows 7). On that platform
GetShortPathNameW() always returns 0-sized strings.
Although the changes are not big, I don't have a universal solution.
I'll see about filing a bug-report with Nvidia. Until then, if someone
runs into
a similar problem, the following change makes it work on python 2.7:
if exists(inc_path):
if sys.platform.count('win') > 0:
import ctypes
buf = '\0'*256 # for python 3.x change to :
bytes(256,'ascii')
n=ctypes.windll.kernel32.GetShortPathNameA( inc_path,
buf, 256 )
inc_path = buf[:n]
return inc_path
With regards,
Thijs
Op 20-12-2011 19:26, Andreas Kloeckner schreef:
On Tue, 20 Dec 2011 18:04:16 +0100, Thijs Withaar<[email protected]> wrote:
Hi all,
To keep my directory folder clean, I installed python into
C:\Program Files (x86)\python.
It turns out that the Nvidia openCL runtimes do not really like
paths with spaces, even if properly enqouted. Since pyOpenCL
adds it's own path as include, this goes wrong in my case.
A workaround is to modify pyopencl/__init__.py such that
_find_pyopencl_include_path() reads:
for inc_path in possible_include_paths:
if exists(inc_path):
if sys.platform.count('win')> 0:
import ctypes
buf = bytes(256,'ascii')
ctypes.windll.kernel32.GetShortPathNameW( inc_path, buf,
256 )
inc_path = buf.decode('utf-16')
return inc_path
I know it's a nasty hack, but it's the only way I got it working.
Does anyone have some suggestions on how to improve this?
Can you please try if this breaks Intel/AMD OpenCL on Windows? If not,
I'd be ok with bringing it into git.
Andreas
_______________________________________________
PyOpenCL mailing list
[email protected]
http://lists.tiker.net/listinfo/pyopencl