Open ghost opened 8 years ago
In pycuda_handler, can we do a check to see if int32_t is defined, and, if not, add this code to one of the kernel(s):
typedef int int32_t;
?
Figured out where the int32_t's are originating: the misc module in scikit-cuda, lines 822-3. As a quick hack I changed those to ints, and now this works. Note sure if anything can be done within brainstorm to account for this. Probably not. Needless to say, I don't like having to hack another module to get this working...Windows users (which this problem will most likely affect) might have to make some changes to their CUDA setup so that int32_t is defined?
scikit-cuda.misc appears to use int
in other kernels, but int32_t
in
this kernel. Perhaps this can be changed in scikit-cuda so that future
versions will not have this problem. I'm sure they would like improved
Windows compatibility. Perhaps you would like to submit a PR to them on
Github?
On 21 November 2015 at 23:02, Brian Thomas notifications@github.com wrote:
Figured out where the int32_t's are originating: the misc module in scikit-cuda, lines 822-3. As a quick hack I changed those to ints, and now this works. Note sure if anything can be done within brainstorm to account for this. Probably not. Needless to say, I don't like having to hack another module to get this working...Windows users (which this problem will most likely affect) might have to make some changes to their CUDA setup so that int32_t is defined?
— Reply to this email directly or view it on GitHub https://github.com/IDSIA/brainstorm/issues/100#issuecomment-158685223.
I will do so. Thanks
On Windows 10 64-bit; PyCUDA 2015.1.3; CUDA 7.5 machine:
When calling PyCudaHandler while running CIFAR-10 example (examples/cifar10_cnn.py) line 64, the following error occurs:
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "C:\Anaconda3\lib\site-packages\brainstorm-0.5b1-py3.4-win-amd64.egg\brainstorm\training\trainer.py", line 162, in _call_hook stepper=self.stepper, logs=self.logs), False File "C:\Anaconda3\lib\site-packages\brainstorm-0.5b1-py3.4-win-amd64.egg\brainstorm\hooks.py", line 422, in call return evaluate(net, self.iter, self.scorers) File "C:\Anaconda3\lib\site-packages\brainstorm-0.5b1-py3.4-win-amd64.egg\brainstorm\tools.py", line 77, in evaluate network.forward_pass() File "C:\Anaconda3\lib\site-packages\brainstorm-0.5b1-py3.4-win-amd64.egg\brainstorm\structure\network.py", line 431, in forward_pass layer.forward_pass(self.buffer[layer_name], training_pass) File "C:\Anaconda3\lib\site-packages\brainstorm-0.5b1-py3.4-win-amd64.egg\brainstorm\layers\convolution_layer_2d.py", line 89, in forward_pass self.padding, self.stride) File "C:\Anaconda3\lib\site-packages\brainstorm-0.5b1-py3.4-win-amd64.egg\brainstorm\handlers\pycuda_handler.py", line 256, in conv2d_forward_batch self.add_mv(flat_outputs, bias, flat_outputs) File "C:\Anaconda3\lib\site-packages\brainstorm-0.5b1-py3.4-win-amd64.egg\brainstorm\handlers\pycuda_handler.py", line 124, in add_mv cumisc.add_matvec(m, v, out=out) File "C:\Anaconda3\lib\site-packages\skcuda\misc.py", line 1114, in add_matvec return binaryop_matvec('+', x_gpu, a_gpu, axis, out, stream) File "C:\Anaconda3\lib\site-packages\skcuda\misc.py", line 921, in binaryop_matvec row_kernel, col_kernel = _get_binaryop_vecmat_kernel(x_gpu.dtype, binary_op) File "", line 2, in _get_binaryop_vecmat_kernel
File "C:\Anaconda3\lib\site-packages\pycuda\tools.py", line 430, in context_dependent_memoize
result = func(*args)
File "C:\Anaconda3\lib\site-packages\skcuda\misc.py", line 860, in _get_binaryop_vecmat_kernel
mod = SourceModule(tmpl)
File "C:\Anaconda3\lib\site-packages\pycuda\compiler.py", line 259, in init
arch, code, cache_dir, include_dirs)
File "C:\Anaconda3\lib\site-packages\pycuda\compiler.py", line 249, in compile
return compile_plain(source, options, keep, nvcc, cache_dir, target)
File "C:\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\Brian\AppData\Local\Temp\tmpshxtpail\kernel.cu failed
[command: nvcc --cubin -arch sm_50 -m64 -Ic:\anaconda3\lib\site-packages\pycuda\cuda kernel.cu]
[stdout:
kernel.cu
]
[stderr:
kernel.cu(6): error: identifier "int32_t" is undefined
kernel.cu(6): error: identifier "int32_t" is undefined
2 errors detected in the compilation of "C:/Users/Brian/AppData/Local/Temp/tmpxft_000010a8_00000000-8_kernel.cpp1.ii". ]
An error occurred while calling the "validation" hook:
KeyError Traceback (most recent call last) C:\Anaconda3\lib\site-packages\pycuda\tools.py in context_dependent_memoize(func, *args) 425 try: --> 426 return ctx_dict[cur_ctx][args] 427 except KeyError:
KeyError: <pycuda._driver.Context object at 0x000000001BE82208>
During handling of the above exception, another exception occurred:
CompileError Traceback (most recent call last)