-
Notifications
You must be signed in to change notification settings - Fork 225
Open
Description
I've encountered segmentation fault error when using chainerrl with GPU in Docker. The error occurs if I import chainerrl first, then perform a cuda.get_device(args).use(). The quick fix my colleague and I found is to do cuda.get_device(args).use()first, then import chainerrl. Both scenarios are shown below.
root@9d606b33d95a:/home# python3
Python 3.7.6 (default, Dec 19 2019, 23:50:13)
[GCC 7.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from chainer import cuda
>>> import chainerrl
>>> cuda.get_device(1).use()
Segmentation fault (core dumped)
root@9d606b33d95a:/home# python3
Python 3.7.6 (default, Dec 19 2019, 23:50:13)
[GCC 7.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from chainer import cuda
>>> cuda.get_device(1).use()
>>> import chainerrl
>>>
Dockerfile
FROM nvidia/cuda:10.1-cudnn7-devel-ubuntu18.04
RUN apt-get update
RUN apt-get install -y wget git build-essential cmake libxerces-c-dev libfox-1.6-dev libgdal-dev libproj-dev libgl2ps-dev swig && rm -rf /var/lib/apt/lists/*
RUN apt update \
&& apt install software-properties-common -y \
&& add-apt-repository ppa:deadsnakes/ppa -y \
&& apt-get update \
&& apt install python3.7 -y \
&& update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1 \
&& update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.7 2
RUN apt-get install python3.7-dev python3-pip python3-wheel python3-setuptools -y
RUN git clone https://github.com/chainer/chainerrl.git \
&& cd chainerrl \
&& python3 setup.py install
RUN pip3 install cupy-cuda101
My current computer configurations:
root@9d606b33d95a:/home# nvidia-smi
Thu Jan 16 21:07:09 2020
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.33.01 Driver Version: 440.33.01 CUDA Version: 10.2 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 TITAN RTX On | 00000000:3B:00.0 Off | N/A |
| 63% 81C P2 246W / 280W | 5777MiB / 24220MiB | 99% Default |
+-------------------------------+----------------------+----------------------+
| 1 TITAN RTX On | 00000000:AF:00.0 On | N/A |
| 41% 59C P8 30W / 280W | 1422MiB / 24217MiB | 9% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
+-----------------------------------------------------------------------------+
root@9d606b33d95a:/home# nvcc -V
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2019 NVIDIA Corporation
Built on Sun_Jul_28_19:07:16_PDT_2019
Cuda compilation tools, release 10.1, V10.1.243
root@9d606b33d95a:/home/DRL_Traffic_Corridor#
root@9d606b33d95a:/home# lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 32
On-line CPU(s) list: 0-31
Thread(s) per core: 2
Core(s) per socket: 8
Socket(s): 2
NUMA node(s): 2
Vendor ID: GenuineIntel
CPU family: 6
Model: 85
Model name: Intel(R) Xeon(R) Silver 4110 CPU @ 2.10GHz
Stepping: 4
CPU MHz: 800.012
CPU max MHz: 3000.0000
CPU min MHz: 800.0000
BogoMIPS: 4200.00
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 1024K
L3 cache: 11264K
NUMA node0 CPU(s): 0-7,16-23
NUMA node1 CPU(s): 8-15,24-31
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cdp_l3 invpcid_single pti ssbd mba ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb intel_pt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts pku ospke md_clear flush_l1d
root@9d606b33d95a:/home# uname -a
Linux 9d606b33d95a 5.0.0-37-generic #40~18.04.1-Ubuntu SMP Thu Nov 14 12:06:39 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
This is the furthest we could debug this issue. This was initially quite an issue until we found out about the import fix. We are just curious why does importing chainerrl throws a segmentation fault.
Metadata
Metadata
Assignees
Labels
No labels