Supporting multiple GPU_TARGET in one application

Open discussion for MAGMA library (Matrix Algebra on GPU and Multicore Architectures)

Supporting multiple GPU_TARGET in one application

Postby mh1 » Mon Apr 01, 2013 4:58 pm

Hello,

How would I link both FERMI and KEPLER versions of the MAGMA libraries (libmagma.a and libmagmablas.a) into my application? In essence, I would like for my application to use FERMI based MAGMA unless KEPLER resources are available, but I do not want to make 2 separate application builds.
mh1
 
Posts: 22
Joined: Thu Mar 14, 2013 4:24 pm

Re: Supporting multiple GPU_TARGET in one application

Postby mgates3 » Tue Apr 02, 2013 12:12 pm

I think the best for you currently is:
1) In make.inc, set GPU_TARGET = Kepler
2) In Makefile.internal, add cuda 2.0 to the NVOPTS:

NVOPTS += -DGPUSHMEM=300 \
-gencode arch=compute_20,code=sm_20 \
-gencode arch=compute_30,code=sm_30 \
-gencode arch=compute_35,code=sm_35

-mark
mgates3
 
Posts: 546
Joined: Fri Jan 06, 2012 2:13 pm

Re: Supporting multiple GPU_TARGET in one application

Postby mh1 » Tue May 26, 2015 5:00 pm

I am now using MAGMA 1.6.2. We are in the process of integrating MAGMA into a commercial product. In the make.inc file there is this snippet :

Code: Select all
#GPU_TARGET ?= Fermi Kepler


I would like to compile my commercial application to support multiple GPU_TARGET (not just Kepler.) My understanding of this flag is I need to compile multiple binaries depending on the GPU_TARGET value. However, this is not a good bundling architecture. How would my application link to multiple copies of "libmagma" - each copy distinguished by a different GPU_TARGET - yet use the right function signature from the right libmagma library? I don't want my application to handle logic of switching MAGMA calls based on detected card on box - I think MAGMA should be handling that logic.
mh1
 
Posts: 22
Joined: Thu Mar 14, 2013 4:24 pm

Re: Supporting multiple GPU_TARGET in one application

Postby mgates3 » Wed May 27, 2015 1:20 pm

You can specify multiple CUDA architectures in GPU_TARGET. The default is "Fermi Kepler". They will all be compiled into one MAGMA library. I believe it should also be forward compatible, so it should run on newer architectures after Kepler, albeit perhaps not optimal speed.

We no longer support CUDA arch 1.x (confusingly known as Tesla), because CUDA >= 6.5 no longer supports it.

-mark
mgates3
 
Posts: 546
Joined: Fri Jan 06, 2012 2:13 pm


Return to User discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron