Hello
If a kernel is called from within a python loop, how frequently is nvcc called?
If the kernel is essentially static, I would hope that nvcc is called once irregardless of
the number of times the loop iterates.
On the other hand, if the kernel is templated, and the template is a function of the loop
counter, it seems to me that nvcc would need to be called on every iteration.
Bob Zigon
bob.zigon(a)gmail.com
317-508-6905 (c)
Bob Zigon <bob.zigon(a)gmail.com> writes:
> Hello
>
> I am using Ubuntu 11.10 with PyCuda 2012.1 and Cuda 5.0 on a K20c.
> I have been developing with Cuda for 6 years and Python for 4 weeks.
>
> I use the pycuda.compiler class to compile my Cuda code in my Python code.
> Is there a way I can see all of the switches that are being passed into the
> compiler?
Not built-in, but it's quite easy to hack in yourself.
Just add "print cmdline" around here:
https://github.com/inducer/pycuda/blob/master/pycuda/compiler.py#L118
(and then say "python setup.py install" as you did when you installed)
You might also need to delete the compiler cache, in /tmp/pycuda*, to
make sure the compiler actually runs.
> I want to know if debug code (instead of release code) is being generated
> by the Cuda compiler.
It shouldn't.
> The pycuda.compiler.DEFAULT_NVCC_FLAGS is always empty.
Right. That's a place for you to hack in flags you'd always like to pass
to the compiler. PyCuda only reads that.
HTH,
Andreas
Hello
I am using Ubuntu 11.10 with PyCuda 2012.1 and Cuda 5.0 on a K20c.
I have been developing with Cuda for 6 years and Python for 4 weeks.
I use the pycuda.compiler class to compile my Cuda code in my Python code.
Is there a way I can see all of the switches that are being passed into the
compiler?
I want to know if debug code (instead of release code) is being generated
by
the Cuda compiler.
The pycuda.compiler.DEFAULT_NVCC_FLAGS is always empty.
Thanks
--Bob
I'm having issues getting pycuda to run properly. I had issues installing,
which I suspect is the root of my issue now. Following these instructions:
http://wiki.tiker.net/PyCuda/Installation/Linux/Ubuntu
I had to remove the last configuration flag --no-use-shipped-boost, because
it said there was no such argument. Also, I'm not using python3, so I
changed all references to python.
Doing that, I got it to install. I can import all of the tools, but when I
try to get to the SourceModule reference in demo.py, I get the following
error:
Traceback (most recent call last):
File "hello_gpu.py", line 14, in <module>
""")
File
"/usr/local/lib/python2.7/dist-packages/pycuda-2013.1-py2.7-linux-x86_64.egg/pycuda/compiler.py",
line 262, in __init__
arch, code, cache_dir, include_dirs)
File
"/usr/local/lib/python2.7/dist-packages/pycuda-2013.1-py2.7-linux-x86_64.egg/pycuda/compiler.py",
line 252, in compile
return compile_plain(source, options, keep, nvcc, cache_dir)
File
"/usr/local/lib/python2.7/dist-packages/pycuda-2013.1-py2.7-linux-x86_64.egg/pycuda/compiler.py",
line 134, in compile_plain
cmdline, stdout=stdout.decode("utf-8"), stderr=stderr.decode("utf-8"))
pycuda.driver.CompileError: nvcc compilation of /tmp/tmpxghGAe/kernel.cu
failed
[command: nvcc --cubin -arch sm_30
-I/usr/local/lib/python2.7/dist-packages/pycuda-2013.1-py2.7-linux-x86_64.egg/pycuda/cuda
kernel.cu]
[stderr:
nvcc fatal : Value 'sm_30' is not defined for option 'gpu-architecture'
]
If I change the shader model to a smaller value, e.g. sm_21, I get the
following error:
>>> mod = SourceModule(
... """
... __global__ void multiply_them(float *dest, float *a, float *b)
... {
... const int i = threadIdx.x;
... dest[i] = a[i] * b[i];
... }
... """,arch="sm_21")
Traceback (most recent call last):
File "<stdin>", line 8, in <module>
File
"/usr/local/lib/python2.7/dist-packages/pycuda-2013.1-py2.7-linux-x86_64.egg/pycuda/compiler.py",
line 265, in __init__
self.module = module_from_buffer(cubin)
pycuda._driver.LogicError: cuModuleLoadDataEx failed: invalid source -
Can someone point me to a resource to fix this?
Thanks.
--
View this message in context: http://pycuda.2962900.n2.nabble.com/PyCuda-Ubuntu-12-04-issues-tp7575064.ht…
Sent from the PyCuda mailing list archive at Nabble.com.
HaveF <iamaplayer(a)gmail.com> writes:
> Use the command:
>
> python setup.py build -c msvc
>
> ...the build system finally use vs...(very strange behavior)
>
> Building....
That sounds like you've solved your problem, correct?
Andreas
Finally, all works now...
Just summarise the tip here:
If your build system have gcc and msvc(say, 2010),
you must be careful about the building system.
You can use
BOOST_COMPILER = 'msvc'
in siteconf.py, but sometimes fail.
At that time, maybe you can try
"python setup.py build -c msvc"
cheers!
Great software~
Great Andreas Klöckner ;-)
On Wed, May 8, 2013 at 9:04 PM, HaveF <iamaplayer(a)gmail.com> wrote:
> Use the command:
>
> python setup.py build -c msvc
>
> ...the build system finally use vs...(very strange behavior)
>
> Building....
>
>
>
>
> On Wed, May 8, 2013 at 8:57 PM, HaveF <iamaplayer(a)gmail.com> wrote:
>
>> Sorry to bother again...
>> I still can't solve the problem...
>> I remember(a month before) I used
>>
>> set VS90COMNTOOLS=%VS100COMNTOOLS%
>>
>> and then
>> python setup.py build
>> all things would be done...
>>
>> But today I can't find the way to out...
>>
>> In the cmd of VS2010, I see the bin path of VS2010 is on the top...like:
>> Path=C:\Prog\vs2010\VC\BIN\amd64;...
>> But the build system want gcc always...;-(
>> log:
>> ...
>> running build_ext
>> building '_driver' extension
>> ...
>> C:\Anaconda\Scripts\gcc.bat -DMS_WIN64 -mdll -O -Wall
>> -DBOOST_PYTHON_SOURCE....
>> ...
>>
>>
>>
>>
>> On Wed, May 8, 2013 at 5:12 PM, HaveF <iamaplayer(a)gmail.com> wrote:
>>
>>> Hi, all,
>>>
>>> I install Anaconda(with gcc) recently, and also have VS2010 before.
>>> Today, when I build pycuda from VS2010 command line, using:
>>>
>>> python setup.py build
>>>
>>> from the cmd, I see some error related with gcc,
>>> but I want to build pycuda with vs2010, I change the siteconf.py
>>>
>>> BOOST_COMPILER = 'msvc'
>>>
>>> but, the building process still use gcc...
>>>
>>>
>>>
>>>
>>> --
>>> --
>>> Sincerely,
>>>
>>> HaveF
>>>
>>
>>
>>
>> --
>> --
>> Sincerely,
>>
>> HaveF
>>
>
>
>
> --
> --
> Sincerely,
>
> HaveF
>
--
--
Sincerely,
HaveF
Use the command:
python setup.py build -c msvc
...the build system finally use vs...(very strange behavior)
Building....
On Wed, May 8, 2013 at 8:57 PM, HaveF <iamaplayer(a)gmail.com> wrote:
> Sorry to bother again...
> I still can't solve the problem...
> I remember(a month before) I used
>
> set VS90COMNTOOLS=%VS100COMNTOOLS%
>
> and then
> python setup.py build
> all things would be done...
>
> But today I can't find the way to out...
>
> In the cmd of VS2010, I see the bin path of VS2010 is on the top...like:
> Path=C:\Prog\vs2010\VC\BIN\amd64;...
> But the build system want gcc always...;-(
> log:
> ...
> running build_ext
> building '_driver' extension
> ...
> C:\Anaconda\Scripts\gcc.bat -DMS_WIN64 -mdll -O -Wall
> -DBOOST_PYTHON_SOURCE....
> ...
>
>
>
>
> On Wed, May 8, 2013 at 5:12 PM, HaveF <iamaplayer(a)gmail.com> wrote:
>
>> Hi, all,
>>
>> I install Anaconda(with gcc) recently, and also have VS2010 before.
>> Today, when I build pycuda from VS2010 command line, using:
>>
>> python setup.py build
>>
>> from the cmd, I see some error related with gcc,
>> but I want to build pycuda with vs2010, I change the siteconf.py
>>
>> BOOST_COMPILER = 'msvc'
>>
>> but, the building process still use gcc...
>>
>>
>>
>>
>> --
>> --
>> Sincerely,
>>
>> HaveF
>>
>
>
>
> --
> --
> Sincerely,
>
> HaveF
>
--
--
Sincerely,
HaveF
Sorry to bother again...
I still can't solve the problem...
I remember(a month before) I used
set VS90COMNTOOLS=%VS100COMNTOOLS%
and then
python setup.py build
all things would be done...
But today I can't find the way to out...
In the cmd of VS2010, I see the bin path of VS2010 is on the top...like:
Path=C:\Prog\vs2010\VC\BIN\amd64;...
But the build system want gcc always...;-(
log:
...
running build_ext
building '_driver' extension
...
C:\Anaconda\Scripts\gcc.bat -DMS_WIN64 -mdll -O -Wall
-DBOOST_PYTHON_SOURCE....
...
On Wed, May 8, 2013 at 5:12 PM, HaveF <iamaplayer(a)gmail.com> wrote:
> Hi, all,
>
> I install Anaconda(with gcc) recently, and also have VS2010 before.
> Today, when I build pycuda from VS2010 command line, using:
>
> python setup.py build
>
> from the cmd, I see some error related with gcc,
> but I want to build pycuda with vs2010, I change the siteconf.py
>
> BOOST_COMPILER = 'msvc'
>
> but, the building process still use gcc...
>
>
>
>
> --
> --
> Sincerely,
>
> HaveF
>
--
--
Sincerely,
HaveF
Hi, all,
I install Anaconda(with gcc) recently, and also have VS2010 before.
Today, when I build pycuda from VS2010 command line, using:
python setup.py build
from the cmd, I see some error related with gcc,
but I want to build pycuda with vs2010, I change the siteconf.py
BOOST_COMPILER = 'msvc'
but, the building process still use gcc...
--
--
Sincerely,
HaveF