Skip to content

Commit 60b83f7

Browse files
authored
Add apptainer image 2025-04-23_tensorflow-2.17_onnx-1.20_v2 to fix compilation with MODULE_CUDA enabled (#136)
* Add new apptainer image definition * Fix compilation with new apptainer image
1 parent 5923803 commit 60b83f7

File tree

16 files changed

+1046
-1
lines changed

16 files changed

+1046
-1
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
Image based on official nvidia image tensorflow:25.02-tf2-py3.
2+
3+
Contains:
4+
- Ubuntu 24.04
5+
- CUDA 12.8
6+
- Tensorflow 2.17
7+
- ONNX 1.20.1
8+
- Python 3.12
9+
- i6 Cache Manager
10+
- Basics required to compile RASR
11+
- Additional i6 packages commonly used
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
Bootstrap: docker
2+
From: nvcr.io/nvidia/tensorflow:25.02-tf2-py3
3+
Stage: build
4+
5+
%post
6+
apt update -y
7+
8+
# all the fundamental basics, zsh is needed because calling the cache manager might launch the user shell
9+
DEBIAN_FRONTEND=noninteractive apt install -y wget git unzip gzip libssl-dev lsb-release zsh \
10+
bison libxml2-dev libopenblas-dev libsndfile1-dev libcrypto++-dev libcppunit-dev \
11+
libavformat-dev libavcodec-dev libavutil-dev parallel xmlstarlet python3-lxml htop \
12+
strace gdb sox python3-pip cmake ffmpeg vim
13+
14+
pip3 install "pybind11[global]"
15+
16+
# download the cache manager and place in /usr/local
17+
cd /usr/local
18+
git clone https://github.com/rwth-i6/cache-manager.git
19+
cd bin
20+
ln -s ../cache-manager/cf cf
21+
22+
echo /usr/local/lib/python3.12/dist-packages/tensorflow > /etc/ld.so.conf.d/tensorflow.conf
23+
24+
cd /usr/local
25+
wget -q https://github.com/microsoft/onnxruntime/releases/download/v1.20.1/onnxruntime-linux-x64-gpu-1.20.1.tgz
26+
tar xzvf onnxruntime-linux-x64-*.tgz
27+
mkdir -p /usr/local/{include,lib}
28+
mv onnxruntime-linux-x64-*/include/* /usr/local/include/
29+
mv onnxruntime-linux-x64-*/lib/* /usr/local/lib/
30+
rm -r onnxruntime-linux-x64-*
31+
ldconfig
32+
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
# Project: SPRINT
2+
# File: Config.make - auto-detected part of build environment
3+
# Revision: $Id$
4+
5+
# Look into Options.make for configurable settings !!!
6+
7+
COMPILE_MODES = standard release debug debug_light debug_dynamic
8+
PROFILE_MODES = none gprof valgrind
9+
COMPILERS = gcc icc clang
10+
11+
include $(TOPDIR)/Options.make
12+
include $(TOPDIR)/Modules.make
13+
14+
# -----------------------------------------------------------------------------
15+
# sanity check on configurable settings
16+
17+
ifeq (,$(findstring $(COMPILE), $(COMPILE_MODES)))
18+
$(error meaningful values for COMPILE are $(COMPILE_MODES))
19+
endif
20+
21+
ifneq ($(shell test $(DBG_LEVEL) -ge -1; echo $$?),0)
22+
$(error DBG_LEVEL=$(DBG_LEVEL), but meaningful values for DBG_LEVEL are [-1,0,1,...,N])
23+
endif
24+
25+
ifeq (,$(findstring $(PROFILE), $(PROFILE_MODES)))
26+
$(error meaningful values for PROFILE are $(PROFILE_MODES))
27+
endif
28+
ifeq (,$(findstring $(COMPILER), $(COMPILERS)))
29+
$(error supported values for COMPILER are $(COMPILERS))
30+
endif
31+
32+
# -----------------------------------------------------------------------------
33+
# auto-detected processor and operating system settings
34+
35+
PROC = $(shell uname -m)
36+
OS = $(shell uname -s)
37+
CPU = $(shell test -e /proc/cpuinfo && cat /proc/cpuinfo | grep "model name" | head -n 1)
38+
ifeq ($(CPU),)
39+
CPU = unknown
40+
endif
41+
42+
OS_LIST = linux darwin
43+
ifeq ($(OS),Linux)
44+
OS = linux
45+
endif
46+
ifeq ($(OS),Darwin)
47+
OS = darwin
48+
endif
49+
50+
# -----------------------------------------------------------------------------
51+
# preprocesor defines
52+
53+
ARCH = $(OS)_$(PROC)
54+
ifeq ($(COMPILE),standard)
55+
DEFINES += -DSPRINT_STANDARD_BUILD
56+
endif
57+
ifeq ($(COMPILE),release)
58+
DEFINES += -DSPRINT_RELEASE_BUILD
59+
DEFINES += -DNDEBUG
60+
endif
61+
ifeq ($(COMPILE),debug)
62+
DEFINES += -DDEBUG
63+
endif
64+
ifeq ($(COMPILE),debug_light)
65+
DEFINES += -DSPRINT_STANDARD_BUILD
66+
DEFINES += -DSPRINT_DEBUG_LIGHT
67+
endif
68+
ifeq ($(COMPILE),debug_dynamic)
69+
DEFINES += -DSPRINT_STANDARD_BUILD
70+
DEFINES += -DSPRINT_DEBUG_LIGHT
71+
endif
72+
73+
DEFINES += -DDBG_LEVEL=$(DBG_LEVEL)
74+
75+
DEFINES += -DPROC_$(PROC) -DOS_$(OS) -DARCH_$(ARCH)
76+
77+
CPPFLAGS += $(DEFINES)
78+
79+
# -----------------------------------------------------------------------------
80+
# Sprint includes
81+
82+
INCLUDES = -I. -I$(TOPDIR)/src
83+
84+
CPPFLAGS += $(INCLUDES)
85+
86+
# -----------------------------------------------------------------------------
87+
# Where and how to store object files
88+
89+
ifeq ($(PROFILE),none)
90+
ifneq ($(SUFFIX),)
91+
OBJEXT = $(OS)-$(PROC)-$(COMPILE)-$(SUFFIX)
92+
else
93+
OBJEXT = $(OS)-$(PROC)-$(COMPILE)
94+
endif # SUFFIX
95+
else
96+
OBJEXT = $(OS)-$(PROC)-$(COMPILE)-$(PROFILE)
97+
DEFINES += -DPROFILE_$(PROFILE)
98+
endif # PROFILE
99+
100+
DLIBEXT = so
101+
102+
ifeq ($(COMPILE),debug_dynamic)
103+
LIBEXT = $(DLIBEXT)
104+
else
105+
LIBEXT = a
106+
endif
107+
108+
OBJDIR = .build/$(OBJEXT)
109+
ifeq ($(BINARYFILENAMES),extended)
110+
exe = .$(OBJEXT)
111+
a = $(OBJEXT).$(LIBEXT)
112+
else
113+
exe =
114+
a = $(LIBEXT)
115+
endif
116+
117+
so = .$(DLIBEXT)
118+
119+
# -----------------------------------------------------------------------------
120+
# laod compiler specifc settings
121+
include $(TOPDIR)/config/cc-$(COMPILER).make
122+
123+
# load OS specific settings
124+
include $(TOPDIR)/config/os-$(OS).make
125+
126+
# load processor specific settings
127+
include $(TOPDIR)/config/proc-$(PROC).make
128+
129+
ifneq ($(ADDCCFLAGS),)
130+
CCFLAGS += $(ADDCCFLAGS)
131+
endif
132+
133+
# -----------------------------------------------------------------------------
134+
# enable compiler cache
135+
136+
ifneq ($(shell which ccache),)
137+
ifneq ($(shell hostname | cut -f 1 -d -),cluster)
138+
CCACHE = ccache
139+
CCACHE_UNIFY = 1
140+
CC := $(CCACHE) $(CC)
141+
CXX := $(CCACHE) $(CXX)
142+
143+
# share compiler cache inside i6
144+
ifeq ($(shell test -d /u/ccache; echo $$?),0)
145+
CCACHE_DIR = /u/ccache
146+
CCACHE_UMASK = 000
147+
endif # i6
148+
endif # cluster
149+
endif # ccache
150+
151+
# -----------------------------------------------------------------------------
152+
# common tools
153+
154+
LEX = flex
155+
YACC = bison -d
156+
LATEX = latex
157+
DVIPS = dvips
158+
MAKEINDEX = makeindex
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
include $(TOPDIR)/Config.make
Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
# Definition of used modules and tools
2+
#
3+
# The MODULE_xxx terms are available as variables in all makefiles
4+
# and as preprocessor directives in src/Modules.hh
5+
#
6+
# Those parts of Sprint which are not required for a basic ASR system
7+
# should be separated by a MODULE_ definition wherever applicable.
8+
#
9+
# If you implement a new fancy feature in Sprint:
10+
# * goal: everything can still be compiled (and run) without your source files
11+
# by simply deactivating the module in Modules.make
12+
# * try to implement your classes as loosely coupled to other classes as possible
13+
# * define a module name in Modules.make
14+
# * make the makefiles depend on that name by including 'ifdef MODULE_xxx' ... 'endif'
15+
# (remember the makefiles in Tools/*)
16+
# * frame the include files of your module by '#ifdef MODULE_xxx' ... '#endif'
17+
# do not forget to include Modules.hh
18+
# * Use '#MODF MyFile.hh' to mark files of a module if the file is not listed in the
19+
# Makefile (e.g. header files without corresponding .cc file). See Signal/Makefile
20+
# for an example
21+
22+
# ****** Adaptation ******
23+
MODULES += MODULE_ADAPT_CMLLR
24+
MODULES += MODULE_ADAPT_MLLR
25+
MODULES += MODULE_ADAPT_ADVANCED
26+
27+
# ****** Audio ******
28+
# MODULES += MODULE_AUDIO_FFMPEG
29+
MODULES += MODULE_AUDIO_FLAC
30+
MODULES += MODULE_AUDIO_HTK
31+
MODULES += MODULE_AUDIO_OSS
32+
MODULES += MODULE_AUDIO_RAW
33+
MODULES += MODULE_AUDIO_WAV_SYSTEM
34+
35+
# ****** Cache Manager integration ******
36+
MODULES += MODULE_CORE_CACHE_MANAGER
37+
38+
# ****** Cart ******
39+
MODULES += MODULE_CART
40+
41+
# ****** Flf ******
42+
MODULES += MODULE_FLF_CORE
43+
MODULES += MODULE_FLF_EXT
44+
MODULES += MODULE_FLF
45+
46+
# ****** Lattice ******
47+
MODULES += MODULE_LATTICE_BASIC
48+
MODULES += MODULE_LATTICE_HTK
49+
MODULES += MODULE_LATTICE_DT
50+
51+
# ****** Lm ******
52+
MODULES += MODULE_LM_ARPA
53+
MODULES += MODULE_LM_FSA
54+
MODULES += MODULE_LM_ZEROGRAM
55+
MODULES += MODULE_LM_TFRNN
56+
57+
# ****** Math ******
58+
MODULES += MODULE_MATH_NR
59+
60+
# ****** Mm ******
61+
MODULES += MODULE_MM_BATCH
62+
MODULES += MODULE_MM_DT
63+
64+
# ****** Neural Network ******
65+
MODULES += MODULE_NN
66+
MODULES += MODULE_NN_SEQUENCE_TRAINING
67+
MODULES += MODULE_PYTHON
68+
69+
# ****** OpenFst ******
70+
# MODULES += MODULE_OPENFST
71+
72+
# ****** Search ******
73+
MODULES += MODULE_SEARCH_MBR
74+
# MODULES += MODULE_SEARCH_WFST
75+
MODULES += MODULE_SEARCH_LINEAR
76+
MODULES += MODULE_ADVANCED_TREE_SEARCH
77+
78+
# ****** Signal ******
79+
MODULES += MODULE_SIGNAL_GAMMATONE
80+
MODULES += MODULE_SIGNAL_PLP
81+
MODULES += MODULE_SIGNAL_VTLN
82+
MODULES += MODULE_SIGNAL_VOICEDNESS
83+
MODULES += MODULE_SIGNAL_ADVANCED
84+
MODULES += MODULE_SIGNAL_ADVANCED_NR
85+
86+
# ****** Speech ******
87+
MODULES += MODULE_SPEECH_DT
88+
MODULES += MODULE_SPEECH_DT_ADVANCED
89+
MODULES += MODULE_SPEECH_ALIGNMENT_FLOW_NODES
90+
MODULES += MODULE_SPEECH_LATTICE_FLOW_NODES
91+
MODULES += MODULE_SPEECH_LATTICE_ALIGNMENT
92+
MODULES += MODULE_SPEECH_LATTICE_RESCORING
93+
94+
# ****** Unit Tests ******
95+
MODULES += MODULE_TEST
96+
97+
# ****** Intel Threading Building Blocks ******
98+
# MODULES += MODULE_TBB
99+
100+
# ****** OpenMP library
101+
# MODULES += MODULE_OPENMP
102+
# **** choose optimized blas library if available
103+
# MODULES += MODULE_INTEL_MKL
104+
# MODULES += MODULE_ACML
105+
MODULES += MODULE_CUDA
106+
107+
# Tensorflow integration
108+
MODULES += MODULE_TENSORFLOW
109+
110+
# ONNX integration
111+
MODULES += MODULE_ONNX
112+
113+
# define variables for the makefiles
114+
$(foreach module, $(MODULES), $(eval $(module) = 1))
115+
116+
# ****** Tools ******
117+
TOOLS += AcousticModelTrainer
118+
TOOLS += Archiver
119+
TOOLS += CorpusStatistics
120+
TOOLS += FeatureExtraction
121+
TOOLS += FeatureStatistics
122+
TOOLS += Fsa
123+
TOOLS += LibRASR
124+
TOOLS += Lm
125+
TOOLS += SpeechRecognizer
126+
TOOLS += Xml
127+
128+
ifdef MODULE_CART
129+
TOOLS += Cart
130+
endif
131+
132+
ifdef MODULE_MM_DT
133+
ifdef MODULE_LATTICE_DT
134+
ifdef MODULE_SPEECH_DT
135+
TOOLS += LatticeProcessor
136+
endif
137+
endif
138+
endif
139+
140+
ifdef MODULE_FLF
141+
TOOLS += Flf
142+
endif
143+
144+
ifdef MODULE_NN
145+
TOOLS += NnTrainer
146+
endif
147+
148+
# ****** Libraries ******
149+
LIBS_SEARCH = src/Search/libSprintSearch.$(a)
150+
LIBS_SEARCH += src/Search/LexiconfreeTimesyncBeamSearch/libSprintLexiconfreeTimesyncBeamSearch.$(a)
151+
LIBS_SEARCH += src/Search/TreeTimesyncBeamSearch/libSprintTreeTimesyncBeamSearch.$(a)
152+
ifdef MODULE_SEARCH_WFST
153+
LIBS_SEARCH += src/Search/Wfst/libSprintSearchWfst.$(a)
154+
LIBS_SEARCH += src/OpenFst/libSprintOpenFst.$(a)
155+
endif
156+
ifdef MODULE_ADVANCED_TREE_SEARCH
157+
LIBS_SEARCH += src/Search/AdvancedTreeSearch/libSprintAdvancedTreeSearch.$(a)
158+
endif

0 commit comments

Comments
 (0)