Sorry - I solved my own problem.

In the SourceModule class of compiler.py I changed the option parameter from 
options=[] to options=['-m32'].

This tells nvcc to compile 32bit code.

thanks!
Mike


________________________________
From: Mike Tischler <mikethesoils...@yahoo.com>
To: Mike Tischler <mikethesoils...@yahoo.com>; "pycuda@tiker.net" 
<pycuda@tiker.net>
Sent: Tuesday, April 19, 2011 11:03 AM
Subject: Re: [PyCUDA] invalid image - Windows Server 2008 64bit


All,
Unfortunately, I did not solve 100% of my problem.  I'm successfully able to 
import pycuda.autoinit, but when running the example on the pycuda docs page, I 
receive the following error:

pycuda._driver.LogicError: cuModuleLoadDataEx failed: invalid image -
File "C:\Users\mat\Documents\pycuda_test.py", line 12, in <module>
  """)
File 
"c:\Python26\ArcGIS10.0\Lib\site-packages\pycuda-0.94.2-py2.6-win32.egg\pycuda\compiler.py",
 line 241, in __init__
  self.module = module_from_buffer(cubin)

I followed the 4 steps that Andreas suggested in a much earlier post:

1) run `C:\Program Files\Microsoft Visual Studio 9.0\VC\vcvarsall.bat 
x86` to setup the msvc compiler environment before you run your script. 
You might have to adjust the actual path. 2) In case you have a 64 bit Windows 
OS and the CUDA toolkit installed, 
make sure the CUDA environment variables, CUDA_BIN_PATH etc., are set 
for 32 bit. 3) run your script from the same command prompt you used for 1) and 
2), 
not from Eclipse, which might use a different environment. 4) Delete the CUDA 
cache directory. I found this necessary sometimes 
when switching between 32 and 64 bit CUDA.

as well as changing the nvcc.profile "INCLUDES" to 

INCLUDES += "-I$(TOP)/include" "-I$(TOP)/include/cudart" "-IC:/Program Files 
(x86)/Microsoft Visual Studio 9.0/VC/include" $(_SPACE_)

as suggested on the install wiki.

Any further suggestions??

Thanks!
 Mike


________________________________
From: Mike Tischler <mikethesoils...@yahoo.com>
To: "Bergtholdt, Martin" <martin.bergtho...@philips.com>; Andreas Kloeckner 
<li...@informa.tiker.net>; "pycuda@tiker.net" <pycuda@tiker.net>
Sent: Friday, April 15, 2011 5:04 PM
Subject: Re: [PyCUDA] Install - Windows Server 2008 64bit


Martin,
Thanks for your tips - they definitely helped.  I wasn't able to follow your 
exact configuration, but there was enough there to help me through.  Problem 
solved.


For others:
It appears the real issue was in the way the boost libraries were compiled.  I 
believe the flags that Martin used (address-model and architecture) were the 
real key.  I wasn't able to get the included boost to work, so I compiled the 
date_time, python, and thread bits separately. Following some of the 
documentation on the wiki, I downloaded the boost source, opened a command line 
prompt and cd'd to the root directory.  I did 'bootstrap' there, and then 
issued the following commands 


>/bjam python toolset=msvc link=sharedthreading=multi runtime-link=shared 
>architecture=x86 address-model=32 stage

based on Martin's configuration.

first for the python library, then replacing "python" with "date_time", and 
then "thread".  That build the necessary boost libraries.  

Then, I unzipped a fresh pycuda source and opened another command prompt.  


>python configure.py

which creates a siteconf.py file.  Mine looked like (again, modeling Martin's):

BOOST_INC_DIR = ['C:/boost_src/boost_1_46_1']
BOOST_LIB_DIR =
 ['C:/boost_src/boost_1_46_1/stage/lib']
BOOST_COMPILER = 'msvc9'
USE_SHIPPED_BOOST = False
BOOST_PYTHON_LIBNAME =
 ['boost_python-vc90-mt-1_46_1']
BOOST_THREAD_LIBNAME = ['boost_thread-vc90-mt-1_46_1']
CUDA_TRACE = False
CUDA_ENABLE_GL = False
CUDA_ROOT = 'C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v3.2'
CUDADRV_LIB_DIR = ['C:/Program Files/NVIDIA GPU Computing 
Toolkit/CUDA/v3.2/lib/Win32']
CUDADRV_LIBNAME = ['cuda']
CXXFLAGS = ['/EHsc','/DBOOST_ALL_NO_LIB']
LDFLAGS = ['/FORCE']

I had to turn the enable_GL flag off...that was giving me compile errors.

so...now, I have Windows Server 2008 RC2 x64, with 32bit Python 2.5.6, 32bit 
PyCUDA, talking with my Tesla S2050 through a 64bit driver.  




________________________________
From: "Bergtholdt, Martin" <martin.bergtho...@philips.com>
To: Mike Tischler <mikethesoils...@yahoo.com>; Andreas Kloeckner 
<li...@informa.tiker.net>; "pycuda@tiker.net" <pycuda@tiker.net>
Sent: Friday, April 15, 2011 7:35 AM
Subject: RE: [PyCUDA] Install - Windows Server 2008 64bit


 
Hi,
 
I was able to build PyCuda in Windows-7 64bit for 32bit Python with 64bit Cuda 
(which includes 32bit version). This is my siteconfig for Visual Studio 2008:
 
BOOST_INC_DIR = ['D:/Programming/CC/install/vs09x32_shared_release/include']
BOOST_LIB_DIR = ['D:/Programming/CC/install/vs09x32_shared_release/lib']
BOOST_COMPILER = 'msvc9'
USE_SHIPPED_BOOST = False
BOOST_PYTHON_LIBNAME = ['boost_python-mt']
BOOST_THREAD_LIBNAME = ['boost_thread-mt']
CUDA_TRACE = False
CUDA_ROOT = 'C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v3.2'
CUDA_ENABLE_GL = True
CUDADRV_LIB_DIR = ['C:/Program Files/NVIDIA GPU Computing 
Toolkit/CUDA/v3.2/lib/Win32']
CUDADRV_LIBNAME = ['cuda']
CXXFLAGS = ['/EHsc', '/DBOOST_ALL_NO_LIB']
LDFLAGS = []
 
I.e. also using an externally build boost. I have not tried with the internal 
one, since I already had boost compiled this way:
 
Bjam -j7 \
                               --toolset=msvc-9.0 \
                               --layout=system \
                               link=shared \
                               threading=multi \
                               runtime-link=shared \
                               architecture=x86 \
                               address-model=32
 
Good Luck,
 
  Martin
 
From:pycuda-boun...@tiker.net [mailto:pycuda-boun...@tiker.net] On Behalf Of 
Mike Tischler
Sent: 14 April 2011 22:14
To: Andreas Kloeckner; pycuda@tiker.net
Subject: Re: [PyCUDA] Install - Windows Server 2008 64bit
 
Andreas,
I'm also wondering if there is a way to configure 32bit PyCuda in a 32bit 
Python install on a 64bit OS to work with a 64bit CUDA Driver & Toolkit.  That 
would also solve my issue.
 
thanks,
Mike
 

________________________________
 
From:Andreas Kloeckner <li...@informa.tiker.net>
To: Mike Tischler <mikethesoils...@yahoo.com>; "pycuda@tiker.net" 
<pycuda@tiker.net>
Sent: Wednesday, April 13, 2011 7:38 PM
Subject: Re: [PyCUDA] Install - Windows Server 2008 64bit

On Wed, 13 Apr 2011 12:40:59 -0700 (PDT), Mike Tischler 
<mikethesoils...@yahoo.com> wrote:
> Andreas,
> Thanks - I'll try looking into a different debugger.  
> 
> 
> >Any particular reason to not use shipped boost?

> Yes.  I couldn't get it to compile properly.  I tried again by running
> configure.py, setup.py build, setup.py install and receive errors
> about missing files (boost\mpl\aux_\_include_preprocessed something or
> other).  If I compiled boost from source on the machine, I could then
> get pycuda to compile by changing the configuration parameters.

Let me know what files those are. There are some machine-dependent files
in boost, and I might simply be missing the ones needed for
Windows. After a few iterations, we might have a complete set, and then
your problem might be solved.

Andreas



________________________________
 The information contained in this message may be confidential and legally 
protected under applicable law. The message is intended solely for the 
addressee(s). If you are not the intended recipient, you are hereby notified 
that any use, forwarding, dissemination, or reproduction of this message is 
strictly prohibited and may be unlawful. If you are not the intended recipient, 
please contact the sender by return e-mail and destroy all copies of the 
original message.
 


_______________________________________________
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