cross compilation to ARM with CUDA

833 views
Skip to first unread message

Arkadi

unread,
May 19, 2020, 12:32:31 PM5/19/20
to kaldi-help
Hi all,

I'm trying to compile kaldi for android with CUDA support and I got the error below :
***configure failed: Cannot cross compile with CUDA support ***

Why it is not possible ?
Any solutions please ?

Thanks

joseph.an...@gmail.com

unread,
May 19, 2020, 1:34:13 PM5/19/20
to kaldi-help
AFAIK unless you have a) CUDA for android (ARM) you won't be able to cross compile and b) unless the device has nvidia gpu (like ARM based servers and some tegra devices) it's not likely to be of any use.

Arkadi

unread,
May 20, 2020, 6:33:31 AM5/20/20
to kaldi-help
I installed cuda cross compiler,.
A new directory has added to /usr/local/cuda/targets/ named aarch64-linux on my linux os.

You can see below CUDA configuration as written in configure file

"
CUDA = true
CUDATKDIR = /usr/local/cuda
CUDA_ARCH = -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61 -gencode arch=compute_70,code=sm_70 -gencode arch=compute_75,code=sm_75

ifndef DOUBLE_PRECISION
$(error DOUBLE_PRECISION not defined.)
endif
ifndef CUDATKDIR
$(error CUDATKDIR not defined.)
endif

CXXFLAGS += -DHAVE_CUDA -I$(CUDATKDIR)/include -fPIC -pthread -isystem $(OPENFSTINC)

CUDA_INCLUDE= -I$(CUDATKDIR)/include -I$(CUBROOT)
CUDA_FLAGS =  -DHAVE_CUDA TARGET_ARCH=aarch64 TARGET_OS=linux SMS="32 53 62 72" \
             -ccbin $(CXX) -DKALDI_DOUBLEPRECISION=$(DOUBLE_PRECISION) \
             -std=c++11 -DCUDA_API_PER_THREAD_DEFAULT_STREAM  -lineinfo \
             --verbose -Xcompiler "$(CXXFLAGS)"

CUDA_LDFLAGS += -L$(CUDATKDIR)/lib64 -Wl,-rpath,$(CUDATKDIR)/lib64
CUDA_LDLIBS += -lcublas -lcusparse -lcudart -lcurand -lcufft -lnvToolsExt #LDLIBS : The .so libs are loaded later than static libs in implicit rule
"

The error is  "nvcc fatal   : Cannot compile in the 64-bit mode when the host compiler targets arm."

Thanks,
Arkadi

Hugo Braun

unread,
May 28, 2020, 6:27:31 PM5/28/20
to kaldi-help
Could you compile directly on device? CUDA cross-compilation is not supported for now
Reply all
Reply to author
Forward
0 new messages