
















今天使用,3080魔改卡跑大模型。
一,先将硬件组装上架。
安装操作系统 Ubuntu 22.04.4 LTS
二,查看GPU设备
root@zjyy:~# lspci | grep vga root@zjyy:~# lspci | grep gpu root@zjyy:~# lspci | grep -i vga 02:00.0 VGA compatible controller: NVIDIA Corporation GA102 [GeForce RTX 3080] (rev a1) 09:00.0 VGA compatible controller: Matrox Electronics Systems Ltd. G200eR2 (rev 01)
这台服务器有两张显示设备:02:00.0— NVIDIA GA102 [GeForce RTX 3080] → 这就是今天主角,NVIDIA GeForce RTX 3080(桌面级显卡插在服务器上,GA102 核心)。09:00.0— Matrox G200eR2 → 板载BMC/带外管理显卡(用于 IPMI 远程控制台),不是真正算力卡。
三,安装驱动
Ubuntu20.04 LTS 的 yum 使用aliyum
可以手动编辑/etc/apt/sources.list中archive.ubuntu.com为mirrors.aliyun.com
输入以下命令批量替换配置:
sudo sed -e 's|archive.ubuntu.com|mirrors.aliyun.com|g' \
-i.bak \
/etc/apt/sources.list
sudo apt update #更新软件包列表
安装驱动
apt-get install -y nvidia-driver-550
安装完驱动,重起一次操作系统。
查看驱动

能看到显卡信息和,魔改后的20G显存。
查看nvidia-container
dpkg -l | grep nvidia-container
curl -fsSL https://mirrors.ustc.edu.cn/libnvidia-container/gpgkey | \ sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg
写入 NVIDIA Container 源
curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | \
sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg
curl -fsSL https://nvidia.github.io/libnvidia-container/stable/deb/nvidia-container-toolkit.list | \
sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
更新 APT
安装sudo apt install -y nvidia-container-toolkit ,跑docker环境CUDA 开发/运行用,在宿主机安装。
sudo apt install -y nvidia-container-toolkit
验证nvidia-container
dpkg -l | grep nvidia-container
安装 nvidia-cuda-toolkit,本机环境跑CUDA 开发/运行环境用
apt install nvidia-cuda-toolkit
查看nvcc -V
nvcc显示的是 CUDA Toolkit 11.5
根据CUDA版本安装对应的PyTorch:
pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu115
验证安装:
python3 -c "import torch; print(torch.__version__); print(torch.cuda.is_available())"
# 验证Torch GPU支持
python3 -c "import torch; print('PyTorch版本:', torch.__version__); print('CUDA可用:', torch.cuda.is_available()); print('CUDA版本:', torch.version.cuda); print('GPU设备:', torch.cuda.get_device_name(0) if torch.cuda.is_available() else 'None'); print('GPU数量:', torch.cuda.device_count());"
输出:
PyTorch版本: 1.11.0+cu115
CUDA可用: True
CUDA版本: 11.5
GPU设备: NVIDIA GeForce RTX 3080
GPU数量: 1
四,使用vLLM推理框架,运行 Qwen3-Reranker-4B 模型。
下载模型
modelscope download \ --model Qwen/Qwen3-Reranker-4B \ --local_dir /data_b/modelscope/qwen3_reranker_4b_20250610
拉取镜像
docker pull dengcao/vllm-openai:v0.9.2
用 python3 -c检查vLLM否能在容器里正常导入
docker run --rm --entrypoint python3 dengcao/vllm-openai:v0.9.2 -c \ "import vllm; print('vLLM OK:', vllm.__version__)"
启动容器
docker rm -f Qwen3-Reranker-4B docker run -d \ --gpus all \ --shm-size=2g \ --ipc=host \ -p 8701:8701 \ -v /data_b/modelscope/qwen3_reranker_4b_20250610:/models/Qwen3-Reranker-4B \ --name Qwen3-Reranker-4B \ dengcao/vllm-openai:v0.9.2 \ --model /models/Qwen3-Reranker-4B \ --task score \ --trust-remote-code \ --served-model-name Qwen3-Reranker-4B \ --max-model-len 8192 \ --gpu-memory-utilization 0.8 \ --port 8701
查看启动日志
docker logs -f Qwen3-Reranker-4B
出现以下内容表示启动成功:
INFO: Started server process [1]
INFO: Waiting for application startup.
INFO: Application startup complete.
测试 Rerank API
curl http://localhost:8701/v1/rerank \
-H "Content-Type: application/json" \
-d '{
"model": "Qwen3-Reranker-4B",
"query": "深度学习框架有哪些?",
"documents": [
"PyTorch 是一个主流的深度学习框架。",
"苹果是一种水果。"
],
"top_n": 2
}'
常见参数说明
| 参数 | 说明 |
|---|---|
--task score |
Reranker 专用 |
--max-model-len 8192 |
支持长 query + doc |
--gpu-memory-utilization 0.8 |
4090 24G 推荐 |
--trust-remote-code |
Qwen3 必须 |
--port 8701 |
对外 API 端口 |
/v1/rerank中继接口,目前兼容 Cohere Rerank 和 Jina Rerank 格式调用时走 New API 的地址:
curl http://新API地址:3000/v1/rerank \
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。