0%

QAnything安装记录

仅记录QAnything安装过程

run.sh

1
$ bash ./run.sh -c local -i 0 -b default

异常处理

in connect sock.connect(self.unix_socket) PermissionError: [Errno 13] Permission denied

处理

将当前用户加入docker组,重启docker后刷新用户组

1
2
3
$ sudo usermod -aG docker $USER
$ sudo systemctl restart docker
$ newgrp docker

异常现象

输出:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
来自 https://github.com/netease-youdao/QAnything
* branch master -> FETCH_HEAD
当前master分支已是最新,无需更新。
model_size=7B
GPUID1=0, GPUID2=0, device_id=0
GPU1 Model: NVIDIA GeForce RTX 3090
Compute Capability: 8.6
OCR_USE_GPU=True because 8.6 >= 7.5
====================================================
******************** 重要提示 ********************
====================================================

您当前的显存为 24576 MiB 推荐部署7B模型
llm_api is set to [local]
device_id is set to [0]
runtime_backend is set to [default]
model_name is set to []
conv_template is set to []
tensor_parallel is set to [1]
gpu_memory_utilization is set to [0.81]
models 文件夹已存在,无需下载。
检查模型版本成功,当前版本为 v2.1.0。
Model directories check passed. (0/8)
模型路径和模型版本检查通过. (0/8)
Do you want to use the previous host: ? (yes/no) 是否使用上次的host: ?(yes/no) 回车默认选yes,请输入:no
Are you running the code on a remote server or on your local machine? (remote/local) 您是在远程服务器上还是本地机器上启动代码?(remote/local) local
Running under native Linux
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 700, in urlopen
httplib_response = self._make_request(
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 395, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/lib/python3.10/http/client.py", line 1283, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/lib/python3.10/http/client.py", line 1329, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/lib/python3.10/http/client.py", line 1278, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/lib/python3.10/http/client.py", line 1038, in _send_output
self.send(msg)
File "/usr/lib/python3.10/http/client.py", line 976, in send
self.connect()
File "/usr/lib/python3/dist-packages/docker/transport/unixconn.py", line 30, in connect
sock.connect(self.unix_socket)
PermissionError: [Errno 13] Permission denied

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/requests/adapters.py", line 439, in send
resp = conn.urlopen(
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 756, in urlopen
retries = retries.increment(
File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 532, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/usr/lib/python3/dist-packages/six.py", line 718, in reraise
raise value.with_traceback(tb)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 700, in urlopen
httplib_response = self._make_request(
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 395, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/lib/python3.10/http/client.py", line 1283, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/lib/python3.10/http/client.py", line 1329, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/lib/python3.10/http/client.py", line 1278, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/lib/python3.10/http/client.py", line 1038, in _send_output
self.send(msg)
File "/usr/lib/python3.10/http/client.py", line 976, in send
self.connect()
File "/usr/lib/python3/dist-packages/docker/transport/unixconn.py", line 30, in connect
sock.connect(self.unix_socket)
urllib3.exceptions.ProtocolError: ('Connection aborted.', PermissionError(13, 'Permission denied'))

During handling of the above exception, another exception occurred:
......

could not select device driver “nvidia” with capabilities: [[gpu]]

处理

1
2
3
4
5
6
7
8
9
10
11
12
# 添加nvidia源
$ curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
$ distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
$ curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list

# 安装nvidia-container-toolkit
$ sudo apt-get update
$ sudo apt-get install -y nvidia-container-toolkit

# 重启docker
$ sudo systemctl restart docker

异常现象

输出:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
自 https://github.com/netease-youdao/QAnything
* branch master -> FETCH_HEAD
当前master分支已是最新,无需更新。
model_size=7B
GPUID1=0, GPUID2=0, device_id=0
GPU1 Model: NVIDIA GeForce RTX 3090
Compute Capability: 8.6
OCR_USE_GPU=True because 8.6 >= 7.5
====================================================
******************** 重要提示 ********************
====================================================

您当前的显存为 24576 MiB 推荐部署7B模型
llm_api is set to [local]
device_id is set to [0]
runtime_backend is set to [default]
model_name is set to []
conv_template is set to []
tensor_parallel is set to [1]
gpu_memory_utilization is set to [0.81]
models 文件夹已存在,无需下载。
检查模型版本成功,当前版本为 v2.1.0。
Model directories check passed. (0/8)
模型路径和模型版本检查通过. (0/8)
Do you want to use the previous host: localhost? (yes/no) 是否使用上次的host: localhost?(yes/no) 回车默认选yes,请输入:
Running under native Linux
Removing network qanything_milvus_mysql_local
Network qanything_milvus_mysql_local not found.
Creating network "qanything_milvus_mysql_local" with the default driver
Pulling standalone (milvusdb/milvus:v2.3.4)...
v2.3.4: Pulling from milvusdb/milvus
000000000000: Pull complete
......
Digest: sha256:efd6ef720b6ad0de62d006319996ba18504842ffaa543e3b072aeb5963305907
Status: Downloaded newer image for milvusdb/milvus:v2.3.4
Pulling mysql (mysql:)...
latest: Pulling from library/mysql
000000000000: Pull complete
......
Digest: sha256:e9027fe4d91c0153429607251656806cc784e914937271037f7738bd5b8e7709
Status: Downloaded newer image for mysql:latest
Pulling qanything_local (freeren/qanything:v1.1.1)...
v1.1.1: Pulling from freeren/qanything
000000000000: Pull complete
......
Digest: sha256:20a1ca0612b2187c308f900474aa1a1609d04e3c80c7d3c19926fddff6d143da
Status: Downloaded newer image for freeren/qanything:v1.1.1
Creating milvus-minio-local ... done
Creating milvus-etcd-local ... done
Creating mysql-container-local ... done
Creating milvus-standalone-local ... done
Creating qanything-container-local ... error

ERROR: for qanything-container-local Cannot start service qanything_local: could not select device driver "nvidia" with capabilities: [[gpu]]

ERROR: for qanything_local Cannot start service qanything_local: could not select device driver "nvidia" with capabilities: [[gpu]]
ERROR: Encountered errors while bringing up the project.
Attaching to qanything-container-local
qanything-container-local exited with code 128