1616356 : Cupy driver error on gpu node¶
Created: 2026-07-10T18:40:39Z - current status: new¶
Anonymized Summary:¶
Issue:
A user encountered errors while trying to use the xfel IPython kernel (ipykernel). The primary issues are:
- Conflicting CuPy Installations: Multiple versions of CuPy (
cupy-cuda12x,cupy-cuda13x) are detected, causing potential functionality issues. - NumPy Version Conflict: Modules compiled with NumPy 1.x fail due to incompatibility with NumPy 2.4.6.
- Matplotlib Import Error: Attempting to import
matplotlib.pyplottriggers anAttributeError (_ARRAY_API not found)andImportError (numpy.core.multiarray failed to import).
The user reports being unable to resolve the CuPy conflict via pip uninstall/reinstall.
Solution Steps:¶
- Resolve CuPy Conflicts:
- Uninstall conflicting CuPy packages manually:
bash pip uninstall cupy-cuda12x cupy-cuda13x - Verify no residual installations exist:
bash pip list | grep cupy -
Reinstall the correct version aligned with the system’s CUDA toolkit (e.g.,
cupy-cuda12x). -
Downgrade NumPy:
-
Downgrade to NumPy 1.x to ensure compatibility:
bash pip install "numpy<2" -
Rebuild Environment (if needed):
-
If the issue persists, consider recreating the virtual environment or container to avoid dependency conflicts.
-
Check Permissions:
-
Ensure the user has write permissions to modify Python packages in the target directory (
~/.local/lib/python3.11/). -
Alternative:
- Use Conda to manage dependencies cleanly:
bash conda create -n new_env python=3.11 numpy=1.* cupy=cuda12x conda activate new_env
Note: Coordinate with administrators if modifications require elevated privileges.