Category: 软件[Code]

[Ubuntu]

ISSUE: Nvidia display driver problem on a two graphics card PC.

[EE] No devices detected. No screen found.

SOLUTION:

lspci -v

Get PCI bus number for graphics cards, 1:0:0 and 6:0:0 for instance.

sudo vi /etc/X11/xorg.conf

Under section “Device”, add

BusID “PCI:1:0:0″

Restart X and everything works like a charm.

http://wiki.linuxquestions.org/wiki/Using_multiple_monitors

[CUDA]

ISSUE: “error while loading shared libraries: libcudart.so.3: cannot open shared object file: No such file or directory”

SOLUTION:

sudo vim /etc/ld.so.conf

Add “/usr/local/cuda/lib”

Save and quit.

ld config -v | grep cuda

山寨的联通3G网卡,无型号,隆信通,在Ubuntu 11.10下使用:

lsusb信息如下:

Bus 003 Device 003: ID 05c6:6000 Qualcomm, Inc. Mass Storage Device.

使用如下命令切换到modem模式:

usb_modeswitch -v 05c6 -p 1000 -M 5553424312345678000000000000061b000000020000000000000000000000 -R 1
切换成功后可ls /dev/tty*看到ttyUSBx的设备。

打开网络配置用户名和密码都为any,pin码为1234,网络为3gnet,其余默认。

Tricks

1. Compile PTAM

1). Install TooN lib.

Download Toon.

->  cvs -z3 -d:pserver:anoncvs@cvs.savannah.nongnu.org:/cvsroot/toon co TooN

Make and install.

-> ./configure

-> make

-> make install

2). Install libcvd(32bit).

a) Download libcvd.

-> cvs -z3 -d:pserver:anoncvs@cvs.savannah.nongnu.org:/cvsroot/libcvd co libcvd

b) Edit cvd/gl_helpers.h. Use OpenGL/gl.h and OpenGL/glu.h.

c) Edit progs/calibrate.cxx. Replace GL_TEXTURE_RECTANGLE_NV with GL_TEXTURE_RECTANGLE_ARB.

d) Edit cvd_src/OSX/qtbuffer.cpp. Add #include <vector>

e) Create a new configure script configure_mac.sh:

#!/bin/bash

SDK="-isysroot /Developer/SDKs/MacOSX10.5.sdk"
SDKLIB="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk"
export MACOSX_DEPLOYMENT_TARGET="10.5"

ARCH="-arch i386"

export CFLAGS="$ARCH $SDK -mmacosx-version-min=10.5 -I /usr/local/include"
export CXXFLAGS="$ARCH $SDK -mmacosx-version-min=10.5 -I /usr/local/include"
export CPPFLAGS="$ARCH $SDK -mmacosx-version-min=10.5 -I /usr/local/include"
export LDFLAGS="$ARCH $SDKLIB -mmacosx-version-min=10.5 -I /usr/local/include"

CC="/usr/bin/gcc-4.2"
CXX="/usr/bin/g++-4.2"
OBJC="/usr/bin/gcc-4.2"

./configure $1 $2 $3 $4 $5 $6 $7 $8 $9
f) Configure.
-> ./configure_mac.sh --without-ffmpeg --x-libraries=/Developer/SDKs/MacOSX10.5.sdk/usr/X11/lib/ --x-includes=/Developer/SDKs/MacOSX10.5.sdk/usr/X11/include

g)  Edit makefile.

Move all -L/opt/local/lib to the end of the argument list, giving priority to OSX10.5.sdk version of X11

h) Make and Install

-> make

-> install

3). Install gvars3

a) Download gvars3

-> cvs -z3 -d:pserver:anoncvs@cvs.savannah.nongnu.org:/cvsroot/libcvd co gvars3

b) Copy the previous configure_mac.sh.
-> sh configure_mac.sh --disable-widgets
-> make
-> make install

4). Compile PTAM

a) Copy /Build/OSX/Makefile and VideoSource_OSX.cc to source root directory.
b) Edit makefile. Compile 32bit.
-> CC = g++ -g -O3 -arch i386
-> make
-> make install

2. Compile PTAMM

a. Install lib3ds. Download the source. Copy configure_mac.sh. Do the same as above.

b. Copy PTAM/VideoSource_OSX.cc to PTAMM.

c. Copy PTAMM/Build/Linux/Makefile to PTAMM.

d. Edit VideoSource_OSX.cc. Add “namespace PTAMM{” after the includes and “}” at the end.

e. Edit makefile.

Change “LINKFLAGS = -L MY_CUSTOM_LINK_PATH -lGVars3 -lcvd $(3DSLIB)” => “LINKFLAGS = -framework OpenGL -framework VecLib -lGVars3 -lcvd $(3DSLIB)”.

Change “VIDEOSOURCE = VideoSource_Linux_DV.o” => “VIDEOSOURCE = VideoSource_OSX.o”

f. make and install.

Have fun:)