Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

generated kernels require >48k shared data #2

Closed
grlee77 opened this issue Jun 26, 2015 · 2 comments
Closed

generated kernels require >48k shared data #2

grlee77 opened this issue Jun 26, 2015 · 2 comments

Comments

@grlee77
Copy link

grlee77 commented Jun 26, 2015

After installing boxtree, I tried running the included example (demo.py), and got the following error during compilation of an OpenCL kernel:

Traceback (most recent call last):
  File "/home/lee8rx/anaconda/envs/py34/lib/python3.4/site-packages/pytools-2014.3.5-py3.4.egg/pytools/__init__.py", line 467, in wrapper
    return getattr(self, cache_dict_name)[key]

AttributeError: 'TreeBuilder' object has no attribute '_memoize_dic_get_kernel_info'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "demo.py", line 29, in <module>
    tree, _ = tb(queue, particles, max_particles_in_box=30)
  File "/home/lee8rx/anaconda/envs/py34/lib/python3.4/site-packages/boxtree-2013.1-py3.4.egg/boxtree/tree_build.py", line 170, in __call__
  File "/home/lee8rx/anaconda/envs/py34/lib/python3.4/site-packages/pytools-2014.3.5-py3.4.egg/pytools/__init__.py", line 469, in wrapper
    result = method(self, *args, **kwargs)
  File "/home/lee8rx/anaconda/envs/py34/lib/python3.4/site-packages/boxtree-2013.1-py3.4.egg/boxtree/tree_build.py", line 71, in get_kernel_info
  File "/home/lee8rx/anaconda/envs/py34/lib/python3.4/site-packages/boxtree-2013.1-py3.4.egg/boxtree/tree_build_kernels.py", line 1218, in get_tree_build_kernel_info
  File "/home/lee8rx/anaconda/envs/py34/lib/python3.4/site-packages/pyopencl-2015.1-py3.4-linux-x86_64.egg/pyopencl/scan.py", line 1036, in __init__
    self.finish_setup()
  File "/home/lee8rx/anaconda/envs/py34/lib/python3.4/site-packages/pyopencl-2015.1-py3.4-linux-x86_64.egg/pyopencl/scan.py", line 1125, in finish_setup
    use_bank_conflict_avoidance=use_bank_conflict_avoidance)
  File "/home/lee8rx/anaconda/envs/py34/lib/python3.4/site-packages/pyopencl-2015.1-py3.4-linux-x86_64.egg/pyopencl/scan.py", line 1277, in build_scan_kernel
    prg = cl.Program(self.context, scan_src).build(self.options)
  File "/home/lee8rx/anaconda/envs/py34/lib/python3.4/site-packages/pyopencl-2015.1-py3.4-linux-x86_64.egg/pyopencl/__init__.py", line 218, in build
    options=options, source=self._source)
  File "/home/lee8rx/anaconda/envs/py34/lib/python3.4/site-packages/pyopencl-2015.1-py3.4-linux-x86_64.egg/pyopencl/__init__.py", line 258, in _build_and_catch_errors
    raise err
pyopencl.RuntimeError: clBuildProgram failed: invalid binary - 

Build on <pyopencl.Device 'GeForce GTX 670' on 'NVIDIA CUDA' at 0x132bc80>:

ptxas error   : Entry function 'scan_scan_intervals_lev1' uses too much shared data (0xc0bc bytes, 0xc000 max)

It appears that the kernel requires slightly more than the 48k shared memory limit on my GPU (Nvidia GTX 670). Is there any relatively simple way to help limit the shared memory usage of the kernel in this case? I am not entirely certain whether the error is the fault of boxtree or pyopencl itself, but any feedback on how to avoid the issue would be appreciated.

If I modify the example to run with dims = 3 instead, the kernels do compile and run correctly for that case.

@sethrh
Copy link

sethrh commented Oct 27, 2015

I encountered the same issue (on a GTX 980).

Changing the 256 in pyopencl/scan.py:1255 to a smaller value (128, 192, even 255) corrects the error for me.

I have no idea if that's the right place to correct the problem, but the comment indicates that the value there was a guess.

@inducer
Copy link
Owner

inducer commented Aug 9, 2016

Fixed by inducer/pyopencl@9fdfa92 as far as I can tell. Sorry for the long turn-around time.

@inducer inducer closed this as completed Aug 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants