Friday, November 27, 2015

git graphical diff

One can use the "git difftool" command, which has direct knowledge of many diffing tools, including meld.
By default it always asks for which diffing tool to use (and defaults to 'meld' on my box), but you can automate the choice with configuration variables. See "git help difftool" for details.

Src: http://blog.deadlypenguin.com/blog/2011/05/03/using-meld-with-git-diff/
see "comments" sections

Wednesday, November 25, 2015

CUDA_VISIBLE_DEVICES – Masking GPUs

Src: http://acceleware.com/blog/cudavisibledevices-masking-gpus

Does your CUDA application need to target a specific GPU? If you are writing GPU enabled code, you would typically use a device query to select the desired GPUs. However, a quick and easy solution for testing is to use the environment variable CUDA_VISIBLE_DEVICES to restrict the devices that your CUDA application sees. This can be useful if you are attempting to share resources on a node or you want your GPU enabled executable to target a specific GPU.
Environment Variable Syntax Results
CUDA_VISIBLE_DEVICES=1 Only device 1 will be seen
CUDA_VISIBLE_DEVICES=0,1 Devices 0 and 1 will be visible
CUDA_VISIBLE_DEVICES=”0,1” Same as above, quotation marks are optional
CUDA_VISIBLE_DEVICES=0,2,3 Devices 0, 2, 3 will be visible; device 1 is masked
CUDA will enumerate the visible devices starting at zero. In the last case, devices 0, 2, 3 will appear as devices 0, 1, 2. If you change the order of the string to “2,3,0”, devices 2,3,0 will be enumerated as 0,1,2 respectively. If CUDA_VISIBLE_DEVICES is set to a device that does not exist, all devices will be masked. You can specify a mix of valid and invalid device numbers. All devices before the invalid value will be enumerated, while all devices after the invalid value will be masked.
To determine the device ID for the available hardware in your system, you can run NVIDIA’s deviceQuery executable included in the CUDA SDK. Happy programming!

Monday, November 23, 2015

Nvidia Visual Profiler (NVVP) version 7.5 crashes on new session on Ubuntu

Original thread: http://stackoverflow.com/questions/26436009/eclipse-luna-crashes-on-new-project-in-ubuntu

Extracted Solution:

According to comment 20 in this bug report: https://bugs.eclipse.org/bugs/show_bug.cgi?id=440660#c20
This seems to be a bug in GTK according to https://bugs.launchpad.net/ubuntu/+source/gtk2-engines-oxygen/+bug/1242801 (there a similar problem for Meld was reported).
Another workaround mentioned there is for Oxygen, edit the normally already existing file /usr/share/themes/oxygen-gtk/gtk-2.0/gtkrc and change
`GtkComboBox::appears-as-list = 1`
into
`GtkComboBox::appears-as-list = 0`
This workaround is working for me.

Tuesday, November 3, 2015

LD cannot find library because of version numbering

It is Debian convention to separate shared libraries into their runtime components (libmagic1: /usr/lib/libmagic.so.1 → libmagic.so.1.0.0) and their development components (libmagic-dev: /usr/lib/libmagic.so → …).
Because the library's soname is libmagic.so.1, that's the string that gets embedded into the executable so that's the file that is loaded when the executable is run.
However, because the library is specified as -lmagic to the linker, it looks for libmagic.so, which is why it is needed for development.
See Diego E. Pettenò: Linkers and names for details on how this all works on Linux.

In short, you should apt-get install libmagic-dev.
This will not only give you libmagic.so but also other files necessary for compiling like /usr/include/magic.h.

src: http://stackoverflow.com/questions/335928/ld-cannot-find-an-existing-library