This problem has troubled me for two days. I decided to analyze it today, because I have a job that must rely on cuda-python. In fact, it is also possible to use pycuda, but a lot of code needs to be modified. I am not very familiar with the api of pycuda, so Decide or get cuda-python
The nvidia official website only has cuda12 installation tutorials, but my environment is cuda11, but installing pip install cuda-python in the cuda11 environment reported a no matching error, so I have been stuck here
I found out today that the github of cuda-python actually has the source code of the previous release of cuda11, so just compile this library directly from the source code.
Release v11.4.0 · NVIDIA/cuda-python · GitHub
The compilation steps are very simple from the readme, install cython, and directly execute python setup.py develop
Run it to compile and install successfully
Haha, successfully imported, done