Wednesday, December 11, 2013

Some tests of Linux graphics for Dell Precision M6800

GpuTest 0.6.0 test results, run at 1920x1080. 

TestsIntel 4800MQOptirun K3100MPrimusrun * K3100M
Furmark393 (6 FPS)1492 (24 FPS)1545 (25 FPS)
Pixmark Volplosion289 (4 FPS)632 (10 FPS)641 (10 FPS)
Tessmark12651 (210 FPS)8495 (141 FPS)
Gimark3573 (59 FPS)3967 (66 FPS)
Plot3D3492 (65 FPS)14382 (239 FPS)8396 (139 FPS)

* Here "vblank_mode=0 primusrun command" is used.

Thursday, November 28, 2013

Dell Precision M6800 Linux Guide/Review

(The same content is posted on notebookreview.com. You may like to reply there in case of discussion.)

* Hardware

My model of M6800 comes with i7 4800MQ CPU, Quadro K3100M graphics, 4*4GB memory, 256GB Samsung ssd and Intel 7260ac wifi. 

* Installation and configuration

Considering the CPU, GPU and wifi hardwares are quite new, Linux distributions with relatively new kernel is recommended. For example, the Intel p-state driver (for Haswell CPU power saving) is in the kernel since Linux 3.9, and the Intel 7260ac wifi driver is in the kernel since Linux 3.10.

The GPT partition table and EFI boot method are used here. There are also boot options with MBR/BIOS boot, which also works (tested on live CD but not installed systems).

For graphics, bumblebee with Nvidia propriety driver is installed for Optimus support (need to be turned on in BIOS, which is by default already turned on in my case). The system uses integrated graphics completely, unless commands are run explicitly using optirun or primusrun. Bbswitch is installed together with bumblebee to automatically switch off the quadro card when it is not needed.

There is one non-standard tweak that I liked: considering I don't use the trackpoint a lot, the mouse keys right below the space bar are not quite useful for me. Thus I re-configured them to be additional function keys, which can be hotkeys (kde runner, switch virtual desktop, switch applications, in my case). This can be done by first remap those buttons:

xinput set-button-map "DualPoint Stick" 20 21 22 23 24

And then use easystroke to map those buttons to keys.

Distribution-wise, I am on archlinux and things work well. I tried OpenSUSE 13.1 previously, and there were some issues (maybe because of X-server version). Namely emacs doesn't update cursor position correctly, and Mathematica scrolling (page up/page down) crashes the whole X-server. Inkscape refuses to start with optirum / primusrun on OpenSuse either but starts well on archlinux.

I do have an issue on archlinux: CUDA 5.5 is not compatible with the gcc version 4.8. This seems solve-able when I googled, but I am currently not using CUDA thus left this issue uninvestigated. This is a distribution related issue thus it may not happen on other Linux distributions.

* Temperature / noise 

I haven't run with full load on this laptop yet. But from simple tests, I am happy with the temperature and there is no heat issue.

The idle CPU temperature is about 45~55C. In this temperature range the laptop is completely silent. A few times in an hour, the fan kicks in for a few seconds (or occasionally longer), when the heat accumulates. Even for those a few seconds, the fan noise is not as loud as my previous Dell Studio 1557's constant noise. The only annoying detail is that, when the fan starts to spin, at the very first moment it is a bit loud (similar to optical drive noise). But the noise is acceptable for me.

When CPU is on 100% load (single thread), the fan is on constantly, but only with low speed. The CPU temperature is about 70C (this is for the highest of the 4 cores; the coolest core is about 59C). Turbo boost is on (as I can see from /sys/devices/system/cpu/intel_pstate) and maintains the highest frequency (considering the temperature). The information in /proc/cpuinfo reports that the CPU stays at about 3699 MHz.

* Battery Life

TLP is installed for tunings on power saving. Some additional power saving is turned on in TLP, following powertop suggestions.

Note that on Linux kernel 3.9 or later, the CPU power is managed by a "p-state" driver instead of CPUfreq. The p-state driver works out of the box, and we don't need to set power governor to ondemand as in older systems.

On battery, powertop reports 13.3W ~ 13.7W power consumption when idle, which is slightly more than 8 hours battery life (97Wh battery. well, the math doesn't seem correct but this is what reported). This result is comparable with reviews of this laptop on Windows.

* Other feelings

I consider this laptop as very well-built. It is indeed heavy but otherwise one can hardly find any short comings.

* Note added:

Finally I found one thing that doesn't work: the wifi hardware switch (in the BIOS it is mentioned that on Win8 it doesn't work either). But I don't need it essentially.

Tuesday, November 5, 2013

Chrome edits in emacs

Noticed a plugin in chrome -- Edit with Emacs.

When using Chrome and editing some (but unfortunately not all) text area, this plugin can connect to emacs and let the edit done therein.

This works great for gmail. Especially that I find it works together with org-mode. With the following bit of code in .emacs, one can use all powerful org edits, such as org-tables and send them back to gmail.

(require 'edit-server)
(edit-server-start)

(add-hook 'edit-server-start-hook (lambda () 
    (org-mode)
    (local-set-key (kbd "C-d") '(lambda () 
        (interactive)
     (mark-whole-buffer)
     (org-html-convert-region-to-html)
 (goto-char (point-max))
 (insert "Here is signature")
     (edit-server-done)))
))

Wednesday, June 5, 2013

Remove string postfix in shell

Can't believe I missed this tip for years (and was using all kinds of ugly workarounds).

To quickly remove a postfix of a string in shell:

test=file.ext; echo ${test%.ext}

On the other hand, if ext is not in test, the original string is returned.

PS: There are some more standard ways to deal with extensions, like

FN=$(basename $1 .tex)

But to deal with a string is more general and has more widely usage.

Saturday, March 2, 2013

Put LaTeX citations in correct order

In a research paper, if references are not ordered by the order they are referred in the main text, the paper is (by a subset of people) considered not well written. I found ordering references to be painful for large papers. Thus I wrote a tool to do it automatically.

Usage:

or.py yourpaper.tex

A file named "ref_ordered.txt" is generated with ordered reference. The ordered reference list is in this file.

Code: http://dl.dropbox.com/u/49916494/or.py

Monday, January 14, 2013

A mode for writing derived from org mode

Didn't find some features among the sea of el's in the emacs world. Thus implemented them myself:

(1) (Almost) real time character counting. This includes counting of the whole buffer, and the counting of the present section (defined in the org-mode sense).

As I am mostly writing Chinese, character counting instead of word counting is good enough for me. Word counting should be possible following a similar way.

The counting is displayed in the title bar. I am actually hiding the mode line to avoid distraction. Thus the title bar is the only place where indicators can be shown.

(2) Focus edit on one section, hide all other parts of the document. Of course one can re-focus on the whole document with another key stoke.

The code is shared .


Thursday, November 29, 2012

Latex with UTF-8 alias in emacs

Recently I felt I would need something more than auctex in emacs. Then I ended up writing a custom LaTeX-mode myself. Now I guess I no longer need LaTeX-preview anymore, and it's no longer painful to edit long formulas!

This is the .tex file, displayed in a plain mode:


 In my custom LaTeX-mode, it displays as (but it still saves as above):


And of course this is the compile result, as you could expect from the first screenshot figure:


The lisp code is shared. As usual for free shares, it is without warranty and try-outs are at your own risk. On the other hand, the modification on display is based on only font-lock-mode and compose-region. No dirty hacks. Thus should be safe.

https://github.com/tririver/wyTex

I also put some custom settings of auctex in the same file. They are not necessary. The only essential part is the function wyTex-key. This function is actually bi-directional alias. If you can input α, β, etc directly from keyboard instead of \alpha, \beta, etc, then directly input them and in saved file they will be saved as  \alpha, \beta, etc and thus can compile using latex or pdflatex directly.

Here is the wyTex-key function:
(defun wyTex-key (utf8-char tex-command)
        (local-set-key utf8-char 
      `(lambda () (interactive) (insert ,tex-command))) 
(font-lock-add-keywords
'wyTex-mode `((,(concat "\\(\\" tex-command "\\)")
(0 (progn (compose-region (match-beginning 1)
 (match-end 1) ,utf8-char)
 nil)))))
  )
Acknowledgment: Thank Francesco for answering my elisp question. And Thank +Xah for suggesting writing an own mode to learn elisp!