AWS SageMaker MXNet USE_CUDA=1

I am using the AWS ml.p2.xlarge sagemaker instance and conda_amazonei_mxnet_p36 kernel after install MXnet CUDA

!pip install mxnet-cu101

when I try to run the following code

mx_tfidf = mx.nd.sparse.array(tfidf_matrix, ctx=mx.gpu())

I am getting the following error

MXNetError: [19:54:53] src/storage/ 
Compile with USE_CUDA=1 to enable GPU usage

Please help me to resolve the issue




if you’re using the sagemaker notebook instance, use the conda_mxnet_p36 kernel instead and you should see the error go away.

The conda_amazonei_mxnet_p36 kernel pre-installs a special build of mxnet for elastic inference for which you need to add an eia accelerator to a cpu notebook instance type to get it to work.