Sunday, March 18, 2018

fastai installation notes

install anaconda3 for python3.6. Make sure you don't have /usr/bin/python pointing to python2.7.

This is the default setting and you have to remove the symlink or you can leave it but make sure the PATH environment variable has /home/username/anaconda3/bin/python set first so the python version from here is found first. Easiest to delete the symlink.

when using conda env update, it creates the fastai conda env based on environment.yml. It does not install keras or tensorflow; you have to pick pip install tensorflow for CPU or pip install tensorflow-gpu if you have a gpu installed. JH's examples are designed for GPU.

Tuesday, January 30, 2018

Ubuntu NVidia Cuda Installation notes

There are 2 sources of Nvidia CUDA installation for TF.

I had cuda 9.1 installed and working with TF1.4 from a source compiled version then along came TF1.5 and I needed cuda 9.0!

1) the downloaded pdfs which are not exactly complete.

2) the online version of the cuda installation guide here: which is referred to by the NVidia help posts telling people to read the manual. This isn't complete either.

I found reinstalling kernel drivers from CUDA8->9.1->9.0 never worked. Probably not a tested configuration in trying to make sure installs work after each other.

Reinstall the OS and try again.

The runfile downloads are more stable in that you can keep them around for reproducability/production and you don't have to deal with unstable links. The deb files introduce
urls into sources.list.d which can be hard to track down and are prone to errors from Nvidia. I had a 9.0 deb file point me to a 9.1 installation because it was referencing the current URL for CUDA installation not an archive URL.

Disable nouveau. Test if you are using Nouveau using: lsmod | grep nouveau. If you see any response
you have to disable the nouveau kernel driver. Ironically the nouveau kernel drivers are opensource versions for NVidia cards.

dc@gpu1:~$ lsmod | grep nouveau
nouveau              1495040  0
mxm_wmi                16384  1 nouveau
wmi                    20480  2 mxm_wmi,nouveau
video                  40960  1 nouveau
i2c_algo_bit           16384  1 nouveau
ttm                    98304  1 nouveau
drm_kms_helper        155648  1 nouveau
drm                   364544  3 ttm,drm_kms_helper,nouveau

After generating the disable blacklist nouveau conf file, running sudo update-initramfs -u generates a kernel config file using the current kernel image and ram disk with nouveau disabled.

There are 2 conflicting processes for init level 3; the lightdm windows manager and kernel settings. Turn off lightdm on reboot and change /etc/init/rc-sysinit.conf.

Change the grub config file: /etc/default/grub and change GRUB_CMDLINE_LINUX_DEFAULT from "splash screen" to
text. Then run grub update to generate the new grub config files.

To check the current runlevel: >runlevel

For ubuntu 16.XX LTS:
sudo systemctl enable
sudo systemctl set-default
If this works you should see:
dc@gpu1:~$ runlevel
N 3

Sunday, December 3, 2017

xquartz mac nvvp

From a mac terminal run: DISPLAY=:0 xterm

this creates a Xterm Quartz session indicating quartz gas been installed correctly.

Using the Xterm Quartz window ssh in and
dc@dc-dell:export DISPLAY=''
dc@dc-dell: xhost +

You should see a message indicating xhost is running properly.

localhost:~ dc$ xhost +
access control disabled, clients can connect from any host

Once you see this... may have to wait several minutes ...I didn't do anything but reran the command xhost + after a couple minutes.. the first time failed with xhost:  unable to open display ""

>export DISPLAY=

and should see nvpp running on macbook

Saturday, October 28, 2017

fan control dell 7600 ubuntu

The default ubuntu fan control isn't installed. 
sudo apt-get install lm-sensors xsensors fancontrol

#sudo apt install lm-sensors fancontrol
sudo sensors-detect
/etc/init.d/kmod start
sudo pwmconfig
sudo service fancontrol start

Sunday, June 11, 2017

Virtual environment path

from python command line:

>>os.environ will return the enviroment env settings

>>> os.environ
environ({'PS1': '(py35) \\[\\e[0;33m\\]\\h:\\W \\u\\$\\[\\e[m\\] ', 'USER': 'dc', 'CONDA_HOME': '/Users/dc/anaconda', 'GROOVY_HOME': '/Users/dc/groovy-2.4.6', 'PWD': '/Users/dc', 'Apple_PubSub_Socket_Render': '/private/tmp/', 'COMMAND_MODE': 'unix2003', 'VLC_PLUGIN_PATH': '/Applications/', 'LOGNAME': 'dc', 'TERM_PROGRAM': '', 'TMPDIR': '/var/folders/mb/br6t4l8d5svbdx8w4r966y1w0000gn/T/', 'JAVA_HOME': '/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home/', 'LSCOLORS': 'cxFxBxDxCxegedabagacad', 'SHELL': '/bin/bash', 'COLORFGBG': '7;0', 'LANG': 'en_US.UTF-8', 'ITERM_PROFILE': 'Default', 'DISPLAY': '/private/tmp/', 'MAC_JAVA': '/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/MacOS', 'TERM_PROGRAM_VERSION': '3.0.15', 'SSH_AUTH_SOCK': '/private/tmp/', 'TERM_SESSION_ID': 'w0t0p1:6C68B3C0-5374-4E9C-B424-125BAB6B03F4', 'CONDA_PS1_BACKUP': '\\[\\e[0;33m\\]\\h:\\W \\u\\$\\[\\e[m\\] ', 'SECURITYSESSIONID': '186a8', 'ITERM_SESSION_ID': 'w0t0p1:6C68B3C0-5374-4E9C-B424-125BAB6B03F4', 'CONDA_PREFIX': '/Users/dc/anaconda/envs/py35', 'XPC_FLAGS': '0x0', 'CONDA_DEFAULT_ENV': 'py35', 'ITERM_ORIG_PS1': '(py35) \\[\\e[0;33m\\]\\h:\\W \\u\\$\\[\\e[m\\] ', 'PATH': '/Users/dc/anaconda/envs/py35/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/TeX/texbin:/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/MacOS:/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home//bin:/Users/dc/apache-maven-3.3.9/bin:/Users/dc/anaconda/bin:/Users/dc/gradle-2.11/bin:/Users/dc/groovy-2.4.6/bin:/usr/local/include:/usr/local/lib:/usr/local/Cellar/opencv/2.4.13/include:/usr/local/Cellar/opencv/2.4.13/lib', '_': '/Users/dc/anaconda/envs/py35/bin/python', 'OLDPWD': '/Users/dc', 'ITERM_PREV_PS1': '\\[\x1b]133;D;$?\x07\x1b]1337;RemoteHost=dc@localhost\x07\x1b]1337;CurrentDir=/Users/dc\x07\x1b]133;A\x07\\](py35) \\[\\e[0;33m\\]\\h:\\W \\u\\$\\[\\e[m\\] \\[\x1b]133;B\x07\\]', 'HOME': '/Users/dc', 'CLICOLOR': '1', 'CONDA_PATH_BACKUP': '/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Library/TeX/texbin:/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/MacOS:/Library/Java/JavaVirtualMachines/jdk1.8.0_91.jdk/Contents/Home//bin:/Users/dc/apache-maven-3.3.9/bin:/Users/dc/anaconda/bin:/Users/dc/gradle-2.11/bin:/Users/dc/groovy-2.4.6/bin:/usr/local/include:/usr/local/lib:/usr/local/Cellar/opencv/2.4.13/include:/usr/local/Cellar/opencv/2.4.13/lib', 'XPC_SERVICE_NAME': '0', '__CF_USER_TEXT_ENCODING': '0x1F5:0x0:0x0', 'MAVEN_HOME': '/Users/dc/apache-maven-3.3.9', 'GRADLE_HOME': '/Users/dc/gradle-2.11', 'TERM': 'xterm-256color', 'SHLVL': '1'})

From the above we can see we should use echo $CONDA_PREFIX as the equivalent to $VIRTUAL_ENV

Monday, March 13, 2017

network and broadcast address calculation

To simplify that article: network is the lowest possible address in the range of ip addresses left over from the netmask. broadcast is the highest numbered ip address in that range. The "range of ip addresses left over from the netmask" is known as the local network.
"The network" typically means everyone above you, including the Internet. To get to "the network", the network address is used. In reality, most people call "the network" anything with ethernet cables that can talk to each other.
Example: your ISP gives you info to type into a wireless router: a static IP address of and your netmask is Now you're wanting to set up an ubuntu firewall and need to set up your public interface:
Calculate network IP address: -> last octet = E0
 99.  1. 81.209 -> last octet = D1
Logical AND the mask and your ip: 
E0 & D1 = C0 = 192
--> network =

Calculate broadcast address: : E0 -> there are 1F = 31,
-> broadcast = + .31 =
The other way...
Calculate broadcast address: -> last octet = E0
 99.  1. 81.209 -> last octet = D1
Hosts' IPs = 1F 
Logical OR the hosts ips with your ip:
1F | D6 = DF = 223 
--> broadcast =
Often, you'll see networks described with a /. Here's this network: is the netmask, add up the "1" bits:
 8 + 8 + 8 + 3  = 27
so "this network" gets /27 notation
and can be described as
BROADCAST=`ip address show $DEV | grep 'inet .* brd ' | head -1 | sed -e 's/^.* brd \([0-9\.]*\) .*$/\1/'`
dc@dc-Precision-T7600:/etc/network$ echo $BROADCAST