2013年1月25日星期五

W530 Ubuntu Optimus Card Issue

For using external display, I started to find out how to enable discretion display card on Ubuntu with my new W530.

Previously I have installed bumblebee and nvidia-current page on my laptop and have nvidia driver work with optirun, unfortunately bumblebee seems not work well with external display, I cannot turn to use discretion card mode when external display connected.

1. Turn the display mode to discretion mode only (without optimus detection), booting failed to  continue after ram image loaded. Seems something wrong with bumblebee or the driver package installed.

2. Turn display mode back to optimus mode and start system, then remove bumblebee and driver packages installed.

3. With default kernel and nouveau driver, the external display is supported when system configured to use discretion mode, but seems it is not so stable and the X keep crashing.

4. Install the nvidia proprietary  driver package. need to disable nouveau driver and reboot in the installation.

5. Reboot the system, turn to discretion mode.


2012年6月22日星期五

Loading official python wrapper of OpenCV 2.4 on windows

In the last few days I have spent quite a few time on using OpenCV in a project. For verifying the algorithm rapidly I try to utilize the python binding on OpenCV.

I got the latest OpenCV  trunk with official svn (so I guess its some version just after the 2.4.1) unfortunately after buiding and installing with VS2008 on my win7 64 laptop, I always  got
ImportError: DLL load failed: The specified module could not be found
when I try to use "import cv2".

After looking around the Internet, most of the related pages only mentioned that I should include the path contains cv2.pyd into the PYTHONPATH variable. Considering that the installation process has already copied needed pyd files into PYTHON_ROOT/lib/site_packages, the solution definitely doesn't make any sense for me.
Because when there is no cv2.pyd under PYTHON_ROOT/lib/site_packages the import cv2 reports that "no modules named cv2", definitedly the python interpreter has found the cv2.pyd and has tried to load it but failed. Then what are the things cv2.pyd depends on but missing? the tool dependency walker shows that cv2.pyd depends on a groupd opencv dlls. So here we got the answer, the interpreter failed to find these dlls because the path hold them was not listed within PATH variable. After adding the path to PATH, the import cv2 works.
P.S. Dependency walker is a good tools, but on win7 it also report some information may misleading the analysis. E.g, it also report that some other system/ms vc runtime dlls, such as gpsvc.dll, ieshims.dll, sysntfy.dll were missing when checking the cv2.pyd. Those error messages waste me hours to find out that those things do nothing with the real problem.