PyOpenCL doesn't work

PyOpenCL doesn’t work:

(base) [pepe@pepe-83dr subdivision_opencl]$ python3 main.py
0 - chaotic
1 - rossler
2 - lorenz
3 - aizawa
4 - halvorsen
system = 0
Traceback (most recent call last):
File “/home/pepe/Code/subdivision_opencl/main.py”, line 64, in
ctx = cl.create_some_context()
^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/pepe/anaconda3/lib/python3.12/site-packages/pyopencl/init.py”, line 1699, in create_some_context
devices = choose_devices(interactive, answers)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “/home/pepe/anaconda3/lib/python3.12/site-packages/pyopencl/init.py”, line 1600, in choose_devices
platforms = get_platforms()
^^^^^^^^^^^^^^^
pyopencl._cl.LogicError: clGetPlatformIDs failed: PLATFORM_NOT_FOUND_KHR

clinfo -l

(base) [pepe@pepe-83dr subdivision_opencl]$ clinfo -l
Platform #0: AMD Accelerated Parallel Processing
-- Device #0: gfx1103 Platform #1: Clover – Device #0: AMD Radeon Graphics (radeonsi, gfx1103_r1, LLVM 18.1.8, DRM 3.57, 6.10.13-3-MANJARO)
Platform #2: Portable Computing Language
`-- Device #0: cpu-skylake-avx512-AMD Ryzen 7 8845HS w/ Radeon 780M Graphics

what’s up with that?

Also,

(base) [pepe@pepe-83dr cpp_opencl]$ sudo pacman -S opencl-headers
[sudo] password for pepe:
warning: opencl-headers-2:2024.05.08-1 is up to date – reinstalling
resolving dependencies…
looking for conflicting packages…

Packages (1) opencl-headers-2:2024.05.08-1

Total Installed Size: 0.38 MiB
Net Upgrade Size: 0.00 MiB

:: Proceed with installation? [Y/n] Y
(1/1) checking keys in keyring [################################] 100%
(1/1) checking package integrity [################################] 100%
(1/1) loading package files [################################] 100%
(1/1) checking for file conflicts [################################] 100%
(1/1) checking available disk space [################################] 100%
:: Running pre-transaction hooks…
(1/1) Creating Timeshift snapshot before upgrade…
==> skipping timeshift-autosnap due skipRsyncAutosnap in /etc/timeshift-autosnap.conf set to TRUE.
:: Processing package changes…
(1/1) reinstalling opencl-headers [################################] 100%
:: Running post-transaction hooks…
(1/1) Arming ConditionNeedsUpdate…
(base) [pepe@pepe-83dr cpp_opencl]$ g++ main.cpp -o main
main.cpp:2:10: fatal error: CL/cl.hpp: No such file or directory
2 | #include <CL/cl.hpp>
| ^~~~~~~~~~~
compilation terminated.
(base) [pepe@pepe-83dr cpp_opencl]$ gcc main.cpp -o main
main.cpp:2:10: fatal error: CL/cl.hpp: No such file or directory
2 | #include <CL/cl.hpp>
| ^~~~~~~~~~~
compilation terminated.

(base) [pepe@pepe-83dr ~]$ neofetch
██████████████████ ████████ pepe@pepe-83dr
██████████████████ ████████ --------------
██████████████████ ████████ OS: Manjaro Linux x86_64
██████████████████ ████████ Host: 83DR IdeaPad 5 2-in-1 14AHP9
████████ ████████ Kernel: 6.10.13-3-MANJARO
████████ ████████ ████████ Uptime: 5 hours, 7 mins
████████ ████████ ████████ Packages: 1209 (pacman), 1 (dpkg)
████████ ████████ ████████ Shell: bash 5.2.37
████████ ████████ ████████ Resolution: 1920x1200
████████ ████████ ████████ DE: Xfce 4.18
████████ ████████ ████████ WM: Xfwm4
████████ ████████ ████████ WM Theme: Matcha-sea
████████ ████████ ████████ Theme: Matcha-sea [GTK2], Adwaita [GTK3]
████████ ████████ ████████ Icons: Papirus-Maia [GTK2], Adwaita [GTK3]
Terminal: xfce4-terminal
Terminal Font: Monospace 12
CPU: AMD Ryzen 7 8845HS w/ Radeon 780M Graphics
GPU: AMD ATI 04:00.0 Phoenix3
Memory: 1571MiB / 13735MiB

It seems you’re using a local PyOpenCL installation for local Python development with Anaconda. If so, use a virtual environment. I honestly don’t know much about the subject, however I do know that much.

I’ve merged your replies into the first post. In the future, please edit your original post if no one has replied yet instead of replying to yourself.

Please edit your first post and format the terminal output properly.

Please also see:

you actually made it worse by putting it together. thanks for nothing.