Coder Social home page Coder Social logo

dd-duda / tensorrt-in-action Goto Github PK

View Code? Open in Web Editor NEW
9.0 1.0 2.0 11.17 MB

TensorRT-in-Action 是一个 GitHub 代码库,提供了使用 TensorRT 的代码示例,并有对应 Jupyter Notebook。

License: Apache License 2.0

Jupyter Notebook 87.19% Python 12.69% Shell 0.12%

tensorrt-in-action's Introduction

TensorRT-in-Action

TensorRT-in-Action 是一个 GitHub 代码库,提供了使用 TensorRT 的代码示例,并有对应 Jupyter Notebook。

TensorRT 安装

推荐采用 Docker 安装

在下面的网站,可以直接安装带有最新 TensorRT, Pytorch, cuDNN, NCCL 等软件的 docker 镜像

PyTorch | NVIDIA NGC

若使用远程服务器,请使用如下命令登录:

ssh -L localhost:8900:localhost:8900 {name}@{ip}

请(在你的服务器上)运行下面的命令:

docker run -it --gpus all -p 8900:8900 --name trt-action --shm-size 32G --ulimit memlock=-1 --ulimit stack=67108864 -v ~:/work [nvcr.io/nvidia/pytorch:23.04-py3](http://nvcr.io/nvidia/pytorch:23.04-py3) /bin/bash
  • docker run:运行 Docker 容器的命令
  • -it:为容器分配一个伪终端,并保持 STDIN 处于打开状态,即使未连接也是如此
  • --gpus all:使容器内的程序可以访问主机上的所有 GPU
  • -p 8900:8900:将容器内的端口8900映射到主机上的端口8900。这允许在主机上通过指定的端口访问容器内运行的服务或应用程序。
  • --name trt-action:将容器命名为 "trt-action"
  • --shm-size 32G:设置容器的共享内存大小为32GB。共享内存用于在容器内的进程之间共享数据。
  • --ulimit memlock=-1:设置内存锁定的限制。将值设置为-1表示不限制内存锁定,允许进程锁定任意数量的内存。
  • --ulimit stack=67108864:设置堆栈大小的限制。这里将堆栈大小限制为67108864字节(64MB)。
  • -v ~:/work:将用户的主目录挂载为容器内的 /work 目录
  • [nvcr.io/nvidia/pytorch:23.04-py3](<http://nvcr.io/nvidia/pytorch:23.04-py3>):指定要运行的 Docker 镜像,即安装了 TensorRT 8.6 的 NVIDIA PyTorch 镜像
  • /bin/bash:在容器内执行**/bin/bash**命令,以便在容器中启动一个交互式的Bash终端会话。这将成为容器的入口点。

若是第一次运行该命令,将会自动下载 Docker 镜像

常用指令

# 开启容器
docker start trt-action
# 进入容器命令窗口
docker exec -it trt-action /bin/bash

tensorrt-in-action's People

Contributors

dd-duda avatar

Stargazers

yhwang avatar  avatar  avatar Zhonghao Fang avatar  avatar TreeDy avatar  avatar 陶新源爸爸 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.