question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Creating custom python backend environment

See original GitHub issue

After creating a the triton custom environment using the steps listed below we get:

triton_python_backend_stub: ../nptl/pthread_mutex_lock.c:81: __pthread_mutex_lock: Assertion `mutex->__data.__owner == 0' failed.

Steps we took to create custom triton environment

  1. First we installed conda and created and environment called python-3-8
  2. We then installed numpy as required in the documentation along with our custom packages listed below:
apt-get update
apt-get -y install libgl1
apt-get install -yq libgtk2.0-dev
pip3 install torch==1.9.1+cpu torchvision==0.10.1+cpu torchaudio==0.9.1 -f https://download.pytorch.org/whl/torch_stable.html
pip install detectron2 -f https://dl.fbaipublicfiles.com/detectron2/wheels/cpu/torch1.9/index.html
pip install opencv-python==4.5.2.52

We also set the PYTHONNOUSERSITE environment variables as requested: export PYTHONNOUSERSITE=True

  1. We installed CMAKE and cuda-toolkit-11

install cmake and cuda

apt-get update
apt-get install -y apt-transport-https ca-certificates gnupg software-properties-common wget
wget -O -https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | apt-key add -

apt-add-repository 'debhttps://apt.kitware.com/ubuntu/ bionic main'
apt-get update
apt-get install -y cmake
##install rapidjson and libarchive
apt-get install -y rapidjson-dev libarchive-dev

apt-key adv --fetch-keys  http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub

bash -c 'echo "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64 /" > /etc/apt/sources.list.d/cuda.list'

apt update
apt install cuda-toolkit-11-0
  1. We set the CUDA directory on our environment to the correct path: cmake -D CUDA_TOOLKIT_ROOT_DIR=/usr/local/cuda-11.0 ..

  2. we make the directory and create the custom backend stub

git clone https://github.com/triton-inference-server/python_backend -b r21.09
cd r21.09
mkdir build && cd build
cmake -DTRITON_ENABLE_GPU=ON -DCMAKE_INSTALL_PREFIX:PATH=pwd/install ..
make triton-python-backend-stub
  1. We then uploaded the triton_backend_stub file to the model directory on our GCS bucket.
  2. after this we used conda-pack to pack out environment and then uploaded it to our detectron2 model directory on our GCS bucket

Triton Information Triton Version 21.09 Model: Detectron2

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
arshiamalekcommented, Oct 25, 2021

@Tabrizian This is the complete steps we took to create out environment

0reactions
Tabriziancommented, Dec 17, 2021

Closing due to in-activity. Feel free to re-open if the issue persists.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Development Environment Setup - Backend Python 3 - YouTube
Development Environment Setup - Backend Python 3 ; Get the course here! - https://www.codebreakthrough.com/back... ; Course notes - https://calcur ...
Read more >
How to Set up a Local Python Development Environment - Twilio
We share the fastest way to get started with web development (and Twilio) in Python with the Flask framework, pip package manager, and...
Read more >
Packaging Python Projects
pyproject.toml tells “frontend” build tools like pip and build what “backend” tool to use to create distribution packages for your project.
Read more >
GitHub - triton-inference-server/python_backend
Model Config File; Managing Python Runtime and Libraries. Building Custom Python Backend Stub; Creating Custom Execution Environments; Important Notes.
Read more >
How to Set Up a Virtual Environment in Python – And Why It's ...
When developing software with Python, a basic approach is to install Python on your machine, install all your required libraries via the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found