Ok,
the error from the previous message is because, on line 249, the argument of
glutCreateWindow has to be b"PyCuda GL Interop Example" (notice the b before the
") instead of "PyCuda GL Interop Example". After that, there was an issue
related to the cl.exe and nvcc.exe compilers for MSVC and Nvidia not being in the system
path. Once all that was corrected, I was able to see the teapot spin around with not
response to the keys "a" and "e". I am assuming CUDA is working
because the speed of the output matches that of the MSVC interop .exe file. Still, in the
console where I ran the example, I got:
Hit ESC key to quit, 'a' to toggle animation, and 'e' to toggle cudaUnable
to load numpy_formathandler accelerator from OpenGL_acceleratepycuda-opengl-interop.py:41:
DeprecationWarning: buffer_object has been deprecated since CUDA 3.0 and PyCUDA 2011.1.
pycuda_source_pbo = cuda_gl.BufferObject(long(source_pbo))pycuda-opengl-interop.py:46:
DeprecationWarning: buffer_object has been deprecated since CUDA 3.0 and PyCUDA 2011.1.
pycuda_dest_pbo = cuda_gl.BufferObject(long(dest_pbo))pycuda-opengl-interop.py:100:
DeprecationWarning: time.clock has been deprecated in Python 3.3 and will be removed from
Python 3.8: use time.perf_counter or time.process_time instead if ((time.clock () *
1000.0) - time_of_last_titleupdate >= 1000.):pycuda-opengl-interop.py:105:
DeprecationWarning: time.clock has been deprecated in Python 3.3 and will be removed from
Python 3.8: use time.perf_counter or time.process_time instead time_of_last_titleupdate =
time.clock () * 1000.0pycuda-opengl-interop.py:184: DeprecationWarning: buffer_object has
been deprecated since CUDA 3.0 and PyCUDA 2011.1. pycuda_source_pbo =
cuda_gl.BufferObject(long(source_pbo))pycuda-opengl-interop.py:150: DeprecationWarning:
map_buffer_object has been deprecated since CUDA 3.0 and PyCUDA 2011.1. source_mapping =
pycuda_source_pbo.map()pycuda-opengl-interop.py:150: DeprecationWarning:
buffer_object_mapping has been deprecated since CUDA 3.0 and PyCUDA 2011.1.
source_mapping = pycuda_source_pbo.map()pycuda-opengl-interop.py:151: DeprecationWarning:
map_buffer_object has been deprecated since CUDA 3.0 and PyCUDA 2011.1. dest_mapping =
pycuda_dest_pbo.map()pycuda-opengl-interop.py:151: DeprecationWarning:
buffer_object_mapping has been deprecated since CUDA 3.0 and PyCUDA 2011.1. dest_mapping
= pycuda_dest_pbo.map()
More due diligence, but I can now focus solely on the Python code.
Hope this helps others with the same issue.
Thanks, Andreas, again for the critical pointers to get me to move along with this
project.Fabio. On Sunday, March 1, 2020, 04:29:05 PM MST, Fabio da Silva
<fcsds(a)yahoo.com> wrote:
Ok, I got it to work. Basically, the new build resides in a subfolder
named:build\lib.win-amd64-3.7
I then copied the pycuda folder and placed in my Miniconda lib
folder:Miniconda3\Lib\site-packages
I had to rename the current pycuda folder with pycuda.old to make sure I could revert.
When I do import pycuda.gl, it works. So I went ahead and downloaded the interoperability
example fromPyCuda/Examples/GlInterop - Andreas Klöckner's wiki
and ran it! There were some print usage that followed the Python 2.7 format that I
converted to Python 3.7 by putting the argument in parenthesis. I reran and the output
was:
Hit ESC key to quit, 'a' to toggle animation, and 'e' to toggle
cudaTraceback (most recent call last): File "pycuda-opengl-interop.py", line
292, in <module> main() File "pycuda-opengl-interop.py", line 249, in
main window = glutCreateWindow("PyCuda GL Interop Example") File
"C:\Users\fcss\Miniconda3\lib\site-packages\OpenGL\GLUT\special.py", line 73, in
glutCreateWindow return __glutCreateWindowWithExit(title,
_exitfunc)ctypes.ArgumentError: argument 1: <class 'TypeError'>: wrong type
I think this output may belong to another list (I haven't done my due diligence yet),
but if anyone knows about it and want to help, it will always be appreciated.
Cordially,Fabio.
On Tuesday, February 25, 2020, 11:33:55 AM MST, Andreas Kloeckner
<lists(a)informa.tiker.net> wrote:
Fabio da Silva <fcsds(a)yahoo.com> writes:
Good morning,
I was wondering if there are any binaries for OpenGL enabled PyCUDA
for Windows 10. My understanding (thanks, Andreas) is that it I will
probably need to build it on my own. Since I never did that, I went
online and found some resources here
(
https://stackoverflow.com/questions/19634073/pip-install-pycuda-on-windows)
with the source code from here
(
https://files.pythonhosted.org/packages/5e/3f/5658c38579b41866ba21ee1b5020b…).
Specifically:1. Downloaded
the source code from pythonhosted and untarred it.2. On the main
folder I ran:>> python configure.py3. Then I went to siteconf.py and
enabled OpenGL on line 9:CUDA_ENABLE_GL = True4. Finally I ran the
commands:>> python setup.py build>> python setup.py install
After that, I tried to open PyCUDA in an IPython
window and
got:ModuleNotFoudError: No module named 'pycuda._driver'And obviously
no pycuda.gl either.
If your build from above completed, then you should have PyCUDA
installed *somewhere*. This somewhere may just not be the same Python
interpreter as what your Jupyter notebook uses. You can find out where
these interpreters live by examining sys.path (from both the notebook
and the Python prompt for the Python that you used to build/install)
HTH,
Andreas_______________________________________________
PyCUDA mailing list -- pycuda(a)tiker.net
To unsubscribe send an email to pycuda-leave(a)tiker.net