This repository contains the source code used for the case studies presented in the manuscript "GPU-Accelerated Direct Transcription-Based Nonlinear Model Predictive Control" by Evelyn Gondosiswanto and Joshua L. Pulsipher. Note that running the GPU benchmarks require an NVIDIA GPU with CUDA support.
git clone --recursive https://github.com/infiniteopt/GPU-NMPC-paper
cd GPU-NMPC-paper
mkdir -p \
distillation/logs \
pde/logs \
results/{Ipopt,MOI,ExaModelsCPU,ExaModelsGPU,MPCGPU}First, you'll need to install Julia (available at https://julialang.org/downloads/). Then to configure the required packages, create and instantiate a Julia environment using the Project.toml file as follows:
julia> cd("GPU-NMPC-paper/")
julia> ]
(@v1.12) pkg> activate .
(GPU-NMPC-paper) pkg> instantiateThe JuMP.jl and InfiniteExaModels.jl benchmarks are run using the run_cases_nmpc.jl file.
The source code for this case study is contained in:
distillation.jl(JuMP.jlandInfiniteExaModels.jl)distill-OptimalControl.jl(OptimalControl.jl)
The source code for this case study is contained in pde.jl.
The source code for this case study is contained in the distillation/mpcgpu subfolder. As this GPU-based case study is written in CUDA C/C++, you will need to install CUDA Toolkit (see https://developer.nvidia.com/cuda-toolkit-archive) and a compatible C++ compiler.
To build and compile the code from the root directory, run the following command:
nvcc -std=c++17 \
distillation/mpcgpu/distillation_pcg.cu \
-Idistillation/mpcgpu \
-IMPCGPU/include \
-IMPCGPU/include/common \
-IMPCGPU/include/dynamics \
-IMPCGPU/include/pcg \
-IMPCGPU/GLASS \
-IMPCGPU/GLASS/include \
-IMPCGPU/GBD-PCG \
-IMPCGPU/GBD-PCG/include \
-lcublas \
-o distillation_pcgThen the case study itself can be run using:
./distillation_pcgThe benchmark results are written to their respective folders in the results subfolder.


