1. Switch to Nvidia driver in Additional driver tab and reboot

Image for post
Image for post
switch to nvidia driver

run nvidia-smi and you should see driver version is 390

2. Install CUDA using package from Ubuntu, NOT from Nvidia

sudo apt install nvidia-cuda-toolkit

3. Install cuDNN, you need to register a Nvidia developer account, download cuDNN v7.1.2 Library for Linux, use the tarball instead of the ‘official’ deb. Update LD_LIBRARY_PATH so the libcudnn.so file can be found. You need to open a new terminal so the export can work

tar -zxvf cudnn-9.1-linux-x64-v7.1.tgz
mv cuda ~/cuda
# add the following line to your ~/.bashrc or ~/.zshrc
export LD_LIBRARY_PATH=$HOME/cuda/lib64:$LD_LIBRARY_PATH

4. Install Anaconda, if you want to use builtin python distribution, just skip this step, Anaconda ships with a lot of packages. …


DO NOT use the package from NVIDIA (they are for Ubuntu 17.04).

If you install it, nvidia-smi complains Failed to initialize NVML: Driver/library version mismatch. Reboot, you will get stuck with a black screen and some green words flashing.

Solution: Upgrade the OS to 18.04 and use package from Ubuntu, older version only have CUDA 8 https://packages.ubuntu.com/bionic/devel/nvidia-cuda-toolkit


This blog is written for fellow students at dongyueweb, so its targeted readers are people who have taken database class and want to know about time series database (TSDB).

Table of content

  • What is time series database (TSDB)
  • Time series data model
  • Evolve of time series database
  • Types of time series database
  • Hot topics in time series database
  • Fast response
  • Retention
  • Meta data indexing
  • Tracing

What is time series database (TSDB)

Time series database (TSDB) is relative new compared with RDBMS, NoSQL, even NewSQL. However it is becoming trending with the growth of system monitoring and internet of things. The wiki definition of time series data is a series of data points indexed (or listed or graphed) in time order. When it comes to TSDB, I prefer my own definition: store client history in server for analysis. Time series data is history, it’s immutable, unique and sortable. For instance, the CPU usage at 2017-09-03-21:24:44 is 10.02% for machine-01 in us-east region, it won’t change overtime like bank account balance, there will be no update once it’s generated, the CPU usage at next second, or from different machine are different data points. And the order of data arriving at server does not effect correctness because you can remove the duplicate and sort by client timestamp. Clients of TSDB send their history to sever and is still functional when the server is down, sending data to TSDB is not critical for many clients; A http server’s main job is serving content instead of reporting status code to TSDB. However, RDBMS is treated as single source of truth and effect client’s critical decision making. This lead to very different read and write pattern. For instance, banking application need to query database for user’s balance before proceed by reading and updating a single record. But most TSDB clients are either write only (collectors) or read only (dashboard and alerting system). …


The official download page only have package for 16.04 and 14.04, but actually Ubuntu 17.04 can install CUDA via apt directly. https://launchpad.net/ubuntu/zesty/+source/nvidia-cuda-toolkit

Install

Assume you already have NVIDIA graphic driver installed and just need CUDA. Only the following command is needed.

sudo apt-get install nvidia-cuda-dev nvidia-cuda-toolkit nvidia-nsight

NOTE: Ubuntu 17.04 use GCC6, which is not supported by nvcc , the package will install clang-3.8 (the default clang version for 17.04 is clang 4.0, they can co-exist).

Compile

Compile cuda code using nvcc -ccbin clang-3.8 hello-world.cu


  • 切块
  • 冷水下锅,加盐
  • 水开后煮1分钟
  • 放入冷水冷却
  • 放到冰箱

可选厨具

  • 滤水的网 (不管怎么滤,最后冻出来还是一堆冰)
  • 漏勺 (直接用勺子捞也可以)

备注

  • Safeway 的 Extra Firm Toufu 可以切成薄片,煮的时候并不会破,捞的时候会破
  • 使用时需要提前很长时间解冻

参考

http://blog.sina.com.cn/s/blog_54a625bf0100gzgd.html



Wechat does not have official Linux support, though there are some based on electron . You may still want to use the official windows one. One way is to install a Windows VM if you have enough hardware resource.

The step is as following

  • install virtual box
  • download pre-built windows vm from MicroSoft. https://developer.microsoft.com/en-us/microsoft-edge/tools/vms/
  • extract the zip, you got a .ova file, double click it and virtual box would have a import guide to guide you through it.
  • take snapshot so you can roll back when the trial license expire(I would just remove and re import it after 90 days, just keep the ova…

Update: now docker has community and enterprise edition, install the community edition can be found on docker store . But if you just want to download the deb file, the link in doc is broken, the following should work https://download.docker.com/linux/ubuntu/dists/yakkety/pool/stable/amd64/ as found in this issue.

16.04 has official support, while 16.10 need a lot tweak

16.04

The install instruction on docker’s official doc is very long, it used to guide you to the one command install script

curl -sSL https://get.docker.com/ | sudo sh

Extra work is needed if you are using older Ubuntu distribution like 12.04

16.10

If you use the script, for 16.10 you will have E:Unable to locate package…


When using IDEA (including PhpStorm, Clion etc.) I saw the warning for inotify is too low. Result in files are not updated in IDEA when I edit them in other editor like VSCode and Atom, while editing file in IDEA will have instant change in VSCode if that file does not have unsaved change in VSCode.

The official solution is the following link https://confluence.jetbrains.com/display/IDEADEV/Inotify+Watches+Limit which suggest the following code

sudo sysctl -w fs.inotify.max_user_watches=524288

It works, BUT after reboot, it goes back to the old small number. I also tried something similar from a wiki, which does not work either https://github.com/guard/listen/wiki/Increasing-the-amount-of-inotify-watchers

Finally, by editing the /etc/sysctl.conf and adding the fs.inotify.max_user_watches=524288 it works. sudo echo “fs.inotify.max_user_watches=524288” >> /etc/sysctl.conf should also work if you don’t want to open the file and edit it.


It has been a while since I got my desktop PC, I was using a wired network for it until I have to move to other room this weekend. (The router is in the living room) So I need to use my dusted USB wireless adapter. I tried it when I just got my desktop, but due to secure boot, it can not be installed. Since I already have it disabled for the sake of using VirtualBox, I decided to try it again.

  • Find the adapter model, the easiest way is to plugin it into a windows system and check it in device manager. Mine is 8811au. …

About

at15

Go, Time Series Database and Distributed System

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store