2020 7/23 モニターコマンド追記





1、Nvidia GPU driverのインストール

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt update

#NVIDIA driverのインストール。最新GPUだとより最新のNvidiaドライバーを入れる必要があるかもしれない(ONTのGuppy documentより)。
sudo apt install nvidia-384

#OS reboot
sudo rebootがないというエラーが出たら、/libcuda.soから/にシンボリックリンクを張って、$LD_LIBRARY_PATHに追加することでとりあえず解決。

ln -s /usr/local/cuda/lib64/stubs/ /usr/local/cuda/lib64/stubs/

export LD_LIBRARY_PATH=/usr/local/cuda/lib64/stubs:${LD_LIBRARY_PATH}


> modinfo nvidia | grep version



2020 1/19現在、Guppyのv3.4.4が提供されている。log inしてsoftware downloadからlinux GPUビルドをダウンロードする。


tar -xf ont-guppy_3.4.4_linux64.tar.gz
cd ont-guppy/bin/


$ ./guppy_basecaller

: Guppy Basecalling Software, (C) Oxford Nanopore Technologies, Limited. Version 3.4.4+a296acb




With config file:"

  guppy_basecaller -i <input path> -s <save path> -c <config file> [options]

With flowcell and kit name:

  guppy_basecaller -i <input path> -s <save path> --flowcell <flowcell name>

    --kit <kit name>

List supported flowcells and kits:

  guppy_basecaller --print_workflows


Use GPU for basecalling:

  guppy_basecaller -i <input path> -s <save path> -c <config file>

    --device <cuda device name> [options]


Use server for basecalling:

  guppy_basecaller -i <input path> -s <save path> -c <config file>

    --port <server address> [options]

Command line parameters:

  --print_workflows                 Output available workflows.

  --flowcell arg                    Flowcell to find a configuration for

  --kit arg                         Kit to find a configuration for

  -m [ --model_file ] arg           Path to JSON model file.

  --chunk_size arg                  Stride intervals per chunk.

  --chunks_per_runner arg           Maximum chunks per runner.

  --chunks_per_caller arg           Soft limit on number of chunks in each 

                                    caller's queue. New reads will not be 

                                    queued while this is exceeded.

  --overlap arg                     Overlap between chunks (in stride 


  --gpu_runners_per_device arg      Number of runners per GPU device.

  --cpu_threads_per_caller arg      Number of CPU worker threads per 


  --num_callers arg                 Number of parallel basecallers to create.

  --post_out                        Return full posterior matrix in output 

                                    fast5 file and/or called read message from 


  --stay_penalty arg                Scaling factor to apply to stay probability

                                    calculation during transducer decode.

  --qscore_offset arg               Qscore calibration offset.

  --qscore_scale arg                Qscore calibration scale factor.

  --temp_weight arg                 Temperature adjustment for weight matrix in

                                    softmax layer of RNN.

  --temp_bias arg                   Temperature adjustment for bias vector in 

                                    softmax layer of RNN.

  --hp_correct arg                  Whether to use homopolymer correction 

                                    during decoding.

  --builtin_scripts arg             Whether to use GPU kernels that were 

                                    included at compile-time.

  -x [ --device ] arg               Specify basecalling device: 'auto', or 


  -k [ --kernel_path ] arg          Path to GPU kernel files location (only 

                                    needed if builtin_scripts is false).

  -z [ --quiet ]                    Quiet mode. Nothing will be output to 

                                    STDOUT if this option is set.

  --trace_categories_logs arg       Enable trace logs - list of strings with 

                                    the desired names.

  --verbose_logs                    Enable verbose logs.

  --qscore_filtering                Enable filtering of reads into PASS/FAIL 

                                    folders based on min qscore.

  --min_qscore arg                  Minimum acceptable qscore for a read to be 

                                    filtered into the PASS folder

  --disable_pings                   Disable the transmission of telemetry 


  --ping_url arg                    URL to send pings to

  --ping_segment_duration arg       Duration in minutes of each ping segment.

  --calib_detect                    Enable calibration strand detection and 


  --calib_reference arg             Reference FASTA file containing calibration


  --calib_min_sequence_length arg   Minimum sequence length for reads to be 

                                    considered candidate calibration strands.

  --calib_max_sequence_length arg   Maximum sequence length for reads to be 

                                    considered candidate calibration strands.

  --calib_min_coverage arg          Minimum reference coverage to pass 

                                    calibration strand detection.

  --trim_threshold arg              Threshold above which data will be trimmed 

                                    (in standard deviations of current level 


  --trim_min_events arg             Adapter trimmer minimum stride intervals 

                                    after stall that must be seen.

  --max_search_len arg              Maximum number of samples to search through

                                    for the stall

  --reverse_sequence arg            Reverse the called sequence (for RNA 


  --u_substitution arg              Substitute 'U' for 'T' in the called 

                                    sequence (for RNA sequencing).

  --override_scaling                Manually provide scaling parameters rather 

                                    than estimating them from each read.

  --scaling_med arg                 Median current value to use for manual 


  --scaling_mad arg                 Median absolute deviation to use for manual


  --trim_strategy arg               Trimming strategy to apply: 'dna' or 'rna' 

                                    (or 'none' to disable trimming)

  --dmean_win_size arg              Window size for coarse stall event 


  --dmean_threshold arg             Threhold for coarse stall event detection

  --jump_threshold arg              Threshold level for rna stall detection

  --pt_scaling                      Enable polyT/adapter max detection for read


  --pt_median_offset arg            Set polyT median offset for setting read 

                                    scaling median (default 2.5)

  --adapter_pt_range_scale arg      Set polyT/adapter range scale for setting 

                                    read scaling median absolute deviation 

                                    (default 5.2)

  --pt_required_adapter_drop arg    Set minimum required current drop from 

                                    adapter max to polyT detection. (default 


  --pt_minimum_read_start_index arg Set minimum index for read start sample 

                                    required to attempt polyT scaling. (default


  --log_speed_frequency arg         How often to print out basecalling speed.

  --barcoding_config_file arg       Configuration file to use for barcoding.

  --num_barcode_threads arg         Number of worker threads to use for 


  --barcode_kits arg                Space separated list of barcoding kit(s) or

                                    expansion kit(s) to detect against. Must be

                                    in double quotes.

  --trim_barcodes                   Trim the barcodes from the output sequences

                                    in the FastQ files.

  --num_extra_bases_trim arg        How vigorous to be in trimming the barcode.

                                    Default is 0 i.e. the length of the 

                                    detected barcode. A positive integer means 

                                    extra bases will be trimmed, a negative 

                                    number is how many fewer bases (less 

                                    vigorous) will be trimmed.

  --arrangements_files arg          Files containing arrangements.

  --score_matrix_filename arg       File containing mismatch score matrix.

  --start_gap1 arg                  Gap penalty for aligning before the 


  --end_gap1 arg                    Gap penalty for aligning after the 


  --open_gap1 arg                   Penalty for opening a new gap in the 


  --extend_gap1 arg                 Penalty for extending a gap in the 


  --start_gap2 arg                  Gap penalty for aligning before the query.

  --end_gap2 arg                    Gap penalty for aligning after the query.

  --open_gap2 arg                   Penalty for opening a new gap in the query.

  --extend_gap2 arg                 Penalty for extending a gap in the query.

  --min_score arg                   Minimum score to consider a valid 


  --min_score_rear_override arg     Minimum score to consider a valid alignment

                                    for the rear barcode only (and min_score 

                                    will then be used for the front only when 

                                    this is set).

  --front_window_size arg           Window size for the beginning barcode.

  --rear_window_size arg            Window size for the ending barcode.

  --require_barcodes_both_ends      Reads will only be classified if there is a

                                    barcode above the min_score at both ends of

                                    the read.

  --allow_inferior_barcodes         Reads will still be classified even if both

                                    the barcodes at the front and rear (if 

                                    applicable) were not the best scoring 

                                    barcodes above the min_score.

  --detect_mid_strand_barcodes      Search for barcodes through the entire 

                                    length of the read.

  --min_score_mid_barcodes arg      Minimum score for a barcode to be detected 

                                    in the middle of a read.

  --num_barcoding_buffers arg       Number of GPU memory buffers to allocate to

                                    perform barcoding into. Controls level of 

                                    parallelism on GPU for barcoding.

  -q [ --records_per_fastq ] arg    Maximum number of records per fastq file, 0

                                    means use a single file (per worker, per 

                                    run id).

  --read_batch_size arg             Maximum batch size, in reads, for grouping 

                                    input files.

  --compress_fastq                  Compress fastq output files with gzip.

  -i [ --input_path ] arg           Path to input fast5 files.

  --input_file_list arg             Optional file containing list of input 

                                    fast5 files to process from the input_path.

  -s [ --save_path ] arg            Path to save fastq files.

  -l [ --read_id_list ] arg         File containing list of read ids to filter 


  -p [ --port ] arg                 Hostname and port for connecting to 

                                    basecall service (ie 'myserver:5555'), or 

                                    port only (ie '5555'), in which case 

                                    localhost is assumed.

  -r [ --recursive ]                Search for input files recursively.

  --fast5_out                       Choice of whether to do fast5 output.

  --resume                          Resume a previous basecall run using the 

                                    same output folder.

  --max_block_size arg              Maximum size (in events) of outgoing 

                                    basecall messages (server mode only).

  --disable_events                  Disable the transmission of event tables 

                                    when receiving reads back from the basecall


  --progress_stats_frequency arg    Frequency in seconds in which to report 

                                    progress statistics, if supplied will 

                                    replace the default progress display.

  --client_id arg                   Optional unique identifier (non-negative 

                                    integer) for this instance of the Guppy 

                                    Client Basecaller, if supplied will form 

                                    part of the output filenames.

  -h [ --help ]                     produce help message

  -v [ --version ]                  print version number

  -c [ --config ] arg               Config file to use

  -d [ --data_path ] arg            Path to use for loading any data files the 

                                    application requires.





$ nvidia-smi

Sun Jan 19 12:06:32 2020       


| NVIDIA-SMI 390.129                Driver Version: 390.129                   |


| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |

| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |


|   0  GeForce GTX 1080    Off  | 00000000:07:00.0  On |                  N/A |

| 19%   52C    P8     9W / 200W |    334MiB /  8118MiB |      0%      Default |




| Processes:                                                       GPU Memory |

|  GPU       PID   Type   Process name                             Usage      |


|    0      1256      G   /usr/lib/xorg/Xorg                           162MiB |

|    0      1501      G   /usr/bin/gnome-shell                         100MiB |

|    0      3217      G   ...uest-channel-token=12657443395681243138    68MiB |


GTX 1080の8 GB VRAM(GDDR5X)になっている。




CPU版と同様の流れでランできる。異なるのはCPUスレッドの代わりにデバイス番号を指定するところ。1台しか利用できないなら--device autoか--device cuda:0を指定すればO.K。

guppy_basecaller \
--flowcell FLO-MIN106 \
--kit SQK-LSK109 \
-x cuda:0 \
-i fast5_dir \
-s output_dir2 -r
  • -x [ --device ]      Specify basecalling device: 'auto', or  'cuda:<device_id>'.
  • --flowcell      Flowcell to find a configuration for
  • -kit      Kit to find a configuration for
  • -i [ --input_path ]     Path to input fast5 files.
  • -s [ --save_path ]      Path to save fastq files.



ラン中はGPU使用率がほぼ100%になる(右上)(nvtopを使用 *1)。



GTX 1080 =>18.5s

CPU(AMD 3700x) => 7m56.6s







git clone 
mkdir -p nvtop/build && cd nvtop/build
sudo make install
nvtop -h



#追記 nvtopが導入できない環境ならnvidia-smiを使う。GPU1をモニター。1秒おきに更新(-l 1)。
nvidia-smi -i 1 -l 1