Showing posts with label Hardware. Show all posts
Showing posts with label Hardware. Show all posts

Tuesday, April 10, 2012

HowTo: Install NVIDIA drivers on CentOS 6.2 / SL 6.2

By default, RHEL clones such as CentOS 6.2 and SL 6.2 assign the nouveau X11 driver to NVIDIA graphics card. nouveau is a fine driver, miles away from the old nv; however if you want 3D performance (or a compiz powered desktop) you'll need to turn to NVIDIA and its closed source drivers.

CentOS official repositories don't contain packages for NVIDIA closed source driver so one needs to add a third party repository that has the driver available, such as the ELRepo repository.

Adding the ELRepo consists of importing the public GPG key and installing the repository:
# rpm --import http://elrepo.org/RPM-GPG-KEY-elrepo.org 
# rpm -Uvh http://elrepo.org/elrepo-release-6-4.el6.elrepo.noarch.rpm 
Having added the repository we can finally install the driver (yum pulls nvidia-x11-drv as a dependency) and reboot:
# yum install kmod-nvidia
# reboot
Know Issues
By installing NVIDIA closed source drivers, the plymouth graphical boot will no longer be available. In other worlds, the pretty CentOS and SL logos on a black background will be replaced by a bottom horizontal progress bar.

Sunday, March 25, 2012

Tip: Improve NVIDIA driver performance on FreeBSD

When my desktop northbridge fan died I stopped both playing Enemy Territory and using FreeBSD to do so. I've recently replaced the northbridge cooling and went back to install FreeBSD, NVIDIA drivers for the graphics card and Enemy Territory.

I use the same demo file to benchmark Enemy Territory since 2003 and imagine my surprise as I score 33 FPS when I usually achieved ~100 FPS on the same exact setup under FreeBSD.

With X11 running I dropped to the ttyv0 and saw a suspicious message "NVRM: detected agp.ko, aborting NVIDIA AGP setup".

I suspected that FreeBSD AGP module agp.ko wasn't playing nice with NVIDIA's AGP module.

So I went back to my post on configuring NVIDIA driver on FreeBSD and read NVIDIA README /usr/local/share/doc/NVIDIA_GLX-1.0/README that is installed with the port.

Adding hint.agp.0.disabled="1" to /boot/device.hints and Option "NvAGP" "1" under the Device section of /etc/X11/xorg.conf fixed the problem.

Upon rebooting and running the benchmark again I scored 98,3 FPS which is close to 3x the score without NVIDIA's AGP module!

The solution was in both my old post and NVIDIA's README file all along ;)

Sunday, March 18, 2012

HowTo: Enabling Broadcom BCM4318 wireless on Linux Mint

After a HDD failure my wife asked for a Linux distribution (!) for her old HP dv5000 laptop. I picked Linux Mint due to its multimedia friendliness and restricted firmware support.

Funny enough it didn't attach a driver to the wireless chipset nor offered one through the restricted firmware pop-up.

lspci allowed me to identify the chipset, a Broadcom BCM4318 wireless device:

$ sudo lspci
00:00.0 Host bridge: ATI Technologies Inc RS480 Host Bridge (rev 01)
00:01.0 PCI bridge: ATI Technologies Inc RS480 PCI Bridge
00:05.0 PCI bridge: ATI Technologies Inc RS480 PCI Bridge
00:13.0 USB Controller: ATI Technologies Inc IXP SB400 USB Host Controller
00:13.1 USB Controller: ATI Technologies Inc IXP SB400 USB Host Controller
00:13.2 USB Controller: ATI Technologies Inc IXP SB400 USB2 Host Controller
00:14.0 SMBus: ATI Technologies Inc IXP SB400 SMBus Controller (rev 11)
00:14.1 IDE interface: ATI Technologies Inc IXP SB400 IDE Controller
00:14.3 ISA bridge: ATI Technologies Inc IXP SB400 PCI-ISA Bridge
00:14.4 PCI bridge: ATI Technologies Inc IXP SB400 PCI-PCI Bridge
00:14.5 Multimedia audio controller: ATI Technologies Inc IXP SB400 AC'97 Audio Controller (rev 02)
00:14.6 Modem: ATI Technologies Inc SB400 AC'97 Modem Controller (rev 02)
00:18.0 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] HyperTransport Technology Configuration
00:18.1 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Address Map
00:18.2 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] DRAM Controller
00:18.3 Host bridge: Advanced Micro Devices [AMD] K8 [Athlon64/Opteron] Miscellaneous Control
01:05.0 VGA compatible controller: ATI Technologies Inc Radeon XPRESS 200M 5955 (PCIE)
06:02.0 Network controller: Broadcom Corporation BCM4318 [AirForce 54g] 802.11a/b/g PCI Express Transceiver (rev 02)
06:04.0 CardBus bridge: Texas Instruments PCIxx21/x515 Cardbus Controller
06:04.2 FireWire (IEEE 1394): Texas Instruments OHCI Compliant IEEE 1394 Host Controller
06:04.3 Mass storage controller: Texas Instruments PCIxx21 Integrated FlashMedia Controller
06:04.4 SD Host controller: Texas Instruments PCI6411/6421/6611/6621/7411/7421/7611/7621 Secure Digital Controller
06:06.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)

To fix the problem run the following commands:
$ sudo apt-get install b43-fwcutter
$ wget http://mirror2.openwrt.org/sources/broadcom-wl-4.150.10.5.tar.bz2
$ tar xf broadcom-wl-4.150.10.5.tar.bz2
$ cd broadcom-wl-4.150.10.5/driver/
$ sudo b43-fwcutter -w /lib/firmware/ wl_apsta_mimo.o
$ sudo modprobe b43
$ sudo echo "b43" >> /etc/modules

With this we've installed the proper driver and added it at boot time.

Bottom line: there's so much a pretty GUI can do ;)

HowTo: nForce2 sound on FreeBSD

I finally got around to replace the northbridge fan of my ABIT AN-7 powered desktop and with it boot its old FreeBSD 7.4-STABLE install. Though I have a Creative SoundBlaster Audigy 4 I wanted to make sure I could go by with just the motherboard's nForce2 integrated sound system, so bellow I'll explain how to enable the nForce2 sound on FreeBSD.

Let's check if FreeBSD recognized and assigned a sound driver to the device:
$ cat /dev/sndstat
FreeBSD Audio Driver (newpcm: 32bit 2007061600/i386)
Installed devices:

# dmesg | grep -i audio
pci0: at device 5.0 (no driver attached)
pci0: at device 6.0 (no driver attached)

# cd /usr/ports/sysutils/pciutils ; make install clean ; rehash

# lspci | grep -i audio
00:05.0 Multimedia audio controller: nVidia Corporation nForce Audio Processing Unit (rev a2)
00:06.0 Multimedia audio controller: nVidia Corporation nForce2 AC97 Audio Controler (MCP) (rev a1)

Ok. So no sound driver is attached to the device. To use the sound device load the proper driver which in this case is snd_ich according to FreeBSD 7 Relase Notes

Let's attach the driver to the device:

# kldload snd_ich

To be sure that the sound driver was correctly loaded run:

$ cat /dev/sndstat
FreeBSD Audio Driver (newpcm: 32bit 2007061600/i386)
Installed devices:
pcm0: at io 0xb400, 0xb800 irq 22 bufsz 16384 kld snd_ich [MPSAFE] (1p:1v/1r:1v channels duplex default)

To attach the appropriate driver at boot, we need to add it to loader.conf(5) like so:
# echo 'snd_ich_load="YES"' >> /boot/loader.conf

To setup sound output levels for various audio sources and frequency ranges you can use the FreeBSD mixer. To display the current mixer values do the following:

$ mixer
Mixer vol      is currently set to  75:75
Mixer pcm      is currently set to  75:75
Mixer speaker  is currently set to  75:75
Mixer line     is currently set to  75:75
Mixer mic      is currently set to   0:0
Mixer cd       is currently set to  75:75
Mixer rec      is currently set to   0:0
Mixer igain    is currently set to   0:0
Mixer ogain    is currently set to  50:50
Mixer line1    is currently set to  75:75
Mixer phin     is currently set to   0:0
Recording source: mic

To change mixer values you can type mixer followed by the name of the device and the desired level. If you wanted to change the CD output volume to 95 percent on left channel and 85 on the right channel:

$ mixer cd 95:85

And that's it. As a side note, though I mention FreeBSD 7.4-STABLE these instructions apply to recent versions of FreeBSD, namely FreeBSD 9.0-RELEASE.

For additional information consult sound(4) and snd_ich(4) man pages.

Saturday, July 9, 2011

Tip: Fixing Atheros L2 driver attachment on FreeBSD

My personal server, a low-powered system based on an integrated motherboard ASUS I220GC, is using a D-Link DGE-528 Ethernet PCI card which runs fine on FreeBSD 7.4. However while toying with the system I decided to active the integrated Atheros L2 10/100 Ethernet device that I had disabled a long time ago.

Upon enabling the device on the BIOS and booting the system I came across an odd situation: ae(4) which is Atheros L2 driver wasn't loading properly.
# dmesg | less
Jul 8 22:07:22 flumen kernel: pci2: on pcib2
Jul 8 22:07:22 flumen kernel: pci2: at device 0.0 (no driver attached)
# pciconf -lv
none2@pci0:2:0:0: class=0x020000 card=0x82331043 chip=0x20481969 rev=0xa0 hdr=0x00
vendor = 'Attansic (Now owned by Atheros)'
device = 'Fast Ethernet 10/100 Base-T Controller (Atheros L2)'
class = network
subclass = ethernet
To fix this ae(4) driver has to be loaded and then it will attach himself to the PCI device (pci2 in my system):
# kldload -v if_ae
ae0: mem 0xdffc0000-0xdfffffff irq 17 at device 0.0 on pci2
ae0: Using MSI messages.
miibus1: on ae0
atphy0: PHY 0 on miibus1
atphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
ae0: Ethernet address: 00:1f:c6:dd:15:72
ae0: [FILTER]
Loaded if_ae, id=5
By running pciconf(8) we can confirm that the driver is now successfully attached:
# pciconf -lv
ae0@pci0:2:0:0: class=0x020000 card=0x82331043 chip=0x20481969 rev=0xa0 hdr=0x00
vendor = 'Attansic (Now owned by Atheros)'
device = 'Fast Ethernet 10/100 Base-T Controller (Atheros L2)'
class = network
subclass = ethernet
To load the driver as a module at boot time loader.conf(5) needs to be edited.
# echo 'if_ae_load="YES"' >> /boot/loader.conf
Now that the driver attachment at boot is solved rc.conf(5) needs to be edited so that FreeBSD assigns an interface to Atheros L2 device at boot:
# vim /etc/rc.conf
ifconfig_ae0="inet 192.168.1.1 netmask 255.255.255.0"
The next time the system is booted the next settings are applied and Atheros L2 is properly working (make sure you use your own network settings namely netmask and inet).

Sources:
man ae
man ifconfig
man loader.conf
man pciconf
man rc.conf

Tuesday, August 25, 2009

HowTo: Intel PRO/Wireless 3945ABG on Debian

I've recently dabbled with Debian Lenny on my Dell D620 and found myself needing to access my wireless network.

These are the required steps to activate the Intel PRO/Wireless 3945 ABG device on Debian GNU/Linux 5.0 Lenny:
  1. $ su
  2. # aptitude install firmware-iwlwifi
  3. # modprobe -r iwl3945 && modprobe iwl3945
  4. point to the Network Manager icon on Gnome's top panel and enter the details of your wireless network
Do notice that firmware-iwlwifi is a non-free firmware so you need to enable the non-free repositories. To do so point to System -> Administration -> Software Sources -> Debian Software and enable the non-free and contrib repositories.

I found the whole process of enabling and using 3945ABG on Debian very simple and straightforward which was a welcome change from the days of the old ipw driver ;)

Thursday, April 16, 2009

Tip: D-Link DGE-528 on FreeBSD

Here's how to enable 1000baseTX full-duplex on a D-Link DGE-528 network card:
  1. % su
  2. # pciconf -lv
  3. # ifconfig
  4. # ifconfig -m re0
  5. # ifconfig re0 media 1000baseTX mediaopt full-duplex
  6. # vim /etc/rc.conf
  7. ifconfig_re0="inet 192.168.1.3 netmask 255.255.255.0 media 1000baseTX mediaopt full-duplex"
Start by becoming the superuser.

Steps 2, 3 and 4 help you determine where the card is (in my case re0) and collect more info on it.

On step 5 use ifconfig to apply the new setting and test the card out. If everything is ok add the ifconfig setting to /etc/rc.conf (steps 6 and 7) so that the next time you boot the next settings are applied.

Sources:
man 4 re
man 8 ifconfig

Tuesday, March 24, 2009

HowTo: Install and configure NVIDIA drivers on FreeBSD

FreeBSD's Ports collection contains the official NVIDIA binary drivers for hardware OpenGL rendering in X, using the GLX extensions.The x11/nvidia-driver points to NVIDIA's latest stable driver set.

If you are using a legacy card check NVIDIA's site to see which driver set supports your card and browse the Ports tree for the suitable driver version and install that instead.

Bellow are the steps needed to install NVIDIA drivers on i386 FreeBSD 7.1:
  • % su
  • # portsnap fetch update
  • # cd /usr/ports/x11/nvidia-drivers
  • # make config
  • # make install clean
  • # echo 'nvidia_load="YES"' >> /boot/loader.conf
  • # echo 'linux_enable="YES"' >> /etc/rc.conf
  • # echo 'hint.agp.0.disabled="1"' >> boot/device.hints
Basically start by updating your ports tree, installing the driver and preparing FreeBSD to load the NVIDIA kernel module it at boot time. Consider selecting ACPI (enable support for ACPI Power Management) and LINUX (build with support for Linux compatibility) port options.

Now let's proceed by editing /etc/X11/xorg.conf to have it use the NVIDIA driver and add some options to increase performance:
  • edit /etc/X11/xorg.conf and change the driver value from "nv" to "nvidia":
Driver "nvidia"
  • under the Device section of xorg.conf add the following option:
Option "NvAGP" "1"
Additional performance options can be enabled, however these might affect stability. To enable Side Band Addressing and Fast Writes add the following sysctls to /etc/sysctl.conf:
  • # echo "hw.nvidia.registry.EnableAGPSBA=1" >> /etc/sysctl.conf
  • # echo "hw.nvidia.registry.EnableAGPFW=1" >> /etc/sysctl.conf
Finally:
  • # reboot
Further reading material can be found at:
http://www.freebsd.org/doc/en/books/handbook/x11.html
/usr/local/share/doc/NVDIA_GLX-1.0/

Wednesday, November 19, 2008

HowTo: Logitech MX500 under FreeBSD

I have both a Logitech MX500 and a MX518, however I've loaned the MX518 to my brother. So I took my previous post on MX518 and mirrored it to MX500.

Being an Enemy Territory (ET) old timer I need to make full use of the MX500 mouse under FreeBSD, which means having the Back, Forward and the other weird button below the wheel working as available binds while playing ET.

The bellow xorg.conf settings were tested under FreeBSD 7.0 and X.Org X Server 1.4.2.
  • % su
  • # vim /etc/X11/xorg.conf

Section "InputDevice"
Identifier "Mouse0"
Driver "mouse"
Option "Protocol" "auto"
Option "Device" "/dev/sysmouse"
Option "ZAxisMapping" "4 5"
Option "ButtonMapping" "1 2 3 6 7 8 9 10 4 5"
Option "Emulate3Buttons" "false"
EndSection
With these settings you're free to bind MOUSE4, MOUSE5 and KP_EQUALS to Enemy Territory.

As a bonus, you can now use the Back and Forward buttons under Opera.

Saturday, August 16, 2008

HowTo: Creative Audigy 4 under FreeBSD

The snd_emu10kx driver provides support for Creative SoundBlaster Live! and Audigy sound cards, namely for Audigy 4.

Assuming that you are running FreeBSD 7's generic kernel it's simply a matter of loading the driver as a module at boot time.

To do so :
  • % su
  • # echo 'snd_emu10kx_load="YES"' >> /boot/loader.conf
If you are planning on compiling your own custom kernel, place the following lines in your kernel configuration file:
device sound
device snd_emu10kx
Just to be sure if the sound driver was correctly loaded run:
  • % cat /dev/sndstat
FreeBSD Audio Driver (newpcm: 32bit 2007061600/i386)
Installed devices:
pcm0: on emu10kx0 [MPSAFE] (4p:1v/1r:1v channels duplex default)
pcm1: on emu10kx0 [MPSAFE] (1p:1v/0r:0v channels)
pcm2: on emu10kx0 [MPSAFE] (1p:1v/0r:0v channels)
pcm3: on emu10kx0 [MPSAFE] (1p:1v/0r:0v channels)
pcm4: on emu10kx0 [MPSAFE] (1p:1v/0r:0v channels)
To setup sound output levels for various audio sources and frequency ranges you can use the FreeBSD mixer. To display the current mixer values do the following:
  • % mixer
Mixer vol is currently set to 75:75
Mixer pcm is currently set to 75:75
Mixer speaker is currently set to 75:75
Mixer line is currently set to 75:75
Mixer mic is currently set to 0:0
Mixer cd is currently set to 75:75
Mixer rec is currently set to 0:0
Mixer igain is currently set to 0:0
Mixer ogain is currently set to 50:50
Mixer line1 is currently set to 75:75
Mixer line2 is currently set to 0:0
Mixer line3 is currently set to 0:0
Mixer dig1 is currently set to 0:0
Mixer dig2 is currently set to 0:0
Mixer dig3 is currently set to 0:0
Mixer phin is currently set to 0:0
Mixer phout is currently set to 0:0
Mixer video is currently set to 75:75
Recording source: mic
To change mixer values you can type mixer followed by the name of the device and the desired level. If you wanted to change the CD output volume to 95 percent on left channel and 85 on the right channel:
  • # mixer cd 95:85
And were all done.

If you want additional information on the driver take a look at snd_emu10kx and mixer's man pages.