在 Dockerfile 所在目录执行:
docker build -t oc9-tensorrt-llm:1.3.0rc6 .
docker run -d \
--gpus all \
--name oc9-tensorrt-llm \
oc9-tensorrt-llm:1.3.0rc6 \
sleep infinity
docker exec -it oc9-tensorrt-llm bash
docker run --rm --gpus all oc9-tensorrt-llm:1.3.0rc6 bash -lc "
nvidia-smi &&
python -c 'import torch; print(torch.cuda.is_available()); print(torch.cuda.get_device_name(0))' &&
python -c 'import tensorrt_llm; print(tensorrt_llm.__version__)' &&
python -c 'from mpi4py import MPI; print(MPI.Get_version())'
"
--gpus all
否则容器内无法访问 NVIDIA GPU。
宿主机需要安装 NVIDIA Container Toolkit。
当前测试只验证基础运行环境,不包含完整模型推理流程。
TensorRT-LLM 真正推理通常需要额外步骤:
下载模型 → 转换 checkpoint → 构建 TensorRT engine → 运行推理脚本
通常是 Python 虚拟环境没有进入默认 PATH。需要确认镜像中包含:
ENV VIRTUAL_ENV=/home/python3.12
ENV PATH=/home/python3.12/bin:$PATH
或者需要确认虚拟环境是否被激活
source /home/python3.12/bin/activate
Content type
Image
Digest
sha256:d14795279…
Size
16.1 GB
Last updated
3 months ago
docker pull ocpub/oc9-tensorrt-llm:1.3.0rc6