anirudh2290 opened a new pull request #10014: Fix crash with mx.nd.ones
URL: https://github.com/apache/incubator-mxnet/pull/10014
 
 
   ## Description ##
   
   Reported by @haojin2
   
   Execution of code like the following on device with only 8 gpus will crash 
the process instead of throwing an exception.
   ```
   mx.nd.ones((2,2), ctx=mx.gpu(11))
   ```
   The exception is thrown here: 
https://github.com/apache/incubator-mxnet/blob/master/src/engine/threaded_engine_perdevice.cc#L239
 and since its not inside `ExecuteOprBlock`, there is no corresponding catch 
and terminate is called. 
   
   Call cudaSetDevice and throw an exception before pushing to engine to avoid 
crash.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to