You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
BUG: updating from 12.6 to 12.8/12.9 breaks Python import #476
The Python version is 3.10.12 and with the command from cuda.bindings import driver as cuda I get:
Exception has occurred: ModuleNotFoundError
No module named 'cuda.bindings'
File "...", line 13, in
from cuda.bindings import driver as cuda
ModuleNotFoundError: No module named 'cuda.bindings'
Okay, I've narrowed it down. It has to do with the migration from 12.6 to 12.8, because when setting up a new Virtual Environment with the same packages both imports work:
from cuda import cuda
from cuda.bindings import driver as cuda2
Here is the result from the pip list command in the new environment:
It seems there is a weird cleanup issue going on. With the following steps I hit an error, though different from yours
Create a fresh env
pip install "cuda-python==12.6.*"
pip install "cuda-python==12.8"
$ python
Python 3.12.9 | packaged by conda-forge | (main, Feb 14 2025, 08:00:06) [GCC 13.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from cuda import cuda, cudart, nvrtc
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'cuda'
@spec-benno could you try a complete removal and then reinstall?
It seems there is a weird cleanup issue going on. With the following steps I hit an error, though different from yours
Create a fresh env
pip install "cuda-python==12.6.*"
pip install "cuda-python==12.8"
$ python
Python 3.12.9 | packaged by conda-forge | (main, Feb 14 2025, 08:00:06) [GCC 13.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from cuda import cuda, cudart, nvrtc
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'cuda'
@spec-benno could you try a complete removal and then reinstall?
Reproducer is to change the step 2 above to pip install "cuda-python==12.6", which pip interprets as installing 12.6.0 (instead of 12.6.2.post1). Then I hit the same error:
$ python
Python 3.12.9 | packaged by conda-forge | (main, Feb 14 2025, 08:00:06) [GCC 13.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from cuda import cuda, cudart, nvrtc
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name 'cuda' from 'cuda' (unknown location)
This seems like another unexpected issue due to layout change that caused some trouble earlier (ex: #226). I don't think there's any fix we can do but I do want to know what caused package updates dirty (since the old version is uninstalled first before the new version is installed)...
changed the title [-]BUG: migrating from 12.6 to 12.8 breaks Python import[/-][+]BUG: updating from 12.6 to 12.8/12.9 breaks Python import[/+]on May 12, 2025
Marking this issue as a "won't fix." Unfortunately there does not seem to exist any workaround to our knowledge, other than kindly asking users to do a clean installation (uninstall and then install) instead of updating. I'll add this to known issues shortly.
Activity
leofang commentedon Feb 27, 2025
I cannot reproduce it (obviously, since our CI definitely got this tested), so...
pip list? And if you use conda environment, alsoconda list?spec-benno commentedon Feb 27, 2025
I have an existing virtual environment with cuda-python installed and I simply did a:
pip install cuda-python==12.8The
pip listcommand outputs:leofang commentedon Feb 27, 2025
Forgot to ask, what's the Python version?
Also, with this broken environment, could you check what happens if you do
? (Same for cudart and nvrtc)
spec-benno commentedon Feb 27, 2025
The Python version is 3.10.12 and with the command
from cuda.bindings import driver as cudaI get:ps. small correction I'm using Ubuntu LTS 22.04
spec-benno commentedon Feb 27, 2025
Okay, I've narrowed it down. It has to do with the migration from 12.6 to 12.8, because when setting up a new Virtual Environment with the same packages both imports work:
Here is the result from the
pip listcommand in the new environment:leofang commentedon Feb 27, 2025
It seems there is a weird cleanup issue going on. With the following steps I hit an error, though different from yours
pip install "cuda-python==12.6.*"pip install "cuda-python==12.8"@spec-benno could you try a complete removal and then reinstall?
pip uninstall -y cuda-python cuda-bindings cuda-corepip install cuda-python==12.8 cuda-coreand see if it is fixed?
spec-benno commentedon Feb 27, 2025
we were thinking the same thing. Setting up a new environment does the trick, however migrating is still a problem somehow
spec-benno commentedon Feb 27, 2025
I also did the uninstall and reinstall and this works as well, for both import methods. The error you're seeing I've seen as well.
leofang commentedon Feb 27, 2025
Reproducer is to change the step 2 above to
pip install "cuda-python==12.6", whichpipinterprets as installing 12.6.0 (instead of12.6.2.post1). Then I hit the same error:This seems like another unexpected issue due to layout change that caused some trouble earlier (ex: #226). I don't think there's any fix we can do but I do want to know what caused package updates dirty (since the old version is uninstalled first before the new version is installed)...
leofang commentedon May 7, 2025
@bdice reports offline that this still happens when updating from 12.6.2.post1 to 12.9.0... 😵💫
[-]BUG: migrating from 12.6 to 12.8 breaks Python import[/-][+]BUG: updating from 12.6 to 12.8/12.9 breaks Python import[/+]leofang commentedon May 12, 2025
Marking this issue as a "won't fix." Unfortunately there does not seem to exist any workaround to our knowledge, other than kindly asking users to do a clean installation (uninstall and then install) instead of updating. I'll add this to known issues shortly.