conda-forge / cupy-feedstock

A conda-smithy repository for cupy.
BSD 3-Clause "New" or "Revised" License
5 stars 23 forks source link

`cupy.show_config()` errors out #98

Closed leofang closed 3 years ago

leofang commented 3 years ago
$ conda create -n test -c conda-forge -y python=3.8 cupy cudatoolkit=11.0
$ conda activate test
$ python -c "import cupy; cupy.show_config()"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/leofang/miniforge3/envs/test/lib/python3.8/site-packages/cupy/__init__.py", line 866, in show_config
    _sys.stdout.write(str(_cupyx.get_runtime_info()))
  File "/home/leofang/miniforge3/envs/test/lib/python3.8/site-packages/cupyx/_runtime.py", line 225, in __str__
    props['name'].decode('utf-8')),
AttributeError: 'str' object has no attribute 'decode'

For some reason CUDA_VERSION was either unset or set to 0 at build time, so this line was picked up: https://github.com/cupy/cupy/blob/89da620875741bbb167512234ab3a9f81b5ffc10/cupy_backends/cuda/api/runtime.pyx#L293 together with another byte <-> str bug (https://github.com/cupy/cupy/pull/4594) this error happens.

leofang commented 3 years ago

It's a sdist issue: cupy/cupy#4597

leofang commented 3 years ago

For the purpose of building Conda packages, one obvious way out is to build from GitHub source, which we already followed in the rc branch to circumvent another sdist issue.