暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

天数智芯卡调试

手机用户4074 2024-11-16
1351

ubuntu安装开启后端窗口命令:

升级到最新的pip版本
python -m pip install --upgrade pip
安装后端工具命令 可以开启一个新窗口
apt install tmux
打开一个名字为pip后端窗口
tmux new -s pip
退出后端界面快捷键 crtl+b 然后d
重新进入后端界面
tmux attach -t pip

查看当前环境cuda torch 信息

 pip freeze | grep cuda  (显示cuda相关信息)
cupy-cuda12x==12.1.0
nvidia-cuda-cupti-cu12==12.1.105
nvidia-cuda-nvrtc-cu12==12.1.105
nvidia-cuda-runtime-cu12==12.1.105
pip show torch (显示torcch相关信息)
Name: torch
Version: 2.1.2
Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration
Home-page: https://pytorch.org/
Author: PyTorch Team
pip freeze | grep torch
torch==2.1.2
python         //进入python环境
Python 3.8.19 (default, Mar 20 2024, 19:58:24)
[GCC 11.2.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import torch
>>> torch.cuda.is_available() //验证是否可以识别到cuda环境
False
>>> exit() //退出python环境

安装python

#解压python包 四随便定义目录
tar -xvf Python-3.10.4.tgz
cd Python-3.10.4
#配置安装
./configure --enable-optimizations --with-ensurepip=install
#编译 安装
make -j $(nproc) && make altinstall
sudo update-alternatives --install /usr/bin/python3 python3 /usr/local/bin/python3.12 1
sudo update-alternatives --install /usr/bin/pip3 pip3 /usr/local/bin/pip3.12 1

升级openssl模块

进去到模块解压目录
./config --prefix=/usr/local/openssl --openssldir=/usr/local/openssl --shared zlib
make
make install
cd /etc/ld.so.conf.d/
vim openssl-3.1.4.conf /usr/local/openssl/lib64
ldconfig -v

备份旧链接
mv /bin/openssl /bin/openssl.bak

创建新链接
ln -s /usr/local/openssl/bin/openssl /usr/bin/openssl
ln -s /usr/local/openssl/include/openssl /usr/include/openssl
ln -s /usr/local/openssl/bin/openssl /usr/local/bin/openssl
ln -s /usr/local/openssl/lib64/libcrypto.so.3 /lib/libcrypto.so.3
ln -s /usr/local/openssl/lib64/libcrypto.so.3 /lib/libcrypto.so.6
ln -s /usr/local/openssl/lib64/libssl.so.3 /usr/lib64/libssl.so.3
ln -s /usr/local/openssl/lib64/libcrypto.so.3 /usr/lib64/libcrypto.so.3
ln -s /usr/local/openssl/lib64/libssl.so /usr/lib64/libssl.so
ln -s /usr/local/openssl/lib64/libcrypto.so /usr/lib64/libcrypto.so

chmod -R 755 /usr/local/openssl/
echo "/usr/local/openssl/lib64" >> /etc/ld.so.conf
/sbin/ldconfig -v

echo 'export OPENSSL_PATH="/usr/local/openssl/bin"'>>/etc/profile.d/openssl.sh
echo 'export PATH=$PATH:$OPENSSL_PATH'>>/etc/profile.d/openssl.sh


chmod +x /etc/profile.d/openssl.sh
source /etc/profile.d/openssl.sh
openssl version -a


许昌使用GPU卡是天数智芯的硬件 查看GPU卡信息命令ixsmi

(base) root@10e1e0e4:~# ixsmi
Timestamp   Mon Apr  1 17:57:41 2024
+-----------------------------------------------------------------------------+
| IX-ML: 3.2.1.2     Driver Version: 4.0.0       CUDA Version: 10.2         |
|-------------------------------+----------------------+----------------------|
| GPU Name                     | Bus-Id               | Clock-SM Clock-Mem |
| Fan Temp Perf Pwr:Usage/Cap|     Memory-Usage   | GPU-Util Compute M. |
|===============================+======================+======================|
| 0   Iluvatar MR-V100         | 00000000:0C:00.0     | 1500MHz   1600MHz   |
| 0%   35C   P0   31W / 150W   | 26090MiB / 32768MiB | 0%       Default   |
+-------------------------------+----------------------+----------------------+
| 1   Iluvatar MR-V100         | 00000000:0D:00.0     | 1500MHz   1600MHz   |
| 0%   35C   P0   32W / 150W   | 26106MiB / 32768MiB | 0%       Default   |
+-------------------------------+----------------------+----------------------+
| 2   Iluvatar MR-V100         | 00000000:10:00.0     | 1500MHz   1600MHz   |
| 0%   34C   P0   33W / 150W   | 26106MiB / 32768MiB | 0%       Default   |
+-------------------------------+----------------------+----------------------+
| 3   Iluvatar MR-V100         | 00000000:15:00.0     | 1500MHz   1600MHz   |
| 0%   36C   P0   33W / 150W   | 26004MiB / 32768MiB | 0%       Default   |
+-------------------------------+----------------------+----------------------+
| 4   Iluvatar MR-V100         | 00000000:16:00.0     | 1500MHz   1600MHz   |
| 0%   37C   P0   32W / 150W   | 114MiB / 32768MiB   | 0%       Default   |
+-------------------------------+----------------------+----------------------+
| 5   Iluvatar MR-V100         | 00000000:19:00.0     | 1500MHz   1600MHz   |
| 0%   36C   P0   31W / 150W   | 114MiB / 32768MiB   | 0%       Default   |
+-------------------------------+----------------------+----------------------+
| 6   Iluvatar MR-V100         | 00000000:1D:00.0     | 1500MHz   1600MHz   |
| 0%   35C   P0   31W / 150W   | 114MiB / 32768MiB   | 0%       Default   |
+-------------------------------+----------------------+----------------------+
| 7   Iluvatar MR-V100         | 00000000:25:00.0     | 1500MHz   1600MHz   |
| 0%   34C   P0   32W / 150W   | 114MiB / 32768MiB   | 0%       Default   |
+-------------------------------+----------------------+----------------------+

+-----------------------------------------------------------------------------+
| Processes:                                                       GPU Memory |
| GPU       PID     Process name                               Usage(MiB) |
|=============================================================================|
|    0     650397     ray::RayWorkerVllm                          25976     |
|    1     650481     ray::RayWorkerVllm                          25992     |
|    2     650667     ray::RayWorkerVllm                          25992     |
|    3     650758     ray::RayWorkerVllm                          25890     |
+-----------------------------------------------------------------------------+

天数智芯镜像环境启动命令

#/data/llms存放模型 /data/scripts存放启动脚本 剩下挂载是为了使用硬件加载配置文件
docker run -it --shm-size="32g" -d -v /data/llms:/data/llms -v /data/scripts:/data/scripts -v /dev:/dev  -v /usr/src/:/usr/src -v /lib/modules/:/lib/modules -v /home:/home -p 7000:8000 --pid=host --privileged --cap-add=ALL  --name vllm_qwen1.5_14b-1 qwen:0401 /bin/bash
#进入启动容器 启动服务
docker exec -it vllm_qwen1.5_14b-1 bash
cd /data/scripts
bash start.sh &


「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论