Compiling Applications for Linux

Message boards : Number crunching : Compiling Applications for Linux
Message board moderation

To post messages, you must log in.

Previous · 1 · 2 · 3 · 4 · 5 · Next

AuthorMessage
Profile jason_gee
Volunteer developer
Volunteer tester
Avatar

Send message
Joined: 24 Nov 06
Posts: 7489
Credit: 91,093,184
RAC: 0
Australia
Message 1518257 - Posted: 19 May 2014, 16:37:00 UTC - in response to Message 1518176.  

Wow, a lot has been happening.

I am wondering: who used to do the public Linux builds? I have a feeling that, in this situation at least, I may be more useful as a tester rather than a developer - I don't mind keeping up with various builds. Getting a successful build is one thing, making an optimised build that's better than what I have now might be something else. Main reason I'm wanting to do this is that I'm quite surprised at the drop in performance migrating from WinXP, especially for MB CUDA (x41g vs x41zc). I've done switches between Windows and Linux before, but only on less powerful CPU/GPUs.


Aaron Haviland helped me do the older x41g builds, which after that I tweaked to get running with x41zc. The only reason they never appeared as stock, is that the project staff never had time to install the app at Beta for some decent wider testing.

Since that time it appears that Linux Kernels, C-runtimes and Display drivers have been transitioning toward the more heavily featured modern technologies, such as memory virtualisation and certain kinds of optimisation.

It's those features precisely in Windows Vista+ WDDM model (after XP-DM) that create the slowdowns (high latencies/stalling, and underutilisation). There are techniques to handle that, though special tools necessary to get it right on a generic basis... being worked on.

So, using our old trusty crusty code, Linux and Mac will likely, for a little while, appear to suffer a performance regression also... Though that's really a function of *us* adapting to new better technologies, as opposed to a genuine design flaw.
"Living by the wisdom of computer science doesn't sound so bad after all. And unlike most advice, it's backed up by proofs." -- Algorithms to live by: The computer science of human decisions.
ID: 1518257 · Report as offensive
Wedge009
Volunteer tester
Avatar

Send message
Joined: 3 Apr 99
Posts: 451
Credit: 431,396,357
RAC: 553
Australia
Message 1518345 - Posted: 19 May 2014, 19:08:12 UTC

Thanks, Claggy. Although, I read that fast maths switches allows for 'unsafe' optimisations (ie in terms of floating-point accuracy). How does that affect our results?

That's an interesting point, jason. I wonder if that relates to my observation that I never really needed to 'reserve CPU cores' for AP GPU work in WinXP - I only really had to start doing it as more of my systems moved to Win7. Only exception being the AMD APUs.
Soli Deo Gloria
ID: 1518345 · Report as offensive
Claggy
Volunteer tester

Send message
Joined: 5 Jul 99
Posts: 4654
Credit: 47,537,079
RAC: 4
United Kingdom
Message 1518353 - Posted: 19 May 2014, 19:31:21 UTC - in response to Message 1518345.  
Last modified: 19 May 2014, 19:46:41 UTC

Thanks, Claggy. Although, I read that fast maths switches allows for 'unsafe' optimisations (ie in terms of floating-point accuracy). How does that affect our results?

That's an interesting point, jason. I wonder if that relates to my observation that I never really needed to 'reserve CPU cores' for AP GPU work in WinXP - I only really had to start doing it as more of my systems moved to Win7. Only exception being the AMD APUs.

Been doing a bit more compiling, had a look at the Debian build log for their 7.28 i386 app (the log for AMD64 isn't available)

https://buildd.debian.org/status/fetch.php?pkg=boinc-app-seti&arch=i386&ver=7.28~svn2203-1&stamp=1397468146

and wittled down:

CFLAGS="-g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -I/usr/include/boinc -I/usr/include/boinc/lib -I/usr/include/boinc/api -O3" CXXFLAGS="-g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -I/usr/include/boinc -I/usr/include/boinc/lib -I/usr/include/boinc/api -O3" CPPFLAGS="-D_FORTIFY_SOURCE=2" LDFLAGS="-fPIE -pie -Wl,-z,relro -Wl,-z,now" \
BOINCDIR=/usr/include/boinc dh_auto_configure --builddirectory=nographics \
-- --disable-static-client --disable-static --enable-shared --enable-client --disable-server --enable-dependency-tracking --with-gnu-ld --disable-altivec --disable-graphics

to (i took the section in red out because i haven't built static libs):

./configure CFLAGS="-g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -I/${HOME}/boinc -I/${HOME}/boinc/lib -I/${HOME}/boinc/api -O3" CXXFLAGS="-g -O2 -fPIE -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -I/${HOME}/boinc -I/${HOME}/boinc/lib -I/${HOME}/boinc/api -O3" CPPFLAGS="-D_FORTIFY_SOURCE=2" LDFLAGS="-static-libgcc -fPIE -pie -Wl,-z,relro -Wl,-z,now" BOINCDIR=${HOME}/boinc --enable-client --disable-server --enable-dependency-tracking --enable-static --with-gnu-ld

This produces an app on par with the Stock 7.01_x86_64 app:

KWSN-Linux-MBbench v2.1.08
Running on stephen-SR700 at Mon 19 May 2014 18:17:36 UTC
----------------------------------------------------------------
Starting benchmark run...
----------------------------------------------------------------
Listing wu-file(s) in /testWUs :
A1_WisGenA.wu
A2_WisGenA.wu
PG0009_v7.wu
PG0395_v7.wu
PG0444_v7.wu
PG1327_v7.wu
refquick_v7.wu

Listing executable(s) in /APPS :
setiathome-7.28.x86_64-pc-linux-gnu

Listing executable in /REF_APPS :
setiathome_7.01_x86_64-pc-linux-gnu
----------------------------------------------------------------
Current WU: A1_WisGenA.wu

----------------------------------------------------------------
Skipping default app setiathome_7.01_x86_64-pc-linux-gnu, displaying saved result(s)
Elapsed Time: ....................... 24 seconds
----------------------------------------------------------------
Running app with command : .......... setiathome-7.28.x86_64-pc-linux-gnu -standalone -verbose
./setiathome-7.28.x86_64-pc-linux-gnu -standalone -verbose 22.16 sec 18.67 sec 1.47 sec
Elapsed Time : ...................... 22 seconds
Speed compared to default : ......... 109 %
-----------------
Comparing results
Result : Strongly similar, Q= 99.99%

----------------------------------------------------------------
Done with A1_WisGenA.wu

====================================================================
Current WU: A2_WisGenA.wu

----------------------------------------------------------------
Skipping default app setiathome_7.01_x86_64-pc-linux-gnu, displaying saved result(s)
Elapsed Time: ....................... 23 seconds
----------------------------------------------------------------
Running app with command : .......... setiathome-7.28.x86_64-pc-linux-gnu -standalone -verbose
./setiathome-7.28.x86_64-pc-linux-gnu -standalone -verbose 21.87 sec 18.39 sec 1.47 sec
Elapsed Time : ...................... 22 seconds
Speed compared to default : ......... 104 %
-----------------
Comparing results
Result : Strongly similar, Q= 100.0%

----------------------------------------------------------------
Done with A2_WisGenA.wu

====================================================================
Current WU: PG0009_v7.wu

----------------------------------------------------------------
Skipping default app setiathome_7.01_x86_64-pc-linux-gnu, displaying saved result(s)
Elapsed Time: ....................... 852 seconds
----------------------------------------------------------------
Running app with command : .......... setiathome-7.28.x86_64-pc-linux-gnu -standalone -verbose
./setiathome-7.28.x86_64-pc-linux-gnu -standalone -verbose 827.61 sec 822.84 sec 2.02 sec
Elapsed Time : ...................... 828 seconds
Speed compared to default : ......... 102 %
-----------------
Comparing results
Result : Strongly similar, Q= 100.0%

----------------------------------------------------------------
Done with PG0009_v7.wu

====================================================================
Current WU: PG0395_v7.wu

----------------------------------------------------------------
Skipping default app setiathome_7.01_x86_64-pc-linux-gnu, displaying saved result(s)
Elapsed Time: ....................... 918 seconds
----------------------------------------------------------------
Running app with command : .......... setiathome-7.28.x86_64-pc-linux-gnu -standalone -verbose
./setiathome-7.28.x86_64-pc-linux-gnu -standalone -verbose 888.43 sec 883.66 sec 1.90 sec
Elapsed Time : ...................... 888 seconds
Speed compared to default : ......... 103 %
-----------------
Comparing results
Result : Strongly similar, Q= 100.0%

----------------------------------------------------------------
Done with PG0395_v7.wu

====================================================================
Current WU: PG0444_v7.wu

----------------------------------------------------------------
Skipping default app setiathome_7.01_x86_64-pc-linux-gnu, displaying saved result(s)
Elapsed Time: ....................... 817 seconds
----------------------------------------------------------------
Running app with command : .......... setiathome-7.28.x86_64-pc-linux-gnu -standalone -verbose
./setiathome-7.28.x86_64-pc-linux-gnu -standalone -verbose 840.38 sec 834.18 sec 3.30 sec
Elapsed Time : ...................... 841 seconds
Speed compared to default : ......... 97 %
-----------------
Comparing results
Result : Strongly similar, Q= 99.98%

----------------------------------------------------------------
Done with PG0444_v7.wu

====================================================================
Current WU: PG1327_v7.wu

----------------------------------------------------------------
Skipping default app setiathome_7.01_x86_64-pc-linux-gnu, displaying saved result(s)
Elapsed Time: ....................... 628 seconds
----------------------------------------------------------------
Running app with command : .......... setiathome-7.28.x86_64-pc-linux-gnu -standalone -verbose
./setiathome-7.28.x86_64-pc-linux-gnu -standalone -verbose 636.64 sec 631.63 sec 2.03 sec
Elapsed Time : ...................... 636 seconds
Speed compared to default : ......... 98 %
-----------------
Comparing results
Result : Strongly similar, Q= 99.99%

----------------------------------------------------------------
Done with PG1327_v7.wu

====================================================================
Current WU: refquick_v7.wu

----------------------------------------------------------------
Skipping default app setiathome_7.01_x86_64-pc-linux-gnu, displaying saved result(s)
Elapsed Time: ....................... 167 seconds
----------------------------------------------------------------
Running app with command : .......... setiathome-7.28.x86_64-pc-linux-gnu -standalone -verbose
./setiathome-7.28.x86_64-pc-linux-gnu -standalone -verbose 174.30 sec 170.55 sec 1.59 sec
Elapsed Time : ...................... 175 seconds
Speed compared to default : ......... 95 %
-----------------
Comparing results
Result : Strongly similar, Q= 99.97%

----------------------------------------------------------------
Done with refquick_v7.wu

====================================================================
Hosts CPU data ...
model name : Intel(R) Core(TM)2 Duo CPU T8100 @ 2.10GHz
cpu cores : 2
cpu MHz : 2101.000
cache size : 3072 KB
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx lm constant_tsc arch_perfmon pebs bts rep_good nopl aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 lahf_lm ida dtherm tpr_shadow vnmi flexpriority

Done with Benchmark run! Removing temporary files!

Claggy
ID: 1518353 · Report as offensive
Wedge009
Volunteer tester
Avatar

Send message
Joined: 3 Apr 99
Posts: 451
Credit: 431,396,357
RAC: 553
Australia
Message 1518445 - Posted: 19 May 2014, 21:42:06 UTC

Thanks for that. So possibly better performance, but - out of this test set - up to 0.05% deviation from reference results. I still notice I get results marked as invalid every now and then, simply for not being close enough to other results returned (on both Windows and Linux hosts). This is an interesting balance to work out.
Soli Deo Gloria
ID: 1518445 · Report as offensive
Claggy
Volunteer tester

Send message
Joined: 5 Jul 99
Posts: 4654
Credit: 47,537,079
RAC: 4
United Kingdom
Message 1518743 - Posted: 20 May 2014, 14:14:06 UTC - in response to Message 1517889.  

Meanwhile on one of my Parallella's building AKv8 fails with (same as on the Pi):

In file included from main.cpp:87:0:
analyzeFuncs.h: At global scope:
analyzeFuncs.h:76:9: error: ‘__m128’ does not name a type
typedef __m128 vFloat;
^
analyzeFuncs.h:77:9: error: ‘__m128i’ does not name a type
typedef __m128i vUInt32;
^
analyzeFuncs.h:78:9: error: ‘__m128i’ does not name a type
typedef __m128i vSInt32;
^
analyzeFuncs.h:79:9: error: ‘__m128i’ does not name a type
typedef __m128i vUInt8;
^
analyzeFuncs.h:80:9: error: ‘__m128d’ does not name a type
typedef __m128d vDouble;
^
make[2]: *** [seti_boinc-main.o] Error 1
make[1]: *** [all-recursive] Error 1

Claggy

For Info, I tried building AKv8 on my C2D T8100 with just basic parameters and got the same error.

Claggy
ID: 1518743 · Report as offensive
Profile petri33
Volunteer tester

Send message
Joined: 6 Jun 02
Posts: 1668
Credit: 623,086,772
RAC: 156
Finland
Message 1518789 - Posted: 20 May 2014, 20:41:58 UTC - in response to Message 1518773.  

I'm not sure, but You might need -DUSE_CUDA when configuring the Xbranch ...
To overcome Heisenbergs:
"You can't always get what you want / but if you try sometimes you just might find / you get what you need." -- Rolling Stones
ID: 1518789 · Report as offensive
Profile petri33
Volunteer tester

Send message
Joined: 6 Jun 02
Posts: 1668
Credit: 623,086,772
RAC: 156
Finland
Message 1518813 - Posted: 20 May 2014, 21:20:41 UTC - in response to Message 1518795.  
Last modified: 20 May 2014, 21:24:23 UTC

Hmm, I guess I have had to specify BOINCDIR=/home/petri/boinc for that.
See an earlier message my configure scripts .

It was a try, edit and retry session a long time a go. I'm sorry I did not take notes what I did to get all to compile.
To overcome Heisenbergs:
"You can't always get what you want / but if you try sometimes you just might find / you get what you need." -- Rolling Stones
ID: 1518813 · Report as offensive
Claggy
Volunteer tester

Send message
Joined: 5 Jul 99
Posts: 4654
Credit: 47,537,079
RAC: 4
United Kingdom
Message 1518833 - Posted: 20 May 2014, 22:29:12 UTC - in response to Message 1518110.  

One of these listed above probably has std_fixes.h in it.

No, none of them have std_fixes.h in them, the Boinc Git repository has it,
the two steps you need to cure that error is one, get it with:

git clone git://boinc.berkeley.edu/boinc-v2.git boinc

and two, during your configure is to point at the correct location, ie for me it is:

./configure --disable-server LDFLAGS=-static-libgcc BOINCDIR=${HOME}/boinc

Claggy

BUMP.

Claggy
ID: 1518833 · Report as offensive
Claggy
Volunteer tester

Send message
Joined: 5 Jul 99
Posts: 4654
Credit: 47,537,079
RAC: 4
United Kingdom
Message 1519098 - Posted: 21 May 2014, 9:01:01 UTC - in response to Message 1518886.  

One of these listed above probably has std_fixes.h in it.

No, none of them have std_fixes.h in them, the Boinc Git repository has it,
the two steps you need to cure that error is one, get it with:

git clone git://boinc.berkeley.edu/boinc-v2.git boinc

and two, during your configure is to point at the correct location, ie for me it is:

./configure --disable-server LDFLAGS=-static-libgcc BOINCDIR=${HOME}/boinc

Claggy

BUMP.

Claggy

I did that. Configured boinc without any significant errors as far as I could see. Make worked with a few "no's" on the tests but without any significant errors as far as I could see.

Configuring Xbranch with or without CFLAGS='-DUSE_CUDA' comes up with the make "extern int cudaAcc_SafeCall_No_Sync(...)" not in scope error.

I'm stumped.

-------

I'll pick this up again in the morning. I'm technically CWI now because I've had a couple glasses of Cabernet Sauvignon. (Computing While Intoxicated....)

Your configure for Xbranch needs to point to the boinc directory, try it with:

BOINCDIR=${HOME}/Desktop/boinc

Claggy
ID: 1519098 · Report as offensive
Profile petri33
Volunteer tester

Send message
Joined: 6 Jun 02
Posts: 1668
Credit: 623,086,772
RAC: 156
Finland
Message 1519100 - Posted: 21 May 2014, 9:04:34 UTC - in response to Message 1518827.  
Last modified: 21 May 2014, 9:05:11 UTC

...

I successfully installed boinc and with the -DUSE_CUDA, I get the "can't find #include std_fixes.h" error. So successfully installing boinc didn't clear that error.

With out -DUSE_CUDA, I get the "extern int cudaAcc_SafeCall_No_Sync(...)" not in scope error.
...


So You need both -DUSE_CUDA and like Claggy said specify the boinc directory BOINCDIR=${HOME}/boinc for the Xbranch to compile.
To overcome Heisenbergs:
"You can't always get what you want / but if you try sometimes you just might find / you get what you need." -- Rolling Stones
ID: 1519100 · Report as offensive
Profile petri33
Volunteer tester

Send message
Joined: 6 Jun 02
Posts: 1668
Credit: 623,086,772
RAC: 156
Finland
Message 1519194 - Posted: 21 May 2014, 16:07:22 UTC - in response to Message 1519148.  

My first lines of cuda/cudaAcc_utilities.h is different to that in the repository ... (One extra #include and 2 declarations)

#ifndef _CUDA_ACC_UTILITIES_H
#define _CUDA_ACC_UTILITIES_H

#include<driver_types.h>

void cudaAcc_setFuncDeviceCacheConfigShared(void);
void cudaAcc_setFuncDeviceCacheConfigL1(void);

extern int cudaAcc_SafeCall_No_Sync(cudaError_t err, char* errMessage, char* file, int line);
extern int cudaAcc_SafeCall_Sync(cudaError_t err, char* errMessage, char* file, int line);
extern int cudaAcc_SafeCall_No_Sync_wExit(cudaError_t err, char* errMessage, char* file, int line);
...
To overcome Heisenbergs:
"You can't always get what you want / but if you try sometimes you just might find / you get what you need." -- Rolling Stones
ID: 1519194 · Report as offensive
Profile ivan
Volunteer tester
Avatar

Send message
Joined: 5 Mar 01
Posts: 783
Credit: 348,560,338
RAC: 223
United Kingdom
Message 1519311 - Posted: 21 May 2014, 18:42:15 UTC - in response to Message 1519194.  

My first lines of cuda/cudaAcc_utilities.h is different to that in the repository ... (One extra #include and 2 declarations)

#ifndef _CUDA_ACC_UTILITIES_H
#define _CUDA_ACC_UTILITIES_H

#include<driver_types.h>

void cudaAcc_setFuncDeviceCacheConfigShared(void);
void cudaAcc_setFuncDeviceCacheConfigL1(void);

extern int cudaAcc_SafeCall_No_Sync(cudaError_t err, char* errMessage, char* file, int line);
extern int cudaAcc_SafeCall_Sync(cudaError_t err, char* errMessage, char* file, int line);
extern int cudaAcc_SafeCall_No_Sync_wExit(cudaError_t err, char* errMessage, char* file, int line);
...


Well, cudaError_t is typedefed in driver_types.h:

/usr/local/cuda/include/driver_types.h:typedef __device_builtin__ enum cudaError cudaError_t;

and while I can find references to that file in some .o and .Po files in my s@h build area, I can't find any includes for it in s@h or BOINC source files. It is included in several other cuda header files though:

[HomePC01:~] > grep driver_types.h /usr/local/cuda/include/*.h
/usr/local/cuda/include/builtin_types.h:#include "driver_types.h"
/usr/local/cuda/include/channel_descriptor.h:#include "driver_types.h"
/usr/local/cuda/include/cublas_api.h:#include "driver_types.h"
/usr/local/cuda/include/cuda_device_runtime_api.h:#include "driver_types.h"
/usr/local/cuda/include/cuda_profiler_api.h:#include "driver_types.h"
/usr/local/cuda/include/cuda_surface_types.h:#include "driver_types.h"
/usr/local/cuda/include/cuda_texture_types.h:#include "driver_types.h"
/usr/local/cuda/include/cufft.h:#include "driver_types.h"
/usr/local/cuda/include/cufftw.h:#include "driver_types.h"
/usr/local/cuda/include/cusparse.h:#include "driver_types.h"
/usr/local/cuda/include/cusparse_v2.h:#include "driver_types.h"
/usr/local/cuda/include/driver_functions.h:#include "driver_types.h"
/usr/local/cuda/include/surface_types.h:#include "driver_types.h"
/usr/local/cuda/include/texture_types.h:#include "driver_types.h"

I have vague memories of having to include an extra header file once, but I don't remember exactly when or where.
ID: 1519311 · Report as offensive
Profile jason_gee
Volunteer developer
Volunteer tester
Avatar

Send message
Joined: 24 Nov 06
Posts: 7489
Credit: 91,093,184
RAC: 0
Australia
Message 1519740 - Posted: 22 May 2014, 13:26:03 UTC - in response to Message 1519311.  

closer to getting some time for that quick Ubuntu x64 Cuda check build. Just a couple of loose ends to tie up here, then some toolkit+driver updates.

Most likely guess IMO, newer toolkits simply unincluded driver_types.h, so should be a simple fix. That's probably because they're encouraging more usage of the Cuda runtime instead of driver API. In any case will probably have the full details for that in a couple of hours, and patch anything necessary for Linux Cuda 5.5-6 compilation.
"Living by the wisdom of computer science doesn't sound so bad after all. And unlike most advice, it's backed up by proofs." -- Algorithms to live by: The computer science of human decisions.
ID: 1519740 · Report as offensive
Previous · 1 · 2 · 3 · 4 · 5 · Next

Message boards : Number crunching : Compiling Applications for Linux


 
©2024 University of California
 
SETI@home and Astropulse are funded by grants from the National Science Foundation, NASA, and donations from SETI@home volunteers. AstroPulse is funded in part by the NSF through grant AST-0307956.