Skip to content

Instantly share code, notes, and snippets.

Avatar
🤗

Naotoshi Seo sonots

🤗
View GitHub Profile
@sonots
sonots / nvvp.md
Last active Sep 16, 2020
How to use NVIDIA profiler
View nvvp.md

Usually, located at /usr/local/cuda/bin

Non-Visual Profiler

$ nvprof python train_mnist.py

I prefer to use --print-gpu-trace.

@sonots
sonots / runs-on: ubuntu-latest.txt
Last active Jul 28, 2020
Environment Variables on Github Actions
View runs-on: ubuntu-latest.txt
GOROOT_1_11_X64=/usr/local/go1.11
ANDROID_HOME=/usr/local/lib/android/sdk
JAVA_HOME_11_X64=/usr/lib/jvm/zulu-11-azure-amd64
ImageVersion=20190930.2
LANG=C.UTF-8
INVOCATION_ID=029524e610de4329ac57a8f3e8b21281
JAVA_HOME_12_X64=/usr/lib/jvm/zulu-12-azure-amd64
ANDROID_SDK_ROOT=/usr/local/lib/android/sdk
RUNNER_TOOL_CACHE=/opt/hostedtoolcache
JAVA_HOME=/usr/lib/jvm/zulu-11-azure-amd64
View CUDA Bus error.md

It occurred when I did not wait GPU process finishes.

#include <stdio.h>
#include <cuda_runtime.h>

__global__
void my_kernel(int val, int *A, int N)
{
    int i = threadIdx.x;
@sonots
sonots / out_forward.conf
Last active Jul 17, 2020
ログの欠損をできるだけ避ける Fluentd の out_forward 設定サンプル cf. http://blog.livedoor.jp/sonots/archives/44690980.html
View out_forward.conf
<source>
type in_tail
# ...
tag raw.eventlog
</source>
<match raw.**>
type forward
log_level "#{ENV['DEBUG'] ? 'debug' : 'info'}"
@sonots
sonots / fluentd_ruby2.1.1.md
Last active Jun 19, 2020
fluentd w/ ruby 2.1.1 の進捗ダメです。 #=> ロングランさせると安定しました
View fluentd_ruby2.1.1.md

メモリ使用量が増え続ける

memory

最初の山: ruby 2.1.1 + fluentd v0.10.43 + cool.io v1.1.1 + msgpack v0.5.8 # ruby バージョンアップして、他の gem は安定稼働している本番と同じにした(同じ Gemfile.lock を使った)

2つ目の山: ruby 2.1.1 + fluentd v0.10.43 + cool.io v1.1.1 + msgpack v0.5.5 => 安定したかと一瞬思ったが "can't modify frozen String" 例外が出て何も処理できていなかっただけっぽい. v0.5.6 で修正された https://github.com/msgpack/msgpack-ruby/blob/master/ChangeLog

3つ目の山: ruby 2.1.1 + fluentd v0.10.43 + cool.io v1.1.1 + msgpack v0.5.6

@sonots
sonots / fluentd_hacking_guide.md
Last active Jun 15, 2020
Fluentd ソースコード完全解説 (v0.10向け)
View fluentd_hacking_guide.md

Fluentd ソースコード完全解説

英題:Fluentd Hacking Guide

目次

30分しかないため斜線部分は今回省く

  • Fluentd の起動シーケンスとプラグインの読み込み
  • Fluentd の設定ファイルのパース
  • Input Plugin から Output Plugin にデータが渡る流れ
View numo-linalg with openblas at mac.md
$ brew install openblas
==> Caveats
This formula is keg-only, which means it was not symlinked into /usr/local,
because macOS provides BLAS and LAPACK in the Accelerate framework.

For compilers to find this software you may need to set:
    LDFLAGS:  -L/usr/local/opt/openblas/lib
    CPPFLAGS: -I/usr/local/opt/openblas/include
For pkg-config to find this software you may need to set:
@sonots
sonots / preprocessor.pyx
Created Oct 13, 2017
preprocessor in cython
View preprocessor.pyx
# A trick to embed preprocessors in cython
cdef extern from *:
cdef void EMIT_IF_PYTHON_VERSION_HEX_LT_37 "#if PY_VERSION_HEX < 0x03070000 //" ()
cdef void EMIT_ELSE "#else //" ()
cdef void EMIT_ENDIF "#endif //" ()
EMIT_IF_PYTHON_VERSION_HEX_LT_37()
EMIT_ELSE()
View retry.sh
#!/usr/bin/env bash
PROGNAME=$(basename $0)
function usage() {
echo "Usage: $PROGNAME [-c MAX_RETRY] [-s INTERVAL_SEC] -- COMMAND" 1>&2
echo " Retry a command if failed" 1>&2
echo "" 1>&2
echo "Options:" 1>&2
echo " -h, --help Show this message" 1>&2
View GKE fluentd-gcp warning logs.txt
2019-11-28 08:15:11 +0000 [info]: parsing config file is succeeded path="/etc/google-fluentd/google-fluentd.conf"
2019-11-28 08:15:12 +0000 [info]: Detected GCE platform
2019-11-28 08:15:12 +0000 [info]: Logs viewer address: https://console.cloud.google.com/logs/viewer?project=teak-kit-226806&resource=container/instance_id/7530681816608554840
2019-11-28 08:15:12 +0000 [info]: Detected GCE platform
2019-11-28 08:15:12 +0000 [info]: Logs viewer address: https://console.cloud.google.com/logs/viewer?project=teak-kit-226806&resource=gce_instance/instance_id/7530681816608554840
2019-11-28 08:15:12 +0000 [info]: Detected GCE platform
2019-11-28 08:15:12 +0000 [info]: Logs viewer address: https://console.cloud.google.com/logs/viewer?project=teak-kit-226806&resource=container/instance_id/7530681816608554840
2019-11-28 08:15:13 +0000 [warn]: 'time_format' specified without 'time_key', will be ignored
2019-11-28 08:15:13 +0000 [warn]: 'filters' parameter is deprecated: filters has been renamed as matches
2019-11-28 08:1
You can’t perform that action at this time.