Projet

Général

Profil

Install the platform » Historique » Version 28

Arnaud Sevin, 10/11/2015 14:08

1 14 Arnaud Sevin
{{toc}}
2 1 Damien Gratadour
3 14 Arnaud Sevin
h1. Install the platform without MAGMA
4
5 1 Damien Gratadour
The COMPASS platform is distributed as a single bundle of CArMA and SuTrA libraries and YoGA and its AO extension for Yorick. 
6
7
h2. Hardware requirements
8 2 Damien Gratadour
9 10 Damien Gratadour
The system must contain at least an x86 CPU and a CUDA capable GPU. list of compatible GPUs can be found here http://www.nvidia.com/object/cuda_gpus.html. Specific requirements apply to clusters (to be updated).
10 1 Damien Gratadour
11
h2. Environment requirements
12 2 Damien Gratadour
13 28 Arnaud Sevin
The system must be running a 64 bit distribution of Linux with the latest NVIDIA drivers and "CUDA toolkit":https://developer.nvidia.com/cuda-downloads. The following installation instructions are valid if the default installation paths have been selected for these components.
14 1 Damien Gratadour
15 28 Arnaud Sevin
Additionally, to benefit from the user-oriented features of the platform, Anaconda should be installed.
16
In the last versions of compass (r608+), Yorick is no more supported.
17 3 Damien Gratadour
18 28 Arnaud Sevin
For the widget, you also need pyQTgraph. You can install it like this : 
19 4 Damien Gratadour
<pre>
20 28 Arnaud Sevin
pip install pyqtgraph 
21 3 Damien Gratadour
</pre>
22 1 Damien Gratadour
23
h2. Installation process
24
25
First check out the latest version from the svn repository :
26
<pre>
27
svn co https://version-lesia.obspm.fr/repos/compass compass
28
</pre>
29 3 Damien Gratadour
then go in the newly created directory and then trunk:
30 1 Damien Gratadour
<pre>
31
cd compass/trunk
32
</pre>
33 28 Arnaud Sevin
once there, you need to modify system variables in our .bashrc :
34 1 Damien Gratadour
<pre>
35 28 Arnaud Sevin
# CUDA default definitions
36
export CUDA_ROOT=$CUDA_ROOT #/usr/local/cuda
37
export CUDA_INC_PATH=$CUDA_ROOT/include
38
export CUDA_LIB_PATH=$CUDA_ROOT/lib
39
export CUDA_LIB_PATH_64=$CUDA_ROOT/lib64
40
export CPLUS_INCLUDE_PATH=$CUDA_INC_PATH
41
export PATH=$CUDA_ROOT/bin:$PATH
42 1 Damien Gratadour
</pre>
43 28 Arnaud Sevin
in this file, you also have to indicate the proper architecture of your GPU so as the compiler will generate the appropriate code.
44 1 Damien Gratadour
<pre>
45
export GENCODE="arch=compute_12,code=sm_12"
46
</pre>
47
and change both 12 to your architecture : for instance a Tesla Fermi will have 2.0 computing capabilities so change 12 to 20, a Kepler GPU will have 3.0 or 3.5 (K20) computing capabilities, change 12 to 30 (or 35).
48
49 28 Arnaud Sevin
If you are using CULA, you have to specify it:
50 1 Damien Gratadour
<pre>
51 28 Arnaud Sevin
# CULA default definitions
52
export CULA_ROOT= /usr/local/cula
53
export CULA_INC_PATH= $CULA_ROOT/include
54
export CULA_LIB_PATH= $CULA_ROOT/lib
55
export CULA_LIB_PATH_64= $CULA_ROOT/lib64
56 1 Damien Gratadour
</pre>
57
58 28 Arnaud Sevin
If you are using MAGMA, you have to specify it:
59 12 Damien Gratadour
<pre>
60 28 Arnaud Sevin
# MAGMA definitions (uncomment this line if MAGMA is installed)
61
export MAGMA_ROOT=/usr/local/magma
62
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$MAGMA_ROOT/lib
63
export PKG_CONFIG_PATH=$MAGMA_ROOT/lib/pkgconfig
64 1 Damien Gratadour
</pre>
65 28 Arnaud Sevin
66
Last variables to define:
67 14 Arnaud Sevin
<pre>
68 28 Arnaud Sevin
export COMPASS_ROOT=/path/to/compass/trunk
69
export NAGA_ROOT=$COMPASS_ROOT/naga
70
export SHESHA_ROOT=$COMPASS_ROOT/shesha
71
export LD_LIBRARY_PATH=$COMPASS_ROOT/libcarma:$COMPASS_ROOT/libsutra:$CUDA_LIB_PATH_64:$CUDA_LIB_PATH:$CULA_LIB_PATH_64:$CULA_LIB_PATH:$LD_LIBRARY_PATH
72 1 Damien Gratadour
</pre>
73
74 28 Arnaud Sevin
Once this is done, you're ready to compile the whole library:
75 1 Damien Gratadour
<pre>
76 28 Arnaud Sevin
make clean install
77 18 Arnaud Sevin
</pre>
78
79 28 Arnaud Sevin
If you did not get any error, CArMA, SuTrA, NAGA and SHESHA are now installed on your machine. You can check that everything is working by launching a GUI to test a simulation:
80
<pre>
81
cd $SHESHA_ROOT/widgets && ipython -i widget_ao.py
82
</pre>
83
84 14 Arnaud Sevin
h1. Install the platform with MAGMA
85 1 Damien Gratadour
86
h2. Why MAGMA ?
87
88
The MAGMA project aims to develop a dense linear algebra library similar to LAPACK but for heterogeneous/hybrid architectures, starting with current "Multicore+GPU" systems.
89
90
Unlike CULA, MAGMA propose a dense linear algebra library handling double for free.
91 24 pierre kestener
92 1 Damien Gratadour
But MAGMA needs a LAPACK and a BLAS implementation. Actually, we try two options : ATLAS BLAS (free, easy to install) and MKL (free, need a registration but more powerful)
93
94
h2. Dependencies : gfortran
95
96 26 Arnaud Sevin
Use your package manager to install dependencies:
97
* on scientific linux : yum install gcc-gfortran libgfortran
98 1 Damien Gratadour
* on debian : apt-get install gfortran gfortran-multilib
99
100 28 Arnaud Sevin
h2. Configure MAGMA with openBLAS
101 1 Damien Gratadour
102 28 Arnaud Sevin
h3. Dependencies : openblas (http://www.openblas.net)
103 1 Damien Gratadour
104 28 Arnaud Sevin
First, clone the GIT repository:
105
<pre>
106
git clone https://github.com/xianyi/OpenBLAS.git
107
</pre>
108 1 Damien Gratadour
109 28 Arnaud Sevin
compile it:
110
<pre>
111
cd OpenBLAS/
112
make
113
</pre>
114 14 Arnaud Sevin
115 28 Arnaud Sevin
install it:
116
<pre>
117
sudo make install PREFIX=/usr/local/openblas-haswellp-r0.2.14.a
118
</pre>
119 14 Arnaud Sevin
120 28 Arnaud Sevin
add to you .bashrc:
121
<pre>
122
export OPENBLAS_ROOT=/usr/local/openblas-haswellp-r0.2.14.a
123
</pre>
124 1 Damien Gratadour
125
h3. extraction
126 14 Arnaud Sevin
127 1 Damien Gratadour
MAGMA is available here : http://icl.cs.utk.edu/magma/software/index.html
128 14 Arnaud Sevin
129
extract the tgz file and go into the new directory
130 28 Arnaud Sevin
> ~$ tar xf magma-1.7.0-b.tar.gz
131
> ~$ cd magma-1.7.0
132 14 Arnaud Sevin
133
h3. configuration
134 1 Damien Gratadour
135 28 Arnaud Sevin
You have to create your own make.inc based on make.inc.openblas:
136 1 Damien Gratadour
137 28 Arnaud Sevin
example : *please verify GPU_TARGET, LAPACKDIR, ATLASDIR, CUDADIR*
138 1 Damien Gratadour
139
<pre><code class="Makefile">
140
#//////////////////////////////////////////////////////////////////////////////
141 28 Arnaud Sevin
#   -- MAGMA (version 1.7.0) --
142 1 Damien Gratadour
#      Univ. of Tennessee, Knoxville
143
#      Univ. of California, Berkeley
144
#      Univ. of Colorado, Denver
145 28 Arnaud Sevin
#      @date September 2015
146 1 Damien Gratadour
#//////////////////////////////////////////////////////////////////////////////
147
148 28 Arnaud Sevin
# GPU_TARGET contains one or more of Tesla, Fermi, or Kepler,
149
# to specify for which GPUs you want to compile MAGMA:
150
#     Tesla  - NVIDIA compute capability 1.x cards (no longer supported in CUDA 6.5)
151
#     Fermi  - NVIDIA compute capability 2.x cards
152
#     Kepler - NVIDIA compute capability 3.x cards
153
# The default is "Fermi Kepler".
154 1 Damien Gratadour
# See http://developer.nvidia.com/cuda-gpus
155 28 Arnaud Sevin
#
156
GPU_TARGET ?= Kepler
157 1 Damien Gratadour
158 28 Arnaud Sevin
# --------------------
159
# programs
160 1 Damien Gratadour
161
CC        = gcc
162 28 Arnaud Sevin
CXX       = g++
163 1 Damien Gratadour
NVCC      = nvcc
164
FORT      = gfortran
165
166
ARCH      = ar
167
ARCHFLAGS = cr
168
RANLIB    = ranlib
169
170
171 28 Arnaud Sevin
# --------------------
172
# flags
173 1 Damien Gratadour
174 28 Arnaud Sevin
# Use -fPIC to make shared (.so) and static (.a) library;
175
# can be commented out if making only static library.
176
FPIC      = -fPIC
177 14 Arnaud Sevin
178 28 Arnaud Sevin
CFLAGS    = -O3 $(FPIC) -DADD_ -Wall -fopenmp 
179
FFLAGS    = -O3 $(FPIC) -DADD_ -Wall -Wno-unused-dummy-argument
180
F90FLAGS  = -O3 $(FPIC) -DADD_ -Wall -Wno-unused-dummy-argument -x f95-cpp-input
181
NVCCFLAGS = -O3         -DADD_       -Xcompiler "$(FPIC)"
182
LDFLAGS   =     $(FPIC)              -fopenmp
183 14 Arnaud Sevin
184 1 Damien Gratadour
185 28 Arnaud Sevin
# --------------------
186
# libraries
187 17 Arnaud Sevin
188 28 Arnaud Sevin
# gcc with OpenBLAS (includes LAPACK)
189
LIB       = -lopenblas
190 17 Arnaud Sevin
191 28 Arnaud Sevin
LIB      += -lcublas -lcudart
192 17 Arnaud Sevin
193
194 28 Arnaud Sevin
# --------------------
195
# directories
196 17 Arnaud Sevin
197 28 Arnaud Sevin
# define library directories preferably in your environment, or here.
198
OPENBLASDIR = /usr/local/openblas-haswellp-r0.2.14.a
199
CUDADIR = /usr/local/cuda
200
-include make.check-openblas
201
-include make.check-cuda
202 17 Arnaud Sevin
203 28 Arnaud Sevin
LIBDIR    = -L$(CUDADIR)/lib64 \
204
            -L$(OPENBLASDIR)/lib
205 17 Arnaud Sevin
206
INC       = -I$(CUDADIR)/include
207
</code></pre>
208
209
h2. Configure MAGMA with MKL
210
211
h3. extraction
212
213
To download MKL, you have to create a account here : https://registrationcenter.intel.com/RegCenter/NComForm.aspx?ProductID=1517
214
215
extract l_ccompxe_2013_sp1.1.106.tgz and go into l_ccompxe_2013_sp1.1.106
216
217
install it with ./install_GUI.sh and add IPP stuff to default choices
218
219
h3. configuration
220
221 28 Arnaud Sevin
You have to create your own make.inc based on make.inc.mkl-gcc-ilp64:
222
223
example: *please verify GPU_TARGET, MKLROOT, CUDADIR*
224 17 Arnaud Sevin
<pre><code class="Makefile">
225
#//////////////////////////////////////////////////////////////////////////////
226 28 Arnaud Sevin
#   -- MAGMA (version 1.7.0) --
227 19 Arnaud Sevin
#      Univ. of Tennessee, Knoxville
228
#      Univ. of California, Berkeley
229 17 Arnaud Sevin
#      Univ. of Colorado, Denver
230 28 Arnaud Sevin
#      @date September 2015
231 17 Arnaud Sevin
#//////////////////////////////////////////////////////////////////////////////
232 14 Arnaud Sevin
233
# GPU_TARGET contains one or more of Tesla, Fermi, or Kepler,
234
# to specify for which GPUs you want to compile MAGMA:
235 28 Arnaud Sevin
#     Tesla  - NVIDIA compute capability 1.x cards (no longer supported in CUDA 6.5)
236 14 Arnaud Sevin
#     Fermi  - NVIDIA compute capability 2.x cards
237
#     Kepler - NVIDIA compute capability 3.x cards
238 28 Arnaud Sevin
# The default is "Fermi Kepler".
239 14 Arnaud Sevin
# See http://developer.nvidia.com/cuda-gpus
240
#
241 28 Arnaud Sevin
#GPU_TARGET ?= Fermi Kepler
242 14 Arnaud Sevin
243 28 Arnaud Sevin
# --------------------
244
# programs
245
246 20 Arnaud Sevin
CC        = gcc
247 28 Arnaud Sevin
CXX       = g++
248 20 Arnaud Sevin
NVCC      = nvcc
249
FORT      = gfortran
250
251
ARCH      = ar
252
ARCHFLAGS = cr
253
RANLIB    = ranlib
254
255
256 28 Arnaud Sevin
# --------------------
257
# flags
258 20 Arnaud Sevin
259 28 Arnaud Sevin
# Use -fPIC to make shared (.so) and static (.a) library;
260
# can be commented out if making only static library.
261
FPIC      = -fPIC
262
263
CFLAGS    = -O3 $(FPIC) -DADD_ -Wall -Wshadow -fopenmp -DMAGMA_WITH_MKL
264
FFLAGS    = -O3 $(FPIC) -DADD_ -Wall -Wno-unused-dummy-argument
265
F90FLAGS  = -O3 $(FPIC) -DADD_ -Wall -Wno-unused-dummy-argument -x f95-cpp-input
266
NVCCFLAGS = -O3         -DADD_       -Xcompiler "$(FPIC) -Wall -Wno-unused-function"
267
LDFLAGS   =     $(FPIC)              -fopenmp
268
269
# Defining MAGMA_ILP64 or MKL_ILP64 changes magma_int_t to int64_t in include/magma_types.h
270
CFLAGS    += -DMKL_ILP64
271
FFLAGS    += -fdefault-integer-8
272
F90FLAGS  += -fdefault-integer-8
273
NVCCFLAGS += -DMKL_ILP64
274
275
# Options to do extra checks for non-standard things like variable length arrays;
276
# it is safe to disable all these
277
CFLAGS   += -pedantic -Wno-long-long
278
#CFLAGS   += -Werror  # uncomment to ensure all warnings are dealt with
279
CXXFLAGS := $(CFLAGS) -std=c++98
280
CFLAGS   += -std=c99
281
282
283
# --------------------
284
# libraries
285
286
# IMPORTANT: this link line is for 64-bit int !!!!
287
# For regular 64-bit builds using 64-bit pointers and 32-bit int,
288
# use the lp64 library, not the ilp64 library. See make.inc.mkl-gcc or make.inc.mkl-icc.
289
# see MKL Link Advisor at http://software.intel.com/sites/products/mkl/
290
# gcc with MKL 10.3, Intel threads, 64-bit int
291
# note -DMAGMA_ILP64 or -DMKL_ILP64, and -fdefault-integer-8 in FFLAGS above
292
LIB       = -lmkl_intel_ilp64 -lmkl_intel_thread -lmkl_core -lpthread -lstdc++ -lm -liomp5 -lgfortran
293
294
LIB      += -lcublas -lcudart
295
296
297
# --------------------
298
# directories
299
300 14 Arnaud Sevin
# define library directories preferably in your environment, or here.
301
# for MKL run, e.g.: source /opt/intel/composerxe/mkl/bin/mklvars.sh intel64
302 28 Arnaud Sevin
#MKLROOT ?= /opt/intel/composerxe/mkl
303
#CUDADIR ?= /usr/local/cuda
304 14 Arnaud Sevin
-include make.check-mkl
305
-include make.check-cuda
306
307 28 Arnaud Sevin
LIBDIR    = -L$(CUDADIR)/lib64 \
308
            -L$(MKLROOT)/lib/intel64
309 14 Arnaud Sevin
310 28 Arnaud Sevin
INC       = -I$(CUDADIR)/include \
311
            -I$(MKLROOT)/include
312 14 Arnaud Sevin
</code></pre>
313 15 Arnaud Sevin
314
In this example, I use gcc but with MKL, you can use icc instead of gcc. In this case, you have to compile yorick with icc. For this, you have to change the CC flag in Make.cfg  
315
316
h2. compilation and installation
317
318
h3. compilation
319 1 Damien Gratadour
320
just compile the shared target (and test if you want)
321 28 Arnaud Sevin
> ~$ make -j 8 shared sparse
322 1 Damien Gratadour
323
h3. installation
324
325
To install libraries and include files in a given prefix, run:
326
> ~$ make install prefix=/usr/local/magma
327
  
328
The default prefix is /usr/local/magma. You can also set prefix in make.inc.
329
330
h3. tune (not tested)
331
332
For multi-GPU functions, set $MAGMA_NUM_GPUS to set the number of GPUs to use.
333
For multi-core BLAS libraries, set $OMP_NUM_THREADS or $MKL_NUM_THREADS or $VECLIB_MAXIMUM_THREADS to set the number of CPU threads, depending on your BLAS library.
334
335
h2. Platform installation
336
337
Just just define $MAGMA_PATH and use the standard procedure