1

NVIDIA GPU Computing SDK 4.2 の cudaDecodeD3D9 の例に基づいて、マルチストリーミング H.264 ビデオ プレーヤーを開発しようとしています。

アプリケーションは少数のストリームで正しく動作しますが、解像度 800x600 の 12 ストリームまたは解像度 1920x1080 の 9 ストリームの cuvidCreateDecoder 関数でアサーション (CUDA_ERROR_OUT_OF_MEMORY) が発生します。cudaMemGetInfo は、387MB (1GB のビデオ カードの場合) および 1.3Gb (2GB のビデオ カードの場合) の使用可能なメモリを返します。メモリの断片化が原因ですか? 利用可能なメモリをどのように使用できますか?

VideoDecoder::VideoDecoder(const CUVIDEOFORMAT & rVideoFormat, 
                       CUcontext &rContext, 
                       cudaVideoCreateFlags eCreateFlags, 
                       CUvideoctxlock &vidCtxLock) 
: m_VidCtxLock(vidCtxLock)
{
// get a copy of the CUDA context
m_Context          = rContext;
m_VideoCreateFlags = eCreateFlags;

// Fill the decoder-create-info struct from the given video-format struct.
memset(&oVideoDecodeCreateInfo_, 0, sizeof(CUVIDDECODECREATEINFO));
        // Create video decoder
oVideoDecodeCreateInfo_.CodecType           = rVideoFormat.codec;
oVideoDecodeCreateInfo_.ulWidth             = rVideoFormat.coded_width;
oVideoDecodeCreateInfo_.ulHeight            = rVideoFormat.coded_height;
oVideoDecodeCreateInfo_.ulNumDecodeSurfaces = FrameQueue::cnMaximumSize;

        // Limit decode memory to 24MB (16M pixels at 4:2:0 = 24M bytes)
while (oVideoDecodeCreateInfo_.ulNumDecodeSurfaces * rVideoFormat.coded_width * rVideoFormat.coded_height > 16*1024*1024)
{
    oVideoDecodeCreateInfo_.ulNumDecodeSurfaces--;
}
oVideoDecodeCreateInfo_.ChromaFormat        = rVideoFormat.chroma_format;
oVideoDecodeCreateInfo_.OutputFormat        = cudaVideoSurfaceFormat_NV12;
oVideoDecodeCreateInfo_.DeinterlaceMode     = cudaVideoDeinterlaceMode_Adaptive;

        // No scaling
oVideoDecodeCreateInfo_.ulTargetWidth       = oVideoDecodeCreateInfo_.ulWidth;
oVideoDecodeCreateInfo_.ulTargetHeight      = oVideoDecodeCreateInfo_.ulHeight;
oVideoDecodeCreateInfo_.ulNumOutputSurfaces = MAX_FRAME_COUNT;  // We won't simultaneously map more than 8 surfaces
oVideoDecodeCreateInfo_.ulCreationFlags     = m_VideoCreateFlags;
oVideoDecodeCreateInfo_.vidLock             = m_VidCtxLock;

size_t available, total;
cudaMemGetInfo(&available, &total);

        // create the decoder
CUresult oResult = cuvidCreateDecoder(&oDecoder_, &oVideoDecodeCreateInfo_);
assert(CUDA_SUCCESS == oResult);
}

cuvidCreateDecoder は 1920x1080 を超える解像度で動作しますか? 2560x1920 ストリームを試すと、cuvidCreateDecoder は CUDA_ERROR_INVALID_SOURCE をアサートします。

私の環境

  • ハードウェア: NVidia GTX 550 Ti 1Gb、NVidia GT 610 2Gb、ドライバー バージョン 306.23
  • ウィンドウズ 7 x64
  • ビジュアル スタジオ 2010 SP1
  • Windows SDK 7.1
  • NVIDIA GPU コンピューティング ツールキット v.4.2、v.5.0
  • NVIDIA GPU コンピューティング SDK 4.2。
4

1 に答える 1

1

メモリの問題については、この回答を参照してください。

解像度に関する質問については、Compute Capability 2.0 以前の GPU は、cudaDecodeD3D9. これが、2560x1920 ストリームをデコードできない理由です。

Kepler GPU は、はるかに大きな解像度をサポートできます。

于 2012-09-28T02:52:38.337 に答える