Archive for the ‘linux’ Category
Configuring Linux to work with NVIDIA Hybrid SLI Technology
First of all, at the time of this writing, NVIDIA Hybrid SLI Technology is not supported on Linux and without proper configuration, you won’t even be able to load your Desktop Environment such as Xfce.
That’s not the only problem, based on an interview with NVIDIA’s Tom Petersen, one of its main feature is called HybridPower which basically allows users to shut off the graphics card when not needed and dramatically reduce power consumption. This means, there is a possibility that if we can’t find a way to turn off the second GPU, it will consume more power that it should be. But that’s another problem. Right now, we want to boot into our Desktop Environment properly.
- Running
amree@pikopong:~$ startx(!!) More than one possible primary device found (--) PCI: (0:2:0:0) 10de:06e8:1028:0271 rev 161, Mem @ 0xae000000/16777216, 0xd0000000/268435456, 0xac000000/33554432, I/O @ 0x00004000/128 (--) PCI: (0:3:0:0) 10de:0866:1028:0271 rev 177, Mem @ 0xaa000000/16777216, 0xb0000000/268435456, 0xcc000000/33554432, I/O @ 0x00005000/128, BIOS @ 0x????????/131072
gave me some errors from my
/var/log/Xorg.0.log
- Login as a root and run the command below
root@pikopong:~# nvidia-xconfig
This is to generate the right configuration for your X.
- Get the list of the GPUs.
root@pikopong:~# lspci 02:00.0 VGA compatible controller: nVidia Corporation G98 [GeForce 9200M GS] (rev a1) 03:00.0 VGA compatible controller: nVidia Corporation C79 [GeForce 9400M G] (rev b1)
You will get a long list of devices connected to your PCI buses. We are only interested with the VGA controller.
- As you can see, we have two VGA controller, we need to specify which one we would like to use.
root@pikopong:~# nano /etc/X11/xorg.conf
- Go to your Device section and set Bus ID for your controller in it. So, in the end, if I chose the second controller, my Xorg.conf would somehow look like this:
1 2 3 4 5 6 7
Section "Device" Identifier "Device0" Driver "nvidia" VendorName "NVIDIA Corporation" BoardName "GeForce 9400M G" BusID "PCI:3:0:0" EndSection
- The configuration is simple, you just need to add the 6th line. Just make sure you put it in the correct format PCI:X:X:X, X possibly refers to the last 3 digit number in your error log
Printing to PDF Using CUPS
- Install CUPS-PDF based on your distro, you can download if from here.
- Click this link http://localhost:631 or type it into your browser.
- If the page requested a username and password, just enter your root username and password.
- Go the “Administration” tab and select “Add Printer” in the Printer section.
- For “Add Printer” page, put a name for your virtual PDF printer, any name will do. Then click “Continue”.
- For the second page, that is “Device for a”, you should select “CUPS-PDF (Virtual PDF Driver)”. If it’s not there, then you haven’t execute Step 1 successfully.
- In the 3rd page, choose “Generic” as the Make and then click “Continue”.
- 4th page, choose “Generic CUPS-PDF Printer (en)” as the model and then click “Add Printer”. You’re done, but we need to customize where the file will be located when you printed it.
- Edit /etc/cups/cups-pdf.conf in your favourite editor.
- Put these lines at the end of the file and save it (both can be customized):
1 2 | Out /home/${USER}/Desktop
Label 1 |
- The first line actually tell CUPS to print your file to the Desktop and the second line will make sure your file won’t be overwritten by the newer one.
- Restart your CUPS, for Slackware users, you can type this command /etc/rc.d/rc.cups restart
- So, that’s all and good luck !
Tested on Slackware 12.1, CUPS 1.3.7
Java Printing Fix for Linux with CUPS
Apparently, there’s a bug in Java where people using newer version of CUPS cannot print (can’t even display the print dialog) due to a null pointer exception and this is actually a known bug. So, how do we fix this? For people who use Gnome, you can refer to this page.
However, for people who uses non gui environment such as Fluxbox, Openbox and etc (Gnome and KDE user can use these steps too), you can fix it by editing your CUPS printers configuration file. You can get edit the file at /etc/cups/printers.conf
<DefaultPrinter Printer> # Printer configuration file for CUPS v1.3.7 # Written by cupsd on 2008-09-08 11:24 . . . Option orientation-requested 3 </Printer>
Make sure you add line 7 to every configuration for every printer you’ve installed. If you cannot find the file, you probably haven’t configured any printer yet.
This fix is simply to make sure CUPS will provide a page orientation setting to Java.
The exception:
Caused by: java.lang.NullPointerException: null attribute at sun.print.IPPPrintService.isAttributeValueSupported(IPPPrintService.java:1147) at sun.print.ServiceDialog$OrientationPanel.updateInfo(ServiceDialog.java:2121) at sun.print.ServiceDialog$PageSetupPanel.updateInfo(ServiceDialog.java:1263) at sun.print.ServiceDialog.updatePanels(ServiceDialog.java:437) at sun.print.ServiceDialog.initPrintDialog(ServiceDialog.java:195) at sun.print.ServiceDialog.(ServiceDialog.java:124) at javax.print.ServiceUI.printDialog(ServiceUI.java:188) at sun.print.RasterPrinterJob.printDialog(RasterPrinterJob.java:855) at sun.print.PSPrinterJob.printDialog(PSPrinterJob.java:421)
Refer to some of the discussions here:
UPDATE: I forgot to add, you need to restart your CUPS after editing the configuration (Thanks to Brandon Bell)
Tested on Slackware 12.1, JDK 1.6 Update 7, CUPS 1.3.7
