DaemonForums  

Go Back   DaemonForums > FreeBSD > FreeBSD General

FreeBSD General Other questions regarding FreeBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 30th September 2008
chill's Avatar
chill chill is offline
Fdisk Soldier
 
Join Date: Jun 2008
Location: Federal Republic of the US
Posts: 74
Thanked 6 Times in 6 Posts
Default optimizations in kernel and apps

I guess this might be a dumb question but does FreeBSD automatically take advantage of processor specific instructions like MMX, SSE, 3DNow! etc. or do you have to explicitly add these options to the kernel and make.conf to use them?

thank you
Reply With Quote
  #2   (View Single Post)  
Old 30th September 2008
vermaden's Avatar
vermaden vermaden is offline
Administrator
 
Join Date: Apr 2008
Location: pl_PL.lodz
Posts: 1,051
Thanked 118 Times in 93 Posts
Default

Here is a complete /etc/make.conf with optimizations.
http://toya.net.pl/~vermaden/text/make.conf

Generally KERNEL suffers when you force it to use MMX or other complex instructions, so they are disabled, because of performance for the kernel itself for sure, even if you specify them in /etc/make.conf the build system will disable them because its no good.

On the other side userland apps like Mplayer take quite big advantage of these, so you should use them for userland apps, but I did not checked if Mplayer is build with them by default for example.
__________________
religions, worst damnation of mankind
"If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds

Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”.
vermaden's: links resources deviantart spreadbsd
Reply With Quote
  #3   (View Single Post)  
Old 30th September 2008
ephemera's Avatar
ephemera ephemera is offline
Knuth's homeboy
 
Join Date: Apr 2008
Posts: 537
Thanked 49 Times in 43 Posts
Default

yes, freebsd has support for those.

edit: took too long to post didn't see vermaden's post
Reply With Quote
  #4   (View Single Post)  
Old 30th September 2008
chill's Avatar
chill chill is offline
Fdisk Soldier
 
Join Date: Jun 2008
Location: Federal Republic of the US
Posts: 74
Thanked 6 Times in 6 Posts
Default

ok so if i add something like you have to my make.conf file
Code:
WITH_SSE= yes
WITH_3DNOW= yes
WITH_MMX= yes
this is going to build all my apps like this? isn't this kind of aggressive?

I was looking through mplayer documentation and saw this:
Quote:
If your CPU has SSE, recompile your kernel with "options CPU_ENABLE_SSE" (FreeBSD-STABLE or kernel patches required).
I have no idea how old some of the mplayer documentation is or if this is even relevant anymore.
Reply With Quote
  #5   (View Single Post)  
Old 30th September 2008
robbak's Avatar
robbak robbak is offline
Real Name: Robert Backhaus
VPN Cryptographer
 
Join Date: May 2008
Location: North Queensland, Australia
Posts: 366
Thanked 40 Times in 39 Posts
Default

mplayer works in two ways:

By default, it builds a binary that detects cpu features at run-time. This is a little slower.
If you adjust the port options, it will auto-detect the cpu features at build time, and build a custom binary for your processor.

I don't know if you can specify a different processor if you are building for another system, though.
__________________
The only dumb question is a question not asked.
The only dumb answer is an answer not given.
Reply With Quote
  #6   (View Single Post)  
Old 1st October 2008
BSDKaffee's Avatar
BSDKaffee BSDKaffee is offline
Real Name: Jason Hale
Coffee Addict
 
Join Date: May 2008
Location: Wintersville, Ohio
Posts: 212
Thanked 36 Times in 34 Posts
Default

Quote:
Originally Posted by chill View Post
ok so if i add something like you have to my make.conf file
Code:
WITH_SSE= yes
WITH_3DNOW= yes
WITH_MMX= yes
this is going to build all my apps like this? isn't this kind of aggressive?
You should use CPUTYPE and specify your processor. That way GCC will take advantage of your specific processor's capabilities where applicable. If you have Pentium 4, you can add to /etc/make.conf:
Code:
CPUTYPE?=pentium4
See /usr/share/examples/etc/make.conf for more processor types.

Quote:
Originally Posted by chill View Post
I was looking through mplayer documentation and saw this:
Quote:
If your CPU has SSE, recompile your kernel with "options CPU_ENABLE_SSE" (FreeBSD-STABLE or kernel patches required).
I have no idea how old some of the mplayer documentation is or if this is even relevant anymore.
This option is very old. SSE is enabled by default now. There is an option to disable it, however. For mplayer, you can disable dynamic cpu checking in the options and it will compile for your processor only.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing Workflow Apps ninjatux Off-Topic 1 1st January 2009 05:51 AM
Optimizations for Xeon E5320? KernelPanic FreeBSD Installation and Upgrading 30 30th October 2008 08:19 PM
quick question about optimizations in /etc/make.conf thevirtuesofxen FreeBSD Installation and Upgrading 7 15th July 2008 10:29 AM
How secure are apps that using RPC portmapping? aleunix OpenBSD Security 4 9th June 2008 05:53 PM
remove kde and kde dependent apps ccc FreeBSD Installation and Upgrading 2 12th May 2008 02:11 PM


All times are GMT. The time now is 02:54 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick