---
# System prepended metadata

title: '[log] --cpu-only'
tags: [Clara, 基因體, Parabricks-v3.5, 二級分析, NVIDIA, Parabricks]

---

[log] --cpu-only
===
###### tags: `Parabricks-v3.5`
###### tags: `基因體`, `NVIDIA`, `Clara`, `Parabricks`, `二級分析`

<br>

[TOC]

<br>

## `sudo python3 installer.py --cpu-only`
- [INSTALLATION OPTIONS](https://docs.nvidia.com/clara/parabricks/v3.5/text/local_installation.html)
    - `--cpu-only`
        Install on a CPU server. No GPU accelerated tools will run with this option

<br>

## 測試指令

```bash=
pbrun germline \
   --ref parabricks_sample/Ref/Homo_sapiens_assembly38.fasta \
   --in-fq dataset/WGS-LIS-AI018A_R1.fastq.gz \
           dataset/WGS-LIS-AI018A_R2.fastq.gz \
   --knownSites parabricks_sample/Ref/Homo_sapiens_assembly38.known_indels.vcf.gz \
   --out-bam output.bam \
   --out-variants output.vcf \
   --out-recal-file report.txt \
   --x3
```

<br>

## 找不到 nvidia-smi
```=
$ pbrun germline    --ref parabricks_sample/Ref/Homo_sapiens_assembly38.fasta    --in-fq dataset/WGS-LIS-AI018A_R1.fastq.gz            dataset/WGS-LIS-AI018A_R2.fastq.gz    --knownSites parabricks_sample/Ref/Homo_sapiens_assembly38.known_indels.vcf.gz    --out-bam output.bam    --out-variants output.vcf    --out-recal-file report.txt    --x3
Please visit https://docs.nvidia.com/clara/#parabricks for detailed documentation


[pbutils.py] GetNumGPUs():
[Parabricks Options Mesg]: Automatically generating ID prefix
[Parabricks Options Mesg]: Read group created for /uploads/workspace/dataset/WGS-LIS-AI018A_R1.fastq.gz and
/uploads/workspace/dataset/WGS-LIS-AI018A_R2.fastq.gz
[Parabricks Options Mesg]: @RG\tID:H3WFJDSXX.1\tLB:lib1\tPL:bar\tSM:sample\tPU:H3WFJDSXX.1

[pbutils.py] GetNumGPUs():
docker run -u=1000:1000 --rm -w=/uploads/workspace --net=host -v /opt/parabricks:/INSTALL/ -v /uploads/workspace/RMYVG0AE:/uploads/workspace/RMYVG0AE -v /uploads/workspace:/uploads/workspace -v /uploads/workspace/parabricks_sample/Ref:/uploads/workspace/parabricks_sample/Ref -v /uploads/workspace/dataset:/uploads/workspace/dataset parabricks/release:v3.5.0 fq2bam --ref /uploads/workspace/parabricks_sample/Ref/Homo_sapiens_assembly38.fasta --in-fq /uploads/workspace/dataset/WGS-LIS-AI018A_R1.fastq.gz /uploads/workspace/dataset/WGS-LIS-AI018A_R2.fastq.gz @RG\tID:H3WFJDSXX.1\tLB:lib1\tPL:bar\tSM:sample\tPU:H3WFJDSXX.1 --knownSites /uploads/workspace/parabricks_sample/Ref/Homo_sapiens_assembly38.known_indels.vcf.gz --out-bam /uploads/workspace/output.bam --out-recal-file /uploads/workspace/report.txt --memory-limit 55 --num-cpu-threads 0 --tmp-dir /uploads/workspace/RMYVG0AE --num-gpus 0 --x3
Please visit https://docs.nvidia.com/clara/#parabricks for detailed documentation


Traceback (most recent call last):
  File "/parabricks/run_pipeline.py", line 7, in <module>
    sys.exit(PB.pb_main())
  File "PB.pyx", line 1397, in PB.pb_main
  File "/parabricks/pbargs.py", line 1814, in getArgs
    return PBRun(sys.argv)
  File "/parabricks/pbargs.py", line 617, in __init__
    self.runArgs = getattr(self, args.command)(argList)
  File "/parabricks/pbargs.py", line 682, in fq2bam
    self.addToParser(bsmb_parser_sysgroup, sysOptionGenerator().allOptions)
  File "/parabricks/pbargs.py", line 53, in __init__
    PBOption(category="sysOption", name="--num-gpus", default=GetNumGPUs(), typeName=int, helpStr="Number of GPUs to use for a run"),
  File "/parabricks/pbutils.py", line 87, in GetNumGPUs
    output = subprocess.check_output(["nvidia-smi", "-L"], universal_newlines=True)
  File "/usr/lib/python3.7/subprocess.py", line 411, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.7/subprocess.py", line 488, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib/python3.7/subprocess.py", line 800, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.7/subprocess.py", line 1551, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'nvidia-smi': 'nvidia-smi'

Could not run fq2bam as part of germline pipeline
Exiting pbrun ...
```

<br>

## 偽裝 nvidia-smi 指令
### Dockerfile
```dockerfile=
FROM parabricks/release:v3.5.0
ADD nvidia-smi /usr/bin/nvidia-smi
RUN chmod +x /usr/bin/nvidia-smi
```

nvidia-smi
```
#!/usr/bin/env python3
print('GPU 0: NVIDIA Tesla P100-PCIE-16GB (UUID: GPU-56989d15-2d15-c960-1729-2a713436bf5d)\n')
```
- 在主機的終端機中輸入 nvidia-smi，以獲取輸出結果

### log
```
$ pbrun germline    --ref parabricks_sample/Ref/Homo_sapiens_assembly38.fasta    --in-fq dataset/WGS-LIS-AI018A_R1.fastq.gz            dataset/WGS-LIS-AI018A_R2.fastq.gz    --knownSites parabricks_sample/Ref/Homo_sapiens_assembly38.known_indels.vcf.gz    --out-bam output.bam    --out-variants output.vcf    --out-recal-file report.txt    --x3
Please visit https://docs.nvidia.com/clara/#parabricks for detailed documentation


[pbutils.py] GetNumGPUs():
[Parabricks Options Mesg]: Automatically generating ID prefix
[Parabricks Options Mesg]: Read group created for /uploads/workspace/dataset/WGS-LIS-AI018A_R1.fastq.gz and
/uploads/workspace/dataset/WGS-LIS-AI018A_R2.fastq.gz
[Parabricks Options Mesg]: @RG\tID:H3WFJDSXX.1\tLB:lib1\tPL:bar\tSM:sample\tPU:H3WFJDSXX.1

[pbutils.py] GetNumGPUs():
docker run -u=1000:1000 --rm -w=/uploads/workspace --net=host -v /opt/parabricks:/INSTALL/ -v /uploads/workspace/SK7PJ5GI:/uploads/workspace/SK7PJ5GI -v /uploads/workspace:/uploads/workspace -v /uploads/workspace/parabricks_sample/Ref:/uploads/workspace/parabricks_sample/Ref -v /uploads/workspace/dataset:/uploads/workspace/dataset parabricks/release:v3.5.0 fq2bam --ref /uploads/workspace/parabricks_sample/Ref/Homo_sapiens_assembly38.fasta --in-fq /uploads/workspace/dataset/WGS-LIS-AI018A_R1.fastq.gz /uploads/workspace/dataset/WGS-LIS-AI018A_R2.fastq.gz @RG\tID:H3WFJDSXX.1\tLB:lib1\tPL:bar\tSM:sample\tPU:H3WFJDSXX.1 --knownSites /uploads/workspace/parabricks_sample/Ref/Homo_sapiens_assembly38.known_indels.vcf.gz --out-bam /uploads/workspace/output.bam --out-recal-file /uploads/workspace/report.txt --memory-limit 55 --num-cpu-threads 0 --tmp-dir /uploads/workspace/SK7PJ5GI --num-gpus 0 --x3
Please visit https://docs.nvidia.com/clara/#parabricks for detailed documentation


[Parabricks Options Mesg]: Checking argument compatibility
[Parabricks Options Error]: --num-gpus cannot be set to 0
[Parabricks Options Error]: Run with -h to see help

Could not run fq2bam as part of germline pipeline
Exiting pbrun ...

```