Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
64 bit vs. 32 bit
07-25-2006, 12:57 AM
Post: #1
64 bit vs. 32 bit
Someone told me that perhaps a 64-bit compiled binary version of VDrift might run more slowly than a 32-bit version when run on a 64-bit machine. Can anyone who is running VDrift on AMD64 give us any insight into the differences in performance for the different compilation methods? One easy way to "benchmark" VDrift would be to record a replay of some lenght on a track with many objects and observe the difference in framerate when replaying using both 32 bit and 64 bit, using the same camera position (best to use one behind the car). I know VDrift doesn't spit out an average framerate or anything, that might be helpful and wouldn't be very hard to implement. Let me know if anyone can work on this and if you need any help, I'm happy to...
Visit this user's website Find all posts by this user
Quote this message in a reply
07-25-2006, 01:30 AM
Post: #2
Re: 64 bit vs. 32 bit
thelusiv Wrote:Someone told me that perhaps a 64-bit compiled binary version of VDrift might run more slowly than a 32-bit version when run on a 64-bit machine. Can anyone who is running VDrift on AMD64 give us any insight into the differences in performance for the different compilation methods?

i run vdrift in 64-bit mode on my desktop computer under linux. i'll try to compile a 32 bit version tomorrow and run it and i'll let you know if i see any difference. all i can say is my desktop runs a lot faster than my 32-bit laptop (but that's not a fair comparison).

--alex--
Find all posts by this user
Quote this message in a reply
07-25-2006, 08:39 AM
Post: #3
 
I'm on 64-bit, but haven't been able to get 32-bit to run to compare. How can i tell scons to build 32-bit?

Cory
Find all posts by this user
Quote this message in a reply
07-25-2006, 09:43 AM
Post: #4
 
I don't know how to tell it to compile 32-bit, I'd guess tell it to use a different arch than x86-64. I guess we should make a scons option for it...
Visit this user's website Find all posts by this user
Quote this message in a reply
07-25-2006, 01:54 PM
Post: #5
 
Alright I've made an attempt to get VDrift to compile for the arch you want...Just checked in some new options to scons that allow you to say
Code:
scons arch=a64
To force scons to optimize for Athlon 64, or
Code:
scons arch=axp
to optimize for Athlon XP. Other possible values are arch=p4 for Pentium 4 optimization or the default which is arch=x86.

The way I do this is using the -march flag to gcc, and when you specify x86 it doesn't set any -march flag (because there is no "generic architecture" set). I may change that behavior to -mtune=generic.

Now I'm not really sure if this is really the way to put gcc into 32-bit mode...but it's a start. So I'm not sure if that will really do anything at all, but...try it. Smile
Visit this user's website Find all posts by this user
Quote this message in a reply
07-27-2006, 12:15 PM
Post: #6
 
Well that does not work. Not a valid arch message, i'll look around a bit. I think i have every thing setup to build 32 bit, as i have done it before.
Find all posts by this user
Quote this message in a reply
07-27-2006, 12:20 PM
Post: #7
 
What's the message you get?

How do you set up a 32-bit build? If you tell me I can make scons do it for you...
Visit this user's website Find all posts by this user
Quote this message in a reply
07-27-2006, 05:13 PM
Post: #8
 
Sorry i started this reply and got confused, I've been on other thing(USB pendrive)

Normal install ot arch=x86 gives, :
objdump -f ./vdrift

./vdrift: file format elf64-x86-64
architecture: i386:x86-64, flags 0x00000112:
EXEC_P, HAS_SYMS, D_PAGED
start address 0x0000000000407b80

where as:
objdump -f /usr/bin/mplayer

/usr/bin/mplayer: file format elf32-i386
architecture: i386, flags 0x00000112:
EXEC_P, HAS_SYMS, D_PAGED
start address 0x080a3cc0

If i try a arch=a64 build

scons arch=a64 install
scons: Reading SConscript files ...
Checking for main() in C library openal... yes
Checking for main() in C library alut... yes
Checking for C++ header file GL/gl.h... yes
Checking for C++ header file GL/glu.h... yes
Checking for C++ header file SDL/SDL.h... yes
Checking for C++ header file SDL/SDL_image.h... yes
Checking for C++ header file SDL/SDL_net.h... yes
Checking for C++ header file AL/al.h... yes
Checking for C++ header file AL/alc.h... yes
Checking for C++ header file AL/alut.h... yes
Checking for C header file libintl.h... yes
NameError: name 'enf' is not defined:
File "SConstruct", line 263:
enf.Append(CCFLAGS="-march=athlon64")

I'm trying to find how i build the 32-bit mplayer

Oh yeah if you do a custom USB pendrive, LOCK YOU BIOS :shock:
Find all posts by this user
Quote this message in a reply
07-27-2006, 06:38 PM
Post: #9
 
clytle374 Wrote:NameError: name 'enf' is not defined:
File "SConstruct", line 263:
enf.Append(CCFLAGS="-march=athlon64")

this is fixed in svn. do build a 32-bit executable you need to pass -m32 to gcc (just replace the -march=athlon64 with -m32)

--alex--
Find all posts by this user
Quote this message in a reply
07-27-2006, 07:35 PM
Post: #10
 
Thanks for pointing that out alex, somehow I totally missed that.

So for -m32, how do you force a 64-bit build? I'm guessing -m64?

Is it possible to cross-compile 64-bit binaries on a 32-bit machine, running 32-bit libraries?
Visit this user's website Find all posts by this user
Quote this message in a reply
07-27-2006, 10:15 PM
Post: #11
 
Hey, if i were to do somthin stupid to a file how do i get SVN to replace it?
Find all posts by this user
Quote this message in a reply
07-27-2006, 11:02 PM
Post: #12
 
I delete the file (above post)and ran SVN, seemed to work, is this OK practice.

Code:
#if env['arch'] == 'x86':
#    env.Append(CCFLAGS="-march= -mtune=generic")
if env['arch'] == 'axp':
    env.Append(CCFLAGS="-march=athlon-xp")
elif env['arch'] == 'p4':
    env.Append(CCFLAGS="-march=pentium4")
elif env['arch'] == 'a64':
    env.Append(CCFLAGS="[color=red]-m32[/color]")


running
scons arch=a64 install


returned
Code:
build/gui/textbox.o: In function `VGUI::TextBox::TextBox(VGUI::Widget*)':
textbox.cpp:(.text+0x211e): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::assign(char const*, unsigned int)'
textbox.cpp:(.text+0x2139): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::assign(char const*, unsigned int)'
build/gui/toggle.o: In function `VGUI::Toggle::Toggle(VGUI::Widget*)':
toggle.cpp:(.text+0xb26): undefined reference to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::assign(char const*, unsigned int)'
build/gui/toggle.o:toggle.cpp:(.text+0x1626): more undefined references to `std::basic_string<char, std::char_traits<char>, std::allocator<char> >::assign(char const*, unsigned int)' follow
collect2: ld returned 1 exit status
scons: *** [build/vdrift] Error 1
scons: building terminated because of errors.

I think i'm missing the 32 bit somthing here, Any ideas on what? Better yet How do i track an error like this. ie how to find where "std::basic_string<char" comes from.

How would you detect deps for the target arch not "running or default" one, this could be a problem right?
Find all posts by this user
Quote this message in a reply
07-27-2006, 11:31 PM
Post: #13
 
The definition of a string is in string.h. I'm not sure why it would be missing that file. There are a lot of files that use string.h that usually get compiled before that one, so that's strange that it should complain about it there.

In the code block the color tags are not really in the SConstruct are they?

I wish I had a 64-bit machine to test this stuff on.
Visit this user's website Find all posts by this user
Quote this message in a reply
07-28-2006, 12:23 AM
Post: #14
 
No the color code was from a cut and paste, from a post draft, it not in the code.

Oh i cut that down for size it had been gagging for a while before that.

And a bunch of these.
Code:
/usr/bin/ld: warning: i386 architecture of input file `build/main.o' is incompatible with i386:x86-64 output
I don't get this because the i386:x86_64 output is the ouput of a 64 bit build and it works, Oh course these errors may have always been there.

Sorry I can't answer the 64 bit question, I have ask some of these before trying to get a 32 bit mplayer to work (only way to use all codecs) I got a bunch of install this RPM and that RPM but no answers as to what is happening. I gues it time for a linux from scrach book.

string.h lives in user/include/(asm-i386 & asm-x86_64) there are a few more laying around, but nothing arch dependant (I believe)

thelusiv Can you get a 939 pin MB to go with the rest of your system?
Cory
Find all posts by this user
Quote this message in a reply
07-28-2006, 01:11 AM
Post: #15
 
I keep finding a ref to -target= on the web, may be this is what we need.

Also the arch=athlon64 got me about +8FPS, very nice.

Cory
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)