Sign inSign up

ocpub/oc9-tensorrt-llm

By ocpub

Updated 3 months ago

Image
0

104

ocpub/oc9-tensorrt-llm repository overview

TensorRT-LLM 1.3.0rc6 on OpenCloudOS 9

基本信息

  • 框架版本:TensorRT-LLM v1.3.0rc6
  • 基础镜像:opencloudos/opencloudos9-minimal:latest
  • Python 版本:Python 3.12
  • CUDA 版本:CUDA 13.1
  • GPU 支持:需要 NVIDIA GPU 与 NVIDIA Container Toolkit
  • MPI 支持:已集成 OpenMPI / mpi4py
  • 主要用途
    • TensorRT-LLM Python 环境验证
    • CUDA / PyTorch GPU 功能测试
    • TensorRT-LLM 推理环境基础镜像
    • 后续模型构建、Engine 转换与推理测试

构建

在 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())'
"

常见问题

验证内容

注意事项

  1. 启动容器时必须添加:
--gpus all

否则容器内无法访问 NVIDIA GPU。

  1. 宿主机需要安装 NVIDIA Container Toolkit。

  2. 当前测试只验证基础运行环境,不包含完整模型推理流程。

  3. TensorRT-LLM 真正推理通常需要额外步骤:

下载模型 → 转换 checkpoint → 构建 TensorRT engine → 运行推理脚本

常见问题

1. ModuleNotFoundError: No module named 'torch'

通常是 Python 虚拟环境没有进入默认 PATH。需要确认镜像中包含:

ENV VIRTUAL_ENV=/home/python3.12
ENV PATH=/home/python3.12/bin:$PATH

或者需要确认虚拟环境是否被激活

source /home/python3.12/bin/activate

Tag summary

Content type

Image

Digest

sha256:d14795279

Size

16.1 GB

Last updated

3 months ago

docker pull ocpub/oc9-tensorrt-llm:1.3.0rc6