From eb156f72b663b0601704fc01e505d76f0975a63d Mon Sep 17 00:00:00 2001 From: yuluo-yx Date: Wed, 13 May 2026 23:23:17 +0800 Subject: [PATCH] Makefile: auto-detect Debian/Ubuntu CUDA installation --- Makefile | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/Makefile b/Makefile index 42cde3c3..b2401e2a 100644 --- a/Makefile +++ b/Makefile @@ -20,6 +20,16 @@ CPU_CORE_OBJS = ds4_cpu.o else CFLAGS += -D_GNU_SOURCE -fno-finite-math-only CUDA_HOME ?= /usr/local/cuda + +# Auto-detect Debian/Ubuntu apt-installed CUDA. +ifeq ($(UNAME_S),Linux) +ifeq ($(wildcard $(CUDA_HOME)/bin/nvcc),) +ifneq ($(wildcard /usr/bin/nvcc),) +CUDA_HOME := /usr +endif +endif +endif + NVCC ?= $(CUDA_HOME)/bin/nvcc CUDA_ARCH ?= ifneq ($(strip $(CUDA_ARCH)),)