-
Notifications
You must be signed in to change notification settings - Fork 9
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
Unable to run the mc.MC() #24
Comments
The error report is strange since the arguments match the required types. Is it possible that there are two pyopencl libraries in the system path and the used pyopencl module is loading the wrong shared library? |
I got the same Err. Example codes can not be run correctly. When run clinfo.info() it returns:
|
I got the same. Have you ever fixed it? |
Yes, I did fix it somehow. In line 198 of the mcbase.py file
self._cl_queue = cl.CommandQueue(
self._cl_context, properties=cl_cq_properties)
change cl_cq_properties=0. I don't know why it works but it works.
…On Wed, 5 Jun, 2024, 9:57 am fire9291, ***@***.***> wrote:
I got the same. Have you ever fixed it?
—
Reply to this email directly, view it on GitHub
<#24 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AQMOHEUOTQUTDQSIBB4L2FLZF2HTHAVCNFSM6AAAAABIT77NCOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBYHAZTAMRRGA>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
It seems that on some platforms the properties argument of the CommandQueue does not take a None value (even though it is documented to allow None or 0 => https://documen.tician.de/pyopencl/runtime_queue.html#pyopencl.CommandQueue). For those who observe the error, a temporary fix is to force 0 instead of None by modifying xopto/mcbase/mcworker.py file: |
It realy works! Thanks a lot. Another question is how can I adjust the ligtht source. I want a focused Guassian Beam with focus in tissue, rather than a collimated one. I believe this can be achieved. Many thanks! |
A true Gaussian beam can be modeled only if the wave nature of light is considered (which the MC method does not). However, there are approximations that one can use. A couple of suggestions:
Note that both suggestions require a new source with custom OpenCL code. In both cases, a good starting point would be the already implemented collimated Gaussian beam source. |
Hello, I still experience the same type-error even after i changed cl_cq_properties = None to cl_cq_properties = 0 when i was trying to run the basic.py file. Anyone still experiences it? |
On some platforms it now seems that neither None nor 0 works. In this case, try to modify xopto/mcbase/mcworker.py by using an empty list instead of None or 0 (a sequence of keys and values should be allowed for OpenCL version >= 2.0): |
I have tried to change and it doesnt seem to work. I have also tried changing the other = None to = [] however, still receive the same error. TypeError: init(): incompatible function arguments. The following argument types are supported: Invoked with types: pyopencl._cl.CommandQueue, pyopencl._cl.Context, kwargs = { properties: NoneType } Not sure whats the reason |
The error report implies that the cl_cq_properties argument (properties) is still set to None (not to 0 or []): Is it possible that there are two pyxopto packages in the python path and you are editing the mcworker.py of the one that is not being used? What is the full error report? Is the error originating from line 195 or line 199 of the mcworker.py module? |
Yes you are right, I found another pyxopto package being used in my venv folder. I edited =None to =[] and it has worked! Thank you |
Hi all, Perhaps the code can be updated initializing |
Traceback (most recent call last):
File "/content/pyxopto-master/examples/mcvox/voxelized_vessel.py", line 134, in
mc_obj = mc.Mc(
File "/usr/local/lib/python3.10/dist-packages/pyxopto-0.2.3-py3.10.egg/xopto/mcvox/mc.py", line 350, in init
super().init(types=types, options=options, cl_devices=cl_devices,
File "/usr/local/lib/python3.10/dist-packages/pyxopto-0.2.3-py3.10.egg/xopto/mcbase/mcworker.py", line 1214, in init
super().init(*args, **kwargs)
File "/usr/local/lib/python3.10/dist-packages/pyxopto-0.2.3-py3.10.egg/xopto/mcbase/mcworker.py", line 198, in init
self._cl_queue = cl.CommandQueue(
TypeError: init(): incompatible function arguments. The following argument types are supported:
1. init(self, context: pyopencl._cl.Context, device: Optional[pyopencl._cl.Device] = None, properties: object = 0) -> None
Invoked with types: pyopencl._cl.CommandQueue, pyopencl._cl.Context, kwargs = { properties: NoneType }
I get this error everytime I run the example codes. Please help !
The text was updated successfully, but these errors were encountered: