Closed MaxThevenet closed 2 years ago
Hi @MaxThevenet ! Thank you for your interest in syanchrad. This tool is in often use and far-field mapper works well, though I admit the documentation is not in its best shape.
The error you get, mean a problem with openCL context, more specifically it says that selected device (gpu or cpu) in not initialized with a queue. In order to debug this I'll need to know what configuration you use -- is it CPU (pocl or AMD or Intel platforms) or GPU (Nvidia or AMD)?
You can comment/remove the calc_input
argument
'ctx':[1,]
of the example (its machine specific) and when you run the constructor
calc = SynchRad(calc_input)
it will give you interactive choice of the device. You can also check the available context options by running opencl-print-info.py
.
Thanks for your quick reply! I am running on a 2,3 GHz 8-Core Intel Core i9, removing the ctx
argument returns
Running on 1 devices
Starting without device:
Platform: None
Compiler: None
and opencl-print-info.py
gives
% python ./example/opencl-print-info.py
PyOpenCL version: 2021.2.8
OpenCL header version: 3.0
- Installed platforms (SDKs) and available devices:
Traceback (most recent call last):
File "/Users/maxence/synchrad/./example/opencl-print-info.py", line 26, in <module>
platforms = cl.get_platforms()
pyopencl._cl.LogicError: clGetPlatformIDs failed: PLATFORM_NOT_FOUND_KHR
so I believe I have problems with my openCL installation. Thanks!
Wow, after a conda uninstall pyopencl
and pip install pyopencl
I could see my 3 processing units (Intel CPU, Intel GPU, AMD GPU) and successfully execute the notebook on the AMD Radeon GPU. That was super smooth, thanks!
yes, you need to verify of you have a proper installation of openCL and pyopencl. For CPUs the simplest choice is pocl
which you can get from conda-forge. After installation check it pyopencl can see it, e.g. run following lines
import pyopencl
pyopencl.create_some_context()
In case of a problem one frequent issue is that
Depending on how it is installed, pyopencl
may be looking for pocl.icd
file either in system-global /etc/OpenCL/vendors/
or in python folders, e.g. miniconda/etc/OpenCL/vendors/
or mambaforge/etc/OpenCL/vendors/
. If its a personal machine you can put this file at all paths, just to be sure =)
BTW: this implementation if not very efficient on CPUs and I mainly use with GPUs. A more performant Fortran implementation for CPUs can be found in chimera code, along with more examples
Great, you've solved issues faster than i've written the response =)
Let me know if you are going to use the tool -- there are some utilities which are very useful in working with simulation results but they are not very documented.. You can see them by punching Tab for after-completion after calc.
. It's also useful to save completed simulation to a file calc.calculate_spectrum(file_spectrum='./spectrum.h5')
and after you'll be able to load it by pass as an argument to calc = SynchRad(file_spectrum='./spectrum.h5')
instead of the calc_input
dict
Hi! Is this repo still maintained? I could successfully install SynchRad, but I got the following error in cell 7 of the notebook (all previous cells executed successfully):
Please let me know if there is another tool that you use preferably. Thanks!