cuvidCreateDecoder returns CUDA_ERROR_NO_DEVICE

I am using a laptop with windows 8.1, optimus Intel HD4400/Geforce 840M, latest notebook drivers 344.75. In NVIDIA Control panel I have chosen global setting to always use NVIDIA GPU.

The sample application cudaDecodeD3D9 works as intended with the provided test video plush1_720p_10s.m2v which is MPEG2 encoded. When I try to use h264 encoded videos the application fails.

Everything works on my desktop with windows 7, Geforce 750 Ti, lastest desktop drivers and the same video files.

By analyzing the code I have following findings

When cudaDecodeD3D9 is fed with a MPEG2 video the command line parameters -decodecuvid, -decodedxva etc. aren’t honored, instead CUVIDDECODECREATEINFO.ulCreationFlags == cudaVideoCreate_PreferCUDA is forced.

When I set CUVIDDECODECREATEINFO.ulCreationFlags == cudaVideoCreate_PreferCUVID or anything other than cudaVideoCreate_PreferCUDA then cuvidCreateDecoder() fails.

When I set CUVIDDECODECREATEINFO.CodecType == cudaVideoCodec_H264 then cuvidCreateDecoder() fails.

What am I missing?
Is the cudaDecodeD3D9 sample missing some initialization needed on optimus, or is this a driver bug?

I am also facing similar problem.
Have you found any solution of the problem?