Skip to content

Repository files navigation

GPU Parallelizing of the RNEA Algorithm

This is the code used to write the paper "An investigation into parallelizing the RNEA Algorithm using PyTorch and CUDA.jl"

References

The base code for the RNEA algorithm is from the A2R Lab's GRiD repository.

The batched RNEA algorithm was also based on work done by the A2R Lab

Installation Instructions

Install Python Dependencies

The code in this repository uses several external packages: beautifulsoup4, lxml, numpy, sympy, pytorch which can be automatically installed by running:

pip3 install -r requirements.txt

Install Julia Dependencies

If Julia isn't installed, it can be installed by running (on a UNIX system):

curl -fsSL https://install.julialang.org | sh

Then install CUDA.jl by running:

cd Julia
julia Install_CUDA.jl

Install CUDA Dependencies

sudo apt-get update
sudo apt-get -y install xorg xorg-dev linux-headers-$(uname -r) apt-transport-https

Download and Install CUDA

Note: for Ubuntu 20.04 see https://developer.nvidia.com/cuda-downloads for other distros

wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/7fa2af80.pub
sudo add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/ /"
sudo apt-get update
sudo apt-get -y install cuda

Add the following to ~/.bashrc

export PATH="/usr/local/cuda/bin:$PATH"
export LD_LIBRARY_PATH="/usr/local/cuda/lib64:$LD_LIBRARY_PATH"
export PATH="opt/nvidia/nsight-compute/:$PATH"

Usage

The Python code, both the unparallelized versions, and the parallelized PyTorch versions, is in the folder Python. These are .ipynb notebooks.

The Julia code, both unparallelized, and the parallelized CUDA.jl code, is in the folder Julia. To run any of the files in this folder run:

julia file_name.jl

The graphs from the results of the benchmarking can be found in the folder Graphs

Contributors

About

Optimized GPU-based parallelization of robotics inverse dynamics algorithms for enhanced performance

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages