larroy commented on issue #4659: gpu memory allocate will be error when using multiprocessing.Process URL: https://github.com/apache/incubator-mxnet/issues/4659#issuecomment-525088694 I also can't reproduce this with the latest master ``` In [2]: import numpy as np ...: import mxnet as mx ...: from multiprocessing import Process, current_process ...: ...: def test(): ...: print("process id is {:s}".format(current_process().name)) ...: a = mx.nd.array(np.zeros((100, 100, 100, 100)), mx.gpu(0)) ...: a.asnumpy() ...: ...: if __name__ == '__main__': ...: runs = [Process(target=test) for i in range(2)] # 1 or 2 or N process is the same error ...: for p in runs: ...: p.start() ...: for p in runs: ...: p.join() ...: print("done!") ...: process id is Process-2 process id is Process-3 done! ``` ``` In [1]: import numpy as np ...: import mxnet as mx ...: from multiprocessing import Process, current_process ...: ...: def test(): ...: print("process id is {:s}".format(current_process().name)) ...: a = mx.nd.array(np.zeros((100, 100, 100, 100)), mx.gpu(0)) ...: a.asnumpy() ...: ...: if __name__ == '__main__': ...: runs = [Process(target=test) for i in range(1)] # 1 or 2 or N process is the same error ...: for p in runs: ...: p.start() ...: for p in runs: ...: p.join() ...: print("done!") ...: process id is Process-1 done! ```
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
