[PyCUDA] gpuarray.zeros / to_gpu crash

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[PyCUDA] gpuarray.zeros / to_gpu crash

Guralnik,Dan

Hello,


I have just installed pycuda on a new machine running anaconda3 and cuda 10.1.243_426 for Windows 10, and tested the installation by running a program that had been run successfully on another machine, but with anaconda2.


My program breaks on a call for gpuarray.zeros, following a call to gpuarray.to_gpu (no other calls to pycuda have been made before that). Both calls are trying to establish 2D arrays of dtype=np.float32.


The included headers are:


import pycuda.driver as cuda
import pycuda.tools
import pycuda.autoinit
import pycuda.gpuarray as gpuarray
from pycuda.compiler import SourceModule

I've attached the error trace from python below. I'll be grateful if you could offer an explanation/fix.

Many thanks,
-Dan




C:\Users\danguralnik\Documents\GitHub\kodlab-uma-sims\mice\smooth>python mouse_base.py
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\site-packages\pycuda\tools.py", line 428, in context_dependent_memoize
    return ctx_dict[cur_ctx][args]
KeyError: <pycuda._driver.Context object at 0x000001A0CCE991B0>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "mouse_base.py", line 832, in <module>
    main()
  File "mouse_base.py", line 812, in main
    random_state=RS(),
  File "mouse_base.py", line 587, in __init__
    self.addRepn('global_view',Repn_global_arena_wmouse(self))
  File "mouse_base.py", line 641, in __init__
    gpuarray.zeros(shape=(self.ysize,self.xsize),dtype=np.float32)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pycuda\gpuarray.py", line 1068, in zeros
    result.fill(zero)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pycuda\gpuarray.py", line 549, in fill
    func = elementwise.get_fill_kernel(self.dtype)
  File "<C:\ProgramData\Anaconda3\lib\site-packages\decorator.py:decorator-gen-13>", line 2, in get_fill_kernel
  File "C:\ProgramData\Anaconda3\lib\site-packages\pycuda\tools.py", line 432, in context_dependent_memoize
    result = func(*args)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pycuda\elementwise.py", line 496, in get_fill_kernel
    "fill")
  File "C:\ProgramData\Anaconda3\lib\site-packages\pycuda\elementwise.py", line 161, in get_elwise_kernel
    arguments, operation, name, keep, options, **kwargs)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pycuda\elementwise.py", line 147, in get_elwise_kernel_and_types
    keep, options, **kwargs)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pycuda\elementwise.py", line 75, in get_elwise_module
    options=options, keep=keep)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pycuda\compiler.py", line 291, in __init__
    arch, code, cache_dir, include_dirs)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pycuda\compiler.py", line 254, in compile
    return compile_plain(source, options, keep, nvcc, cache_dir, target)
  File "C:\ProgramData\Anaconda3\lib\site-packages\pycuda\compiler.py", line 78, in compile_plain
    checksum.update(preprocess_source(source, options, nvcc).encode("utf-8"))
  File "C:\ProgramData\Anaconda3\lib\site-packages\pycuda\compiler.py", line 55, in preprocess_source
    cmdline, stderr=stderr)
pycuda.driver.CompileError: nvcc preprocessing of C:\Users\DANGUR~1\AppData\Local\Temp\tmphnd7bq1w.cu failed
[command: nvcc --preprocess -arch sm_75 -m64 -Ic:\programdata\anaconda3\lib\site-packages\pycuda\cuda C:\Users\DANGUR~1\AppData\Local\Temp\tmphnd7bq1w.cu --compiler-options -EP]




_______________________________________________
PyCUDA mailing list -- [hidden email]
To unsubscribe send an email to [hidden email]
Reply | Threaded
Open this post in threaded view
|

[PyCUDA] Re: gpuarray.zeros / to_gpu crash

Andreas Kloeckner
Dan,

Do the PyCUDA example programs (e.g. [1]) work? What happens if you run
the command 'nvcc'?

Andreas

[1] https://github.com/inducer/pycuda/blob/master/examples/demo.py

"Guralnik,Dan" <[hidden email]> writes:

> Hello,
>
>
> I have just installed pycuda on a new machine running anaconda3 and cuda 10.1.243_426 for Windows 10, and tested the installation by running a program that had been run successfully on another machine, but with anaconda2.
>
>
> My program breaks on a call for gpuarray.zeros, following a call to gpuarray.to_gpu (no other calls to pycuda have been made before that). Both calls are trying to establish 2D arrays of dtype=np.float32.
>
>
> The included headers are:
>
> import pycuda.driver as cuda
> import pycuda.tools
> import pycuda.autoinit
> import pycuda.gpuarray as gpuarray
> from pycuda.compiler import SourceModule
>
> I've attached the error trace from python below. I'll be grateful if you could offer an explanation/fix.
>
> Many thanks,
> -Dan
>
>
>
>
> C:\Users\danguralnik\Documents\GitHub\kodlab-uma-sims\mice\smooth>python mouse_base.py
> Traceback (most recent call last):
>   File "C:\ProgramData\Anaconda3\lib\site-packages\pycuda\tools.py", line 428, in context_dependent_memoize
>     return ctx_dict[cur_ctx][args]
> KeyError: <pycuda._driver.Context object at 0x000001A0CCE991B0>
>
> During handling of the above exception, another exception occurred:
>
> Traceback (most recent call last):
>   File "mouse_base.py", line 832, in <module>
>     main()
>   File "mouse_base.py", line 812, in main
>     random_state=RS(),
>   File "mouse_base.py", line 587, in __init__
>     self.addRepn('global_view',Repn_global_arena_wmouse(self))
>   File "mouse_base.py", line 641, in __init__
>     gpuarray.zeros(shape=(self.ysize,self.xsize),dtype=np.float32)
>   File "C:\ProgramData\Anaconda3\lib\site-packages\pycuda\gpuarray.py", line 1068, in zeros
>     result.fill(zero)
>   File "C:\ProgramData\Anaconda3\lib\site-packages\pycuda\gpuarray.py", line 549, in fill
>     func = elementwise.get_fill_kernel(self.dtype)
>   File "<C:\ProgramData\Anaconda3\lib\site-packages\decorator.py:decorator-gen-13>", line 2, in get_fill_kernel
>   File "C:\ProgramData\Anaconda3\lib\site-packages\pycuda\tools.py", line 432, in context_dependent_memoize
>     result = func(*args)
>   File "C:\ProgramData\Anaconda3\lib\site-packages\pycuda\elementwise.py", line 496, in get_fill_kernel
>     "fill")
>   File "C:\ProgramData\Anaconda3\lib\site-packages\pycuda\elementwise.py", line 161, in get_elwise_kernel
>     arguments, operation, name, keep, options, **kwargs)
>   File "C:\ProgramData\Anaconda3\lib\site-packages\pycuda\elementwise.py", line 147, in get_elwise_kernel_and_types
>     keep, options, **kwargs)
>   File "C:\ProgramData\Anaconda3\lib\site-packages\pycuda\elementwise.py", line 75, in get_elwise_module
>     options=options, keep=keep)
>   File "C:\ProgramData\Anaconda3\lib\site-packages\pycuda\compiler.py", line 291, in __init__
>     arch, code, cache_dir, include_dirs)
>   File "C:\ProgramData\Anaconda3\lib\site-packages\pycuda\compiler.py", line 254, in compile
>     return compile_plain(source, options, keep, nvcc, cache_dir, target)
>   File "C:\ProgramData\Anaconda3\lib\site-packages\pycuda\compiler.py", line 78, in compile_plain
>     checksum.update(preprocess_source(source, options, nvcc).encode("utf-8"))
>   File "C:\ProgramData\Anaconda3\lib\site-packages\pycuda\compiler.py", line 55, in preprocess_source
>     cmdline, stderr=stderr)
> pycuda.driver.CompileError: nvcc preprocessing of C:\Users\DANGUR~1\AppData\Local\Temp\tmphnd7bq1w.cu failed
> [command: nvcc --preprocess -arch sm_75 -m64 -Ic:\programdata\anaconda3\lib\site-packages\pycuda\cuda C:\Users\DANGUR~1\AppData\Local\Temp\tmphnd7bq1w.cu --compiler-options -EP]
>
>
>
> _______________________________________________
> PyCUDA mailing list -- [hidden email]
> To unsubscribe send an email to [hidden email]

_______________________________________________
PyCUDA mailing list -- [hidden email]
To unsubscribe send an email to [hidden email]

signature.asc (847 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

[PyCUDA] Re: gpuarray.zeros / to_gpu crash

Andreas Kloeckner
Dan,

Please make sure the list stays cc'd for archival.

"Guralnik,Dan" <[hidden email]> writes:

> Andreas, I'm so sorry, should've done it myself so you have more info. Here is what happens:
>
> ---------------------
> C:\Users\danguralnik\Documents\GitHub\kodlab-uma-sims\mice\smooth>python cuda_test.py
> Traceback (most recent call last):
>   File "cuda_test.py", line 23, in <module>
>     """)
>   File "C:\ProgramData\Anaconda3\lib\site-packages\pycuda\compiler.py", line 291, in __init__
>     arch, code, cache_dir, include_dirs)
>   File "C:\ProgramData\Anaconda3\lib\site-packages\pycuda\compiler.py", line 254, in compile
>     return compile_plain(source, options, keep, nvcc, cache_dir, target)
>   File "C:\ProgramData\Anaconda3\lib\site-packages\pycuda\compiler.py", line 137, in compile_plain
>     stderr=stderr.decode("utf-8", "replace"))
> pycuda.driver.CompileError: nvcc compilation of C:\Users\DANGUR~1\AppData\Local\Temp\tmppoj82k3c\kernel.cu failed
> [command: nvcc --cubin -arch sm_75 -m64 -Ic:\programdata\anaconda3\lib\site-packages\pycuda\cuda kernel.cu]
> [stdout:
> nvcc fatal   : Cannot find compiler 'cl.exe' in PATH
> ]
> ------------------------
> Is this something about environment variables?
Yes. The Visual Studio compilers also need to be on your PATH
environment variable. VS installs a batch file vcvars.bat that should
arrange for that.

Andreas


_______________________________________________
PyCUDA mailing list -- [hidden email]
To unsubscribe send an email to [hidden email]

signature.asc (847 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

[PyCUDA] Re: gpuarray.zeros / to_gpu crash

Guralnik,Dan
Thank you, Andreas. Your suggestion worked, but with a tweak: had to use
one of the architecture-specific versions of vcvars (vcvars64.bat) in my
case. Another alternative (for VS 2019) turned out to be running under
one of the VS-provided developer command prompts: they load their own
batch of environment vars.

Best,

-Dan

On 11/16/2019 12:23 AM, Andreas Kloeckner wrote:

> Dan,
>
> Please make sure the list stays cc'd for archival.
>
> "Guralnik,Dan" <[hidden email]> writes:
>> Andreas, I'm so sorry, should've done it myself so you have more info. Here is what happens:
>>
>> ---------------------
>> C:\Users\danguralnik\Documents\GitHub\kodlab-uma-sims\mice\smooth>python cuda_test.py
>> Traceback (most recent call last):
>>    File "cuda_test.py", line 23, in <module>
>>      """)
>>    File "C:\ProgramData\Anaconda3\lib\site-packages\pycuda\compiler.py", line 291, in __init__
>>      arch, code, cache_dir, include_dirs)
>>    File "C:\ProgramData\Anaconda3\lib\site-packages\pycuda\compiler.py", line 254, in compile
>>      return compile_plain(source, options, keep, nvcc, cache_dir, target)
>>    File "C:\ProgramData\Anaconda3\lib\site-packages\pycuda\compiler.py", line 137, in compile_plain
>>      stderr=stderr.decode("utf-8", "replace"))
>> pycuda.driver.CompileError: nvcc compilation of C:\Users\DANGUR~1\AppData\Local\Temp\tmppoj82k3c\kernel.cu failed
>> [command: nvcc --cubin -arch sm_75 -m64 -Ic:\programdata\anaconda3\lib\site-packages\pycuda\cuda kernel.cu]
>> [stdout:
>> nvcc fatal   : Cannot find compiler 'cl.exe' in PATH
>> ]
>> ------------------------
>> Is this something about environment variables?
> Yes. The Visual Studio compilers also need to be on your PATH
> environment variable. VS installs a batch file vcvars.bat that should
> arrange for that.
>
> Andreas
>
_______________________________________________
PyCUDA mailing list -- [hidden email]
To unsubscribe send an email to [hidden email]