Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to use the encoder when i CreateComponent, it return AMF_NOT_SUPPORTED #184

Closed
jamaik7 opened this issue Sep 26, 2019 · 14 comments
Closed

Comments

@jamaik7
Copy link

jamaik7 commented Sep 26, 2019

i test the code in Win10

Environment:
Windows10 1809
Adapter: Radeon Pro S7150v AMD MxGPU
Driver: Adrenalin-Edition-17.12.2 (17.50.07)
i use the AMF-1.4.6

`
int _tmain(int argc, _TCHAR* argv[])
{
AMF_RESULT res = AMF_OK; // error checking can be added later
res = g_AMFFactory.Init();
if(res != AMF_OK)
{
wprintf(L"AMF Failed to initialize");
return 1;
}

::amf_increase_timer_precision();

amf::AMFTraceEnableWriter(AMF_TRACE_WRITER_CONSOLE, true);
amf::AMFTraceEnableWriter(AMF_TRACE_WRITER_DEBUG_OUTPUT, true);


// initialize AMF
amf::AMFContextPtr context;
amf::AMFComponentPtr encoder;
amf::AMFSurfacePtr surfaceIn;

// context
res = g_AMFFactory.GetFactory()->CreateContext(&context);
AMF_RETURN_IF_FAILED(res, L"CreateContext() failed");

if(memoryTypeIn == amf::AMF_MEMORY_DX9)
{
    res = context->InitDX9(NULL); // can be DX9 or DX9Ex device
    AMF_RETURN_IF_FAILED(res, L"InitDX9(NULL) failed");
}
if(memoryTypeIn == amf::AMF_MEMORY_DX11)
{
    res = context->InitDX11(NULL); // can be DX11 device
    AMF_RETURN_IF_FAILED(res, L"InitDX11(NULL) failed");
    PrepareFillDX11(context);

}
// component: encoder
res = g_AMFFactory.GetFactory()->CreateComponent(context, pCodec, &encoder);`

it return AMF_NOT_SUPPORTED and AMFComponentPtr encoder is NULL ptr
how can i run this simple

@MikhailAMD
Copy link
Collaborator

MikhailAMD commented Sep 26, 2019

  • Which codec do you try to create?
  • What do you see in the debug output?
    You have almost two years old driver. Try the latest hotfix from amd.com.

@jamaik7
Copy link
Author

jamaik7 commented Sep 26, 2019

@MikhailAMD
1.AMFVideoEncoderVCE_AVC
2.SimpleEncoder.cpp:AMF_RETURN_IF_FAILED(res, L"CreateContext() failed");fail AMF_NOT_SUPPORTED
3.Because i use it in the Virtualization https://www.amd.com/zh-hans/support/professional-graphics/firepro/firepro-s-series/firepro-s7150-x2 the page support my driver only the 17.12.2 so i have not try other version driver.

@MikhailAMD
Copy link
Collaborator

Driver for virtualized GPU doesn't support encoder. You would have to put the GPU in passthrough mode.

@jamaik7
Copy link
Author

jamaik7 commented Sep 27, 2019

@MikhailAMD how can i get the gpu output ,because i find the dxgi can't screenshots in exclusive mode

@MikhailAMD
Copy link
Collaborator

Not sure I understand the question. Do you need to capture screen and have problems? If so, there are two APIs: DesktopDuplication API from Microsoft https://docs.microsoft.com/en-us/windows/win32/direct3ddxgi/desktop-dup-api. I would start with it. AMF has a sample how to use it. Check VideoCapture component. Also there is AMD DOPP API connected to OpenGL. Works only with Pro GPUs and drivers. https://github.com/GPUOpen-LibrariesAndSDKs/DOPP

@jamaik7
Copy link
Author

jamaik7 commented Sep 27, 2019

@MikhailAMD such as game play in full screen mode ,dxgi only capture the black image. NVIDIA have a solution(NvFBC), it can capture image from GPU output buffer

@MikhailAMD
Copy link
Collaborator

Did you try on regular, not VM setup? You can use OBS studio and enable DD mode.

@jamaik7
Copy link
Author

jamaik7 commented Sep 27, 2019

@MikhailAMD I will try it ,thanks for your help

@MikhailAMD
Copy link
Collaborator

BTW: for AMD the solution is DOPP

@jamaik7
Copy link
Author

jamaik7 commented Sep 27, 2019

ok thanks

@AlanDaniels101
Copy link

Driver for virtualized GPU doesn't support encoder. You would have to put the GPU in passthrough mode.

When will it be supported?

@MikhailAMD
Copy link
Collaborator

Realy sorry but I cannot comment on non-released features.

@AlanDaniels101
Copy link

Thanks Mikhail. This is critical for our use case. Seems like cloud gaming and Citrix-type products would use this too. Hopefully it comes through soon.

@MikhailAMD
Copy link
Collaborator

If you like you can send me a private info about your project. I will show it to the people involved. Email:
mikhail'dot'mironov'att'amd'dot'com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants