[BUG] Exception: Your CUDA environment is invalid.
See original GitHub issueRecently I got this error while trying to install cupy on a Kaggle GPU Kernel:
Collecting cupy
Downloading cupy-7.4.0.tar.gz (3.7 MB)
|████████████████████████████████| 3.7 MB 3.4 MB/s eta 0:00:01
ERROR: Command errored out with exit status 1:
command: /opt/conda/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-jzxcfeco/cupy/setup.py'"'"'; __file__='"'"'/tmp/pip-install-jzxcfeco/cupy/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-jzxcfeco/cupy/pip-egg-info
cwd: /tmp/pip-install-jzxcfeco/cupy/
Complete output (48 lines):
Options: {'package_name': 'cupy', 'long_description': None, 'wheel_libs': [], 'wheel_includes': [], 'no_rpath': False, 'profile': False, 'linetrace': False, 'annotate': False, 'no_cuda': False, 'use_hip': False}
-------- Configuring Module: cuda --------
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
/opt/conda/compiler_compat/ld: /usr/lib/gcc/x86_64-linux-gnu/7/../../../x86_64-linux-gnu/libcuda.so: file not recognized: file truncated
collect2: error: ld returned 1 exit status
Cannot build a stub file.
Original error: command 'g++' failed with exit status 1
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-jzxcfeco/cupy/setup.py", line 129, in <module>
ext_modules = cupy_setup_build.get_ext_modules()
File "/tmp/pip-install-jzxcfeco/cupy/cupy_setup_build.py", line 744, in get_ext_modules
extensions = make_extensions(arg_options, compiler, use_cython)
File "/tmp/pip-install-jzxcfeco/cupy/cupy_setup_build.py", line 492, in make_extensions
raise Exception('Your CUDA environment is invalid. '
Exception: Your CUDA environment is invalid. Please check above error log.
************************************************************
* CuPy Configuration Summary *
************************************************************
Build Environment:
Include directories: ['/usr/local/cuda/include']
Library directories: ['/usr/local/cuda/lib64']
nvcc command : ['/usr/local/cuda/bin/nvcc']
Environment Variables:
CFLAGS : (none)
LDFLAGS : (none)
LIBRARY_PATH : (none)
CUDA_PATH : (none)
NVTOOLSEXT_PATH : (none)
NVCC : (none)
ROCM_HOME : (none)
Modules:
cuda : No
-> Cannot link libraries: ['cublas', 'cuda', 'cudart', 'cufft', 'curand', 'cusparse', 'nvrtc']
-> Check your LDFLAGS environment variable.
ERROR: CUDA could not be found on your system.
Please refer to the Installation Guide for details:
https://docs-cupy.chainer.org/en/stable/install.html
************************************************************
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Issue Analytics
- State:
- Created 3 years ago
- Comments:21 (12 by maintainers)
Top Results From Across the Web
Can't install via Pip · Issue #952 · cupy/cupy - GitHub
Exception : Your CUDA environment is invalid. ... Check your LDFLAGS environment variable. ERROR: CUDA could not be found on your system.
Read more >Cupy error installation - chainer - Stack Overflow
Original error: command 'g++' failed with exit status 1 ... Exception: Your CUDA environment is invalid. Please check above error log.
Read more >Installation — CuPy 11.4.0 documentation
pip fails to install CuPy# ... If you are using certain versions of conda, it may fail to build CuPy with error g++:...
Read more >cupy 安装时提示报错Exception: Your CUDA environment is ...
raise Exception('Your CUDA environment is invalid. ' Exception: Your CUDA environment is invalid. Please check above error log.
Read more >Installing devbio plugin in napari - #27 by jni - Usage & Issues
It says my CUDA environment is invalid even though I installed CUDA 11.6 from the downloaded .exe file. Do I need to install...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

About pre-installing Rapids packages, I tried in December 2019 but hit that issue: https://github.com/Kaggle/docker-python/issues/594#issuecomment-563498314
Let me check whether this dependency conflict issue has been fixed.
Btw now there are many people using Rapids on Kaggle relying on our manually uploaded installation dataset: https://www.kaggle.com/cdeotte/rapids/kernels?sortBy=voteCount&group=everyone&pageSize=20&datasetId=492658 It would be really nice if it can be preinstalled on Kaggle’s GPU Docker Image. https://rapids.ai/start.html