为什么在cpu版本的colab上安装后启动服务报错呢?

#1
by svjack - opened
pip install xinference[ggml]>=0.4.3
xinference -p 9997
/usr/local/lib/python3.10/dist-packages/xinference/deploy/cmdline.py:130: DeprecationWarning: Starting a local 'xinference' cluster via the 'xinference' command line is deprecated and will be removed in a future release. Please use the new 'xinference-local' command.
  warnings.warn(
Process Process-1:
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/cupy/__init__.py", line 18, in <module>
    from cupy import _core  # NOQA
  File "/usr/local/lib/python3.10/dist-packages/cupy/_core/__init__.py", line 3, in <module>
    from cupy._core import core  # NOQA
ImportError: libcuda.so.1: cannot open shared object file: No such file or directory

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3.10/multiprocessing/process.py", line 314, in _bootstrap
    self.run()
  File "/usr/lib/python3.10/multiprocessing/process.py", line 108, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.10/dist-packages/xinference/deploy/local.py", line 67, in run
    loop.run_until_complete(task)
  File "/usr/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.10/dist-packages/xinference/deploy/local.py", line 42, in _start_local_cluster
    pool = await create_worker_actor_pool(
  File "/usr/local/lib/python3.10/dist-packages/xinference/deploy/utils.py", line 98, in create_worker_actor_pool
    return await xo.create_actor_pool(
  File "/usr/local/lib/python3.10/dist-packages/xoscar/api.py", line 160, in create_actor_pool
    return await get_backend(scheme).create_actor_pool(
  File "/usr/local/lib/python3.10/dist-packages/xoscar/backends/indigen/backend.py", line 49, in create_actor_pool
    return await create_actor_pool(
  File "/usr/local/lib/python3.10/dist-packages/xoscar/backends/pool.py", line 1549, in create_actor_pool
    pool: MainActorPoolType = await pool_cls.create(
  File "/usr/local/lib/python3.10/dist-packages/xoscar/backends/pool.py", line 1255, in create
    pool: MainActorPoolType = await super().create(config)
  File "/usr/local/lib/python3.10/dist-packages/xoscar/backends/pool.py", line 793, in create
    TypeDispatcher.reload_all_lazy_handlers()
  File "xoscar/_utils.pyx", line 110, in xoscar._utils.TypeDispatcher.reload_all_lazy_handlers
  File "xoscar/_utils.pyx", line 69, in xoscar._utils.TypeDispatcher._reload_lazy_handlers
  File "xoscar/_utils.pyx", line 74, in xoscar._utils.TypeDispatcher._reload_lazy_handlers
  File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/usr/local/lib/python3.10/dist-packages/cupy/__init__.py", line 20, in <module>
    raise ImportError(f'''
ImportError: 
================================================================
Failed to import CuPy.

If you installed CuPy via wheels (cupy-cudaXXX or cupy-rocm-X-X), make sure that the package matches with the version of CUDA or ROCm installed.

On Linux, you may need to set LD_LIBRARY_PATH environment variable depending on how you installed CUDA/ROCm.
On Windows, try setting CUDA_PATH environment variable.

Check the Installation Guide for details:
  https://docs.cupy.dev/en/latest/install.html

Original error:
  ImportError: libcuda.so.1: cannot open shared object file: No such file or directory
================================================================

Traceback (most recent call last):
  File "/usr/local/bin/xinference", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1666, in invoke
    rv = super().invoke(ctx)
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.10/dist-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/click/decorators.py", line 33, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/usr/local/lib/python3.10/dist-packages/xinference/deploy/cmdline.py", line 137, in cli
    start_local_cluster(log_level=log_level, host=host, port=port)
  File "/usr/local/lib/python3.10/dist-packages/xinference/deploy/cmdline.py", line 80, in start_local_cluster
    main(
  File "/usr/local/lib/python3.10/dist-packages/xinference/deploy/local.py", line 83, in main
    raise RuntimeError("Cluster is not available after multiple attempts")
RuntimeError: Cluster is not available after multiple attempts

确定是 CPU 版本吗?看错误栈有 Cupy,colab 里执行下 import cupy 会报错吗?

确定是 CPU 版本吗?看错误栈有 Cupy,colab 里执行下 import cupy 会报错吗?

是的 用cpu下的colab
pip install copy

import cupy
会报错

pip uninstall cupy 卸载了再试一下,这个包 install 有问题

pip uninstall cupy 卸载了再试一下,这个包 install 有问题

我试了一下,还是有问题。
请问你能在cpu colab装一下分享一个notebook给我吗?谢谢

pip uninstall cupy-cuda11x

Sign up or log in to comment