[ERROR] GCN crashes with MXNet backend and GPU #1 on certain hardware
❓ Questions and Help
Error in Function.backward: Traceback (most recent call last):
File "/home/byli/.conda/envs/dgl-torch/lib/python3.6/site-packages/mxnet/autograd.py", line 458, in backward_entry
rets = self.backward(output_grads)
File "/home/byli/.conda/envs/dgl-torch/lib/python3.6/site-packages/dgl-0.4.1-py3.6-linux-x86_64.egg/dgl/backend/mxnet/tensor.py", line 509, in backward
self.in_map[1], self.out_map[1])
File "/home/byli/.conda/envs/dgl-torch/lib/python3.6/site-packages/dgl-0.4.1-py3.6-linux-x86_64.egg/dgl/kernel.py", line 415, in backward_copy_reduce
X_rows, out_rows)
File "dgl/_ffi/_cython/./function.pxi", line 287, in dgl._ffi._cy3.core.FunctionBase.call
File "dgl/_ffi/_cython/./function.pxi", line 232, in dgl._ffi._cy3.core.FuncCall
File "dgl/_ffi/_cython/./base.pxi", line 154, in dgl._ffi._cy3.core.CALL
dgl._ffi.base.DGLError: [15:28:59] /home/byli/dgl/src/kernel/cuda/binary_reduce_sum.cu:107: Check failed: e == CUSPARSE_STATUS_SUCCESS: CUSPARSE ERROR: 1
Stack trace:
[bt] (0) /home/byli/.conda/envs/dgl-torch/lib/python3.6/site-packages/dgl-0.4.1-py3.6-linux-x86_64.egg/dgl/libdgl.so(dmlc::LogMessageFatal::~LogMessageFatal()+0x43) [0x7f5954f5e2a3]
[bt] (1) /home/byli/.conda/envs/dgl-torch/lib/python3.6/site-packages/dgl-0.4.1-py3.6-linux-x86_64.egg/dgl/libdgl.so(void dgl::kernel::cuda::CusparseCsrmm2
Traceback (most recent call last):
File "train.py", line 135, in
terminate called after throwing an instance of 'dmlc::Error' what(): [15:28:59] /home/byli/dgl/src/runtime/cuda/cuda_device_api.cc:103: Check failed: e == cudaSuccess || e == cudaErrorCudartUnloading: CUDA: an illegal memory access was encountered Stack trace: [bt] (0) /home/byli/.conda/envs/dgl-torch/lib/python3.6/site-packages/dgl-0.4.1-py3.6-linux-x86_64.egg/dgl/libdgl.so(dgl::runtime::CUDADeviceAPI::FreeDataSpace(DLContext, void*)+0x6bb) [0x7f595564b68b] [bt] (1) /home/byli/.conda/envs/dgl-torch/lib/python3.6/site-packages/dgl-0.4.1-py3.6-linux-x86_64.egg/dgl/libdgl.so(dgl::runtime::NDArray::Internal::DefaultDeleter(dgl::runtime::NDArray::Container*)+0x11d) [0x7f595558750d] [bt] (2) /home/byli/.conda/envs/dgl-torch/lib/python3.6/site-packages/dgl-0.4.1-py3.6-linux-x86_64.egg/dgl/libdgl.so(dgl::CSR::~CSR()+0x40) [0x7f59555c06d0] [bt] (3) /home/byli/.conda/envs/dgl-torch/lib/python3.6/site-packages/dgl-0.4.1-py3.6-linux-x86_64.egg/dgl/libdgl.so(std::_Sp_counted_base<(__gnu_cxx::_Lock_policy)2>::_M_release()+0x46) [0x7f5954f88696] [bt] (4) /home/byli/.conda/envs/dgl-torch/lib/python3.6/site-packages/dgl-0.4.1-py3.6-linux-x86_64.egg/dgl/libdgl.so(std::_Sp_counted_ptr<dgl::ImmutableGraph*, (__gnu_cxx::_Lock_policy)2>::_M_dispose()+0x56) [0x7f59555e7e26] [bt] (5) /home/byli/.conda/envs/dgl-torch/lib/python3.6/site-packages/dgl-0.4.1-py3.6-linux-x86_64.egg/dgl/libdgl.so(DGLObjectFree+0xb5) [0x7f5955555225] [bt] (6) /home/byli/.conda/envs/dgl-torch/lib/python3.6/site-packages/dgl-0.4.1-py3.6-linux-x86_64.egg/dgl/_ffi/_cy3/core.cpython-36m-x86_64-linux-gnu.so(+0xec7b) [0x7f5951104c7b] [bt] (7) python(+0x19aa5e) [0x561c36d07a5e] [bt] (8) python(+0xf2198) [0x561c36c5f198]
Aborted (core dumped)
mxnet version is mxnet-cu100 1.5.1.post0
The error of
dgl._ffi.base.DGLError: [15:28:59] /home/byli/dgl/src/kernel/cuda/binary_reduce_sum.cu:107: Check failed: e == CUSPARSE_STATUS_SUCCESS: CUSPARSE ERROR`
is usually caused by mis-installation of gpu-driver, cuda, mxnet or dgl.
Which driver version and cuda did you installed? How did you install mxnet and dgl? pip or conda?
nvcc: NVIDIA (R) Cuda compiler driver Copyright (c) 2005-2018 NVIDIA Corporation Built on Sat_Aug_25_21:08:01_CDT_2018 Cuda compilation tools, release 10.0, V10.0.130
DGL is built from source code, and can run normally when backend is pytorch. mxnet is built by using pip.
which context do you use? 'cuda:0' or 'cuda:1'?
Context means "--gpu i"? I use --gpu 1, cannot run. I just change to --gpu 0, can run. What is the reason about it?
When I used --gpu 0, it can run and finish the training, but a segmentation fault occurs after training.
$ DGLBACKEND=mxnet python train.py --dataset cora --gpu 0 Namespace(dataset='cora', dropout=0.5, gpu=0, lr=0.03, n_epochs=200, n_hidden=16, n_layers=1, self_loop=False, syn_gnp_n=1000, syn_gnp_p=0.0, syn_nclasses=10, syn_nfeats=500, syn_seed=42, syn_test_ratio=0.5, syn_train_ratio=0.1, syn_type='gnp', syn_val_r atio=0.2, weight_decay=0.0005) ----Data statistics------' #Edges 10556 #Classes 7 #Train samples 140 #Val samples 300 #Test samples 1000 gcn0_ ( Parameter graphconv0_weight (shape=(1433, 16), dtype=<class 'numpy.float32'>) Parameter graphconv0_bias (shape=(16,), dtype=<class 'numpy.float32'>) Parameter graphconv1_weight (shape=(16, 7), dtype=<class 'numpy.float32'>) Parameter graphconv1_bias (shape=(7,), dtype=<class 'numpy.float32'>) ) Epoch 00003 | Time(s) 0.0188 | Loss 1.8378 | Accuracy 0.4167 | ETputs(KTEPS) 562.16 Epoch 00004 | Time(s) 0.0127 | Loss 1.7960 | Accuracy 0.4200 | ETputs(KTEPS) 829.77 ... Epoch 00197 | Time(s) 0.0075 | Loss 0.3343 | Accuracy 0.8167 | ETputs(KTEPS) 1406.28 Epoch 00198 | Time(s) 0.0075 | Loss 0.3308 | Accuracy 0.8233 | ETputs(KTEPS) 1403.52 Epoch 00199 | Time(s) 0.0075 | Loss 0.3488 | Accuracy 0.8200 | ETputs(KTEPS) 1404.78 Test accuracy 81.10%
Segmentation fault: 11
Stack trace: [bt] (0) /home/byli/.conda/envs/dgl-torch/lib/python3.6/site-packages/mxnet/libmxnet.so(+0x2e6b140) [0x7faddfb6b140] [bt] (1) /lib/x86_64-linux-gnu/libc.so.6(+0x3ef20) [0x7fae7628ef20] [bt] (2) /home/byli/.conda/envs/dgl-torch/lib/python3.6/site-packages/dgl-0.4.1-py3.6-linux-x86_64.egg/dgl/libdgl.so(+0xdd3d6e) [0x7fad83415d6e] [bt] (3) /home/byli/.conda/envs/dgl-torch/lib/python3.6/site-packages/dgl-0.4.1-py3.6-linux-x86_64.egg/dgl/libdgl.so(+0xdfa627) [0x7fad8343c627] [bt] (4) /home/byli/.conda/envs/dgl-torch/lib/python3.6/site-packages/dgl-0.4.1-py3.6-linux-x86_64.egg/dgl/libdgl.so(dgl::runtime::CUDADeviceAPI::FreeDataSpace(DLContext, void*)+0x31) [0x7fad8310d001] [bt] (5) /home/byli/.conda/envs/dgl-torch/lib/python3.6/site-packages/dgl-0.4.1-py3.6-linux-x86_64.egg/dgl/libdgl.so(dgl::runtime::WorkspacePool::Pool::Release(DLContext, dgl::runtime::DeviceAPI*)+0x32c) [0x7fad8305d32c] [bt] (6) /home/byli/.conda/envs/dgl-torch/lib/python3.6/site-packages/dgl-0.4.1-py3.6-linux-x86_64.egg/dgl/libdgl.so(dgl::runtime::WorkspacePool::~WorkspacePool()+0x37) [0x7fad8305bbe7] [bt] (7) /data/home/byli/.conda/envs/dgl-torch/bin/../lib/libstdc++.so.6(+0xaaad1) [0x7fae72504ad1] [bt] (8) /lib/x86_64-linux-gnu/libc.so.6(+0x43041) [0x7fae76293041]
For --gpu 1 will crash mxnet, this is a known bug. We will try to fix it.
For the second problem. This seems some environment conflict between conda and pip. It is better to not co-install mxnet and pytorch especially one with pip and another with conda.
The second seg fault error should be fixed in the latest commit. Could you try reinstall dgl with pip uninstall dgl-cu101 and pip install --pre dgl-cu101 # or other cuda version to see whether this error still occurs?
Sorry, I am using cuda 10.0. And I built dgl from source code using branch 0.4.x. Could you tell me what is the latest commit? So I can read it and update my code.
For --gpu 1 will crash mxnet, this is a known bug. We will try to fix it.
For the second problem. This seems some environment conflict between conda and pip. It is better to not co-install mxnet and pytorch especially one with pip and another with conda.
Thanks a lot.
You can use pip install --pre dgl-cu100 or should be fixed by d30a69b commit (the latest one you can see on master branch)
pip install --pre dgl-cu101
I have tried your advice in another environment, it's ok.
You can use
pip install --pre dgl-cu100or should be fixed byd30a69bcommit (the latest one you can see on master branch)
Okay, thank you.
In our P3.8xlarge (V100) machine, --gpu 1 will cause crash but in P2.8xlarge (K80) machine, will not.