lebedov / scikit-cuda

Python interface to GPU-powered libraries
http://scikit-cuda.readthedocs.org/
Other
975 stars 179 forks source link

Unhelpful error when importing skcuda.cublas with CUDA_VISIBLE_DEVICES unset #310

Open matthutchison opened 3 years ago

matthutchison commented 3 years ago

Problem

The error given when running import skuda.cublas with CUDA_VISIBLE_DEVICES unset gives the following error. While it's not straightforward to detect all conditions that could cause this to fail, this one would help from a downstream troubleshooting standpoint. I'm not sure where the check for "is the system capable" is appropriate though.

/snipped/miniconda3/envs/scipy_tk/lib/python3.7/site-packages/skcuda/cublas.py:284: UserWarning: creating CUBLAS context to get version number
  warnings.warn('creating CUBLAS context to get version number')
Traceback (most recent call last):
  File "/snipped/miniconda3/envs/scipy_tk/lib/python3.7/site-packages/skcuda/cublas.py", line 280, in _get_cublas_version
    utils.get_soname(cublas_path)).groups()
AttributeError: 'NoneType' object has no attribute 'groups'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/snipped/miniconda3/envs/test_env/lib/python3.7/site-packages/skcuda/cublas.py", line 292, in <module>
    _cublas_version = int(_get_cublas_version())
  File "/snipped/miniconda3/envs/test_env/lib/python3.7/site-packages/skcuda/cublas.py", line 285, in _get_cublas_version
    h = cublasCreate()
  File "/snipped/miniconda3/envs/test_env/lib/python3.7/site-packages/skcuda/cublas.py", line 203, in cublasCreate
    cublasCheckStatus(status)
  File "/snipped/miniconda3/envs/test_env/lib/python3.7/site-packages/skcuda/cublas.py", line 179, in cublasCheckStatus
    raise e
skcuda.cublas.cublasNotInitialized

Environment

List the following info: