{"action":"created","issue":{"url":"https://api.github.com/repos/dmlc/mxnet/issues/4699","repository_url":"https://api.github.com/repos/dmlc/mxnet","labels_url":"https://api.github.com/repos/dmlc/mxnet/issues/4699/labels{/name}","comments_url":"https://api.github.com/repos/dmlc/mxnet/issues/4699/comments","events_url":"https://api.github.com/repos/dmlc/mxnet/issues/4699/events","html_url":"https://github.com/dmlc/mxnet/issues/4699","id":201246907,"number":4699,"title":"[Scala] fail to run the example ExampleCustomOpWithRtc.scala","user":{"login":"Ldpe2G","id":2424744,"avatar_url":"https://avatars.githubusercontent.com/u/2424744?v=3","gravatar_id":"","url":"https://api.github.com/users/Ldpe2G","html_url":"https://github.com/Ldpe2G","followers_url":"https://api.github.com/users/Ldpe2G/followers","following_url":"https://api.github.com/users/Ldpe2G/following{/other_user}","gists_url":"https://api.github.com/users/Ldpe2G/gists{/gist_id}","starred_url":"https://api.github.com/users/Ldpe2G/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ldpe2G/subscriptions","organizations_url":"https://api.github.com/users/Ldpe2G/orgs","repos_url":"https://api.github.com/users/Ldpe2G/repos","events_url":"https://api.github.com/users/Ldpe2G/events{/privacy}","received_events_url":"https://api.github.com/users/Ldpe2G/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2017-01-17T11:08:20Z","updated_at":"2017-01-19T09:26:44Z","closed_at":null,"body":"\r\n\r\n## Environment info\r\nOperating System: Ubuntu 14.04\r\n\r\nCompiler: gcc 4.8\r\n\r\nPackage used (Python/R/Scala/Julia): Scala\r\n\r\nMXNet version: v0.9\r\n\r\nOr if installed from source:\r\n\r\nMXNet commit hash (`git rev-parse HEAD`): 6d05979cce53041f356204b17db2effb09371328\r\n\r\n## Error Message:\r\n```bash\r\nSLF4J: Class path contains multiple SLF4J bindings.\r\nSLF4J: Found binding in [jar:file:/home/ldpe2g/Mxnet/mxnet_Scala/mxnet/scala-package/assembly/linux-x86_64-gpu/target/mxnet-full_2.11-linux-x86_64-gpu-0.1.2-SNAPSHOT.jar!/org/slf4j/impl/StaticLoggerBinder.class]\r\nSLF4J: Found binding in [jar:file:/home/ldpe2g/Mxnet/mxnet_Scala/mxnet/scala-package/examples/target/classes/lib/slf4j-log4j12-1.7.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]\r\nSLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.\r\nSLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]\r\n2017-01-17 18:21:35,123 [main] [MXNetJVM] [INFO] - Try loading mxnet-scala from native path.\r\n2017-01-17 18:21:35,124 [main] [MXNetJVM] [WARN] - Failed to load from native path. Exception:\r\njava.lang.UnsatisfiedLinkError: no mxnet-scala in java.library.path\r\n\tat java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)\r\n\tat java.lang.Runtime.loadLibrary0(Runtime.java:870)\r\n\tat java.lang.System.loadLibrary(System.java:1122)\r\n\tat ml.dmlc.mxnet.Base$.tryLoadLibraryOS(Base.scala:76)\r\n\tat ml.dmlc.mxnet.Base$.<init>(Base.scala:45)\r\n\tat ml.dmlc.mxnet.Base$.<clinit>(Base.scala)\r\n\tat ml.dmlc.mxnet.Operator$.register(Operator.scala:217)\r\n\tat ml.dmlc.mxnet.examples.customop.ExampleCustomOpWithRtc$.<init>(ExampleCustomOpWithRtc.scala:104)\r\n\tat ml.dmlc.mxnet.examples.customop.ExampleCustomOpWithRtc$.<clinit>(ExampleCustomOpWithRtc.scala)\r\n\tat ml.dmlc.mxnet.examples.customop.ExampleCustomOpWithRtc.main(ExampleCustomOpWithRtc.scala)\r\n2017-01-17 18:21:35,125 [main] [MXNetJVM] [INFO] - Try loading mxnet-scala-linux-x86_64-gpu from native path.\r\n2017-01-17 18:21:35,125 [main] [MXNetJVM] [INFO] - Try loading mxnet-scala-linux-x86_64-cpu from native path.\r\n2017-01-17 18:21:35,125 [main] [MXNetJVM] [WARN] - MXNet Scala native library not found in path. Copying native library from the archive. Consider installing the library somewhere in the path (for Windows: PATH, for Linux: LD_LIBRARY_PATH), or specifying by Java cmd option -Djava.library.path=[lib path].Exception:\r\njava.lang.UnsatisfiedLinkError: no mxnet-scala-linux-x86_64-cpu in java.library.path\r\n\tat java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)\r\n\tat java.lang.Runtime.loadLibrary0(Runtime.java:870)\r\n\tat java.lang.System.loadLibrary(System.java:1122)\r\n\tat ml.dmlc.mxnet.Base$.tryLoadLibraryXPU(Base.scala:102)\r\n\tat ml.dmlc.mxnet.Base$.tryLoadLibraryOS(Base.scala:83)\r\n\tat ml.dmlc.mxnet.Base$.<init>(Base.scala:45)\r\n\tat ml.dmlc.mxnet.Base$.<clinit>(Base.scala)\r\n\tat ml.dmlc.mxnet.Operator$.register(Operator.scala:217)\r\n\tat ml.dmlc.mxnet.examples.customop.ExampleCustomOpWithRtc$.<init>(ExampleCustomOpWithRtc.scala:104)\r\n\tat ml.dmlc.mxnet.examples.customop.ExampleCustomOpWithRtc$.<clinit>(ExampleCustomOpWithRtc.scala)\r\n\tat ml.dmlc.mxnet.examples.customop.ExampleCustomOpWithRtc.main(ExampleCustomOpWithRtc.scala)\r\n2017-01-17 18:21:35,136 [main] [ml.dmlc.mxnet.util.NativeLibraryLoader] [INFO] - Loading libmxnet-scala.so from /lib/native/ copying to mxnet-scala\r\n[18:21:37] src/io/iter_mnist.cc:91: MNISTIter: load 60000 images, shuffle=1, shape=(100,784)\r\n[18:21:37] src/io/iter_mnist.cc:91: MNISTIter: load 10000 images, shuffle=1, shape=(100,784)\r\n[18:21:38] ./include/dmlc/logging.h:208: [18:21:38] src/common/mxrtc.cc:46: Check failed: err = cuModuleLoadDataEx(&module, ptx_, 0, 0, 0) == CUDA_SUCCESS (201 vs. 0) CudaError: 201\r\nml.dmlc.mxnet.MXNetError: [18:21:38] src/common/mxrtc.cc:46: Check failed: err = cuModuleLoadDataEx(&module, ptx_, 0, 0, 0) == CUDA_SUCCESS (201 vs. 0) CudaError: 201\r\n\tat ml.dmlc.mxnet.Base$.checkCall(Base.scala:116)\r\n\tat ml.dmlc.mxnet.Rtc.push(Rtc.scala:62)\r\n\tat ml.dmlc.mxnet.examples.customop.ExampleCustomOpWithRtc$Softmax.forward(ExampleCustomOpWithRtc.scala:60)\r\n\tat ml.dmlc.mxnet.CustomOp.forwardEntry(Operator.scala:65)\r\n[18:21:38] ./include/dmlc/logging.h:208: [18:21:38] src/operator/custom.cc:81: Check failed: op_info_->forward(ptrs.size(), ptrs.data(), tags.data(), reqs.data(), ctx.is_train, op_info_->p_forward) \r\nterminate called after throwing an instance of 'dmlc::Error'\r\n  what():  [18:21:38] src/operator/custom.cc:81: Check failed: op_info_->forward(ptrs.size(), ptrs.data(), tags.data(), reqs.data(), ctx.is_train, op_info_->p_forward) \r\n```\r\n\r\n## Steps to reproduce\r\n1. compile mxnet with CUDA & NVRTC and then compile the scalapkg\r\n```bash\r\nmake -j4 && make scalapkg\r\n```\r\n\r\n2.\r\n```bash \r\ncd scala-package/examples/scripts/customop\r\n```\r\n\r\n\r\n3.\r\n```bash\r\n bash run_customopwithrtc.sh path_to_mnist_data\r\n```\r\n\r\n## What have you tried to solve it?\r\n\r\nI have locate the commit which cause the problem, it's the pr #4528 \r\nafter I roll back to the commit 50a3a3184e3034a98b2d4ad82f186d035803ab9b before #4528 \r\nthe problem have solved.\r\n\r\nAnd I also check the CUDA doc, error code 201 means:\r\n\r\nCUDA_ERROR_INVALID_CONTEXT = 201\r\nThis most frequently indicates that there is no context bound to the current thread. This can also be returned if the context passed to an API call is not a valid handle (such as a context that has had cuCtxDestroy() invoked on it). This can also be returned if a user mixes different API versions (i.e. 3010 context with 3020 API calls). See cuCtxGetApiVersion() for more details.\r\n\r\n\r\n@javelinjs @piiswrong \r\n"},"comment":{"url":"https://api.github.com/repos/dmlc/mxnet/issues/comments/273722423","html_url":"https://github.com/dmlc/mxnet/issues/4699#issuecomment-273722423","issue_url":"https://api.github.com/repos/dmlc/mxnet/issues/4699","id":273722423,"user":{"login":"Ldpe2G","id":2424744,"avatar_url":"https://avatars.githubusercontent.com/u/2424744?v=3","gravatar_id":"","url":"https://api.github.com/users/Ldpe2G","html_url":"https://github.com/Ldpe2G","followers_url":"https://api.github.com/users/Ldpe2G/followers","following_url":"https://api.github.com/users/Ldpe2G/following{/other_user}","gists_url":"https://api.github.com/users/Ldpe2G/gists{/gist_id}","starred_url":"https://api.github.com/users/Ldpe2G/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ldpe2G/subscriptions","organizations_url":"https://api.github.com/users/Ldpe2G/orgs","repos_url":"https://api.github.com/users/Ldpe2G/repos","events_url":"https://api.github.com/users/Ldpe2G/events{/privacy}","received_events_url":"https://api.github.com/users/Ldpe2G/received_events","type":"User","site_admin":false},"created_at":"2017-01-19T09:26:44Z","updated_at":"2017-01-19T09:26:44Z","body":"@yxzf how did you run the script, could you provide the full command?"}}
{"actor":{"display_login":"Ldpe2G"}}