cudair enable live-reloading for developing CUDA applications like golang-air. I recommend using docker.
- Live-reloading for CUDA applications
- Docker support
- Easy configuration
- Generate log file on build errors
I used only v1.23~ . So I recommend v1.23~
go install github.com/ei-sugimoto/cudair@latest
First enter into your project
cd /path/to/your_projects
Next, execute cudair
cudair run -c .cudair.toml
You can initialize the configuration file.
cudair init
config file must ".toml" .
# you want to watch root dir path
root = "."
# tmp dir name
tmp_dir = "tmp"
[build]
# execute command
bin = "./tmp/main"
# complie command
cmd = "nvcc --std=c++17 -o ./tmp/main main.cu"
# Generate log file on build errors
log = "build-errors.log"
# Specify the dirs you want to exclude from monitoring
exclude_dir = ["tmp"]
How to use docker is stored in the sample directory.
- nvidia driver
- nvidia-container-toolkit
FROM nvcr.io/nvidia/cuda:12.6.2-cudnn-devel-ubuntu20.04
RUN apt-get update && apt-get install -y wget
# installing Golang
RUN rm -rf /usr/local/go && wget https://go.dev/dl/go1.23.4.linux-amd64.tar.gz && tar -C /usr/local -xzf go1.23.4.linux-amd64.tar.gz
ENV PATH=$PATH:/usr/local/go/bin:/root/go/bin
RUN go install github.com/ei-sugimoto/cudair@latest
WORKDIR /app
COPY . .
CMD ["cudair", "run", "-c", ".cudair.toml"]
building Image...
docker build -t cudair-sample
creating container...
docker run --rm -it --gpus all -v path/to/your_project:/app cudair-sample