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

Support for Linux #4

Closed
boxerab opened this issue Aug 17, 2016 · 161 comments
Closed

Support for Linux #4

boxerab opened this issue Aug 17, 2016 · 161 comments

Comments

@boxerab
Copy link

boxerab commented Aug 17, 2016

For video transcoding, Linux is an ideal platform. And for this use case, no Vulkan support is necessary, just access to hardware decode/encode.

@ovr
Copy link

ovr commented Sep 2, 2016

@jstewart-amd can you write any notice about plans for it?

@jstewart-amd
Copy link
Contributor

For this project, I am basically just the GitHub monkey. I'll ping the AMF team for comment.

@ovr
Copy link

ovr commented Sep 7, 2016

@jstewart-amd Hey bro! Any news? Will be rly cool to know when AMD will support Linux :3
Thanks

@Xaymar
Copy link
Contributor

Xaymar commented Sep 14, 2016

This would really be nice to have in the future. On Linux all the APIs that would be needed are Host, Vulkan and OpenGL, with Vulkan being optional / in the future.

@tnarine-amd
Copy link
Contributor

Your request has been forwarded to the AMF developers. Unfortunately, we are unable to provide any information on LINUX AMF support but we really appreciate you sending this feedback.

@Xaymar
Copy link
Contributor

Xaymar commented Dec 2, 2016

This is probably a question that isn't exactly related to this SDK, but does VAAPI encoding work well enough to be used with official AMD drivers on linux (debian, ubuntu)?

@MikhailAMD
Copy link
Collaborator

So far AMD did not provide VAAPI encoder, decoder only.

@Xaymar
Copy link
Contributor

Xaymar commented Dec 2, 2016

Ah okay, so it's probably something that the community mesa driver provides.

@nuggs
Copy link

nuggs commented Jan 17, 2017

I'm assuming by unable to provide any information on GNU/Linux AMF support but thanks for the feedback that you mean it's not going to come? If that's the case, wouldn't it be better to close the ticket so people don't get their hopes up?

Otherwise, I'm a bit confused by there not going to be information about it but the ticket still being open like there might be information about it...

@cRaZy-bisCuiT
Copy link

cRaZy-bisCuiT commented Jan 26, 2017

When could we expect AMD Video Encoding (VCE) in OBS Studio / Linux? It's about time!

PS: For me it works using...

ffmpeg -vaapi_device /dev/dri/renderD129 -i input.mp4 -vf 'format=nv12,hwupload' -c:v h264_vaapi output.mkv

Can't that feature being used on OBS?

@Xaymar
Copy link
Contributor

Xaymar commented Jan 26, 2017

You are asking in the wrong place. Someone has already started a vaapi plugin: https://obsproject.com/forum/threads/experimental-ffmpeg-vaapi-plugin.61529/

@Shatatel
Copy link

I wonder how long will it take to implement AMF for Linux?
Hope AMD isn't too late to the party.

@boxerab
Copy link
Author

boxerab commented Apr 13, 2017

Well, these brothers have a lot on their plate at the moment. Hopefully they will get to it.

@AndrewJDR
Copy link

Another vote for this!

@boxerab
Copy link
Author

boxerab commented Oct 2, 2017

Any updates on plans for linux port ? I am thinking of starting a port myself, but if there is already some work done at AMD, it would be nice to know this before I get started.

@Shatatel
Copy link

Shatatel commented Oct 2, 2017

Looking forward to some news related to AMF Linux ports.

@MikhailAMD
Copy link
Collaborator

There is a lot of work on kernel mode and user mode drivers. AMF runtime is an easy part. We are working on this. No comments on the date and feature set.

@papajo-r
Copy link

When could we expect AMD Video Encoding (VCE) in OBS Studio / Linux?

@MikhailAMD
Copy link
Collaborator

I cannot comment on dates. It is in progress.

@papajo-r
Copy link

@MikhailAMD Is there any rough guesstimate like "most likely within Q1 2018" or "when kernel version 4.15 releases" or something like that? Also is it true that the encoding performance of VCE is lower for polaris cards like the rx 480?

@MikhailAMD
Copy link
Collaborator

See, I am responsible for AMF runtime but several other driver components are involved. They don't want to publicly state their schedule, which may change based on other projects. I was assured that they are committed to finish the work in reasonable time.
It is all relative. Compare to which card?

@cysin
Copy link

cysin commented Jan 15, 2018

We really need AMF to work on linux too(we are using CentOS). So is there a schedule for this?

@MikhailAMD
Copy link
Collaborator

Understood. I cannot share the schedule but this is work in progress. But check existing drivers if they work for your OS.

@Lucretia
Copy link

Lucretia commented Jun 2, 2018

Another vote for this.

@cRaZy-bisCuiT
Copy link

Does it work now? VCE seems implemented with handbreak now.

@oscarbg
Copy link

oscarbg commented Jun 17, 2020

@MikhailAMD yes I know.. but is missing.. decompressed amdgpu-pro-20.20-1089974-ubuntu-20.04 file and can't find any deb file *amf* which existed in earlier version.. please, check for yourself.. probably has gone missing someway in the packaging process..

@userofryzen
Copy link

AMD supports both. Quality and speed are defined by HW, not by API. These are just two different APIs to access the same HW engine. There are differences in the exposed parameters, I don't have detailed comparison. The one big difference is that AMF operates via Vulkan extension, meaning it has native GPU synchronization between GFX, Encoder and Decoder jobs. Another difference is that VAAPI is Linux only while AMF via Vulkan exists on Linux and on Windows.
@oscarbg AMF library in Pro driver is an optional package installed as "amf-amdgpu-pro"

I understand with this that amf is better than vaapi for using those things like vulkan and synchronisation things. Right? In that terms any app that can use both are going to be more performance with amf rather than vaapi. Right?
Or is it anyways that vaapi will have things like those?
I ask because of bad performance encoding with obs software and vaapi ffmpeg but maybe it's them bad implementation..
I would prefer to have the resources targeting to one only API rather than both . Is it anyway to have amf part without the needs of having the rest of amdgpu pro driver? I am using manjaro right now but it feels like amd gpu Pro is not well supported here..

@MikhailAMD
Copy link
Collaborator

AMF on open source driver would be possible once Khronos finalizes specs for Vulkan encoder and decoder extensions and AMD implements them.

I can only provide general thoughts about comparative performance on both APIs: The performance depends on several factors:

  • Encoder has various quality settings - they should match.
  • The significant factor is transfer. For example, in FFmpeg if AMF+Vulkan is used, the submission frames are currently in system memory and transfers from CPU to GPU memory are unavoidable. This may slow down overall performance but it could be hidden behind multi-threading. Also it depends on overall GPU load.
  • Another issue is synchronization. If an application submits frames in video memory, all depends on synchronization. for Vulkan + AMF there is built-in sync but if one uses VAAPI interop between OpenGL and VAAPI the fact that you use two APIs may require synchronization waits on CPU and this costs some time. It may also do internal copy or color conversion.
    Overall, there are many factors. One cannot say that one API is better then another. This forum is for AMF promotion so I guess I am biased.

@oscarbg
Copy link

oscarbg commented Jun 17, 2020

Hi @MikhailAMD ,
just can confirm Ubuntu 18.04 20.20 driver (amdgpu-pro-20.20-1089974-ubuntu-18.04) ships with AMF support (amf-amdgpu-pro_20.20-1089974_amd64.deb) but on 20.04 driver amf is missing..
I don't know if it's deliberate or an omission but I think should be mentioned on release notes..
thanks..

@MikhailAMD
Copy link
Collaborator

Yes, we just found that AMF is missing in the driver for Ubuntu 20.04 by an accident. Working on restoration ASAP and prevention for the future. I will post updates.

@donbowman
Copy link

might also be a problem w/ the dkms on 20.04:
https://lore.kernel.org/amd-gfx/20200319021623.5426-1-mikel@mikelr.com/
shows pci_platform_rom() removed, but the amdgpu-dkms_5.6.0.13-1089974_all.deb calls it.

@nyanmisaka
Copy link

AMF is back in the latest LTS 20.04 driver.

amdgpu-pro-20.20-1098277-ubuntu-20.04.tar.xz

Package: amf-amdgpu-pro
Version: 20.20-1098277

@MikhailAMD
Copy link
Collaborator

@nyanmisaka Thank you, just wanted to post this info here.

@melroy89
Copy link

plzz?

@hunterkiller11
Copy link

Hello, has anyone had their amf encoder hang when receiving frame using avcodec's avcodec_send_frame?
I am trying to encode a video using h264_amf encoder after compiling ffmpeg and avcodec with --enable-amf.
Here is a stack trace:
#0 0x00007f0e7ff04317 in ioctl () at ../sysdeps/unix/syscall-template.S:78
#1 0x00007f0e6db56db8 in drmIoctl () at /opt/amdgpu/lib/x86_64-linux-gnu/libdrm.so.2
#2 0x00007f0e6db5b493 in drmSyncobjWait () at /opt/amdgpu/lib/x86_64-linux-gnu/libdrm.so.2
#3 0x00007f0e29a55e63 in () at /opt/amdgpu-pro/lib/x86_64-linux-gnu/amdvlk64.so
#4 0x00007f0e29a6fd66 in () at /opt/amdgpu-pro/lib/x86_64-linux-gnu/amdvlk64.so
#5 0x00007f0e29b16c70 in () at /opt/amdgpu-pro/lib/x86_64-linux-gnu/amdvlk64.so
#6 0x00007f0e4047ae33 in () at /opt/amdgpu-pro/lib/x86_64-linux-gnu/libamfrt64.so.1
#7 0x00007f0e4047e027 in amf::AMFEncoderVulkanH264Impl::SubmitInput(amf::AMFData*) ()
at /opt/amdgpu-pro/lib/x86_64-linux-gnu/libamfrt64.so.1
#8 0x00007f0e81bdd71c in () at /usr/local/lib/libavcodec.so.58
#9 0x00007f0e81d12602 in () at /usr/local/lib/libavcodec.so.58
#10 0x00007f0e81d12c24 in avcodec_send_frame () at /usr/local/lib/libavcodec.so.58

I am using the latest drivers amdgpu-pro-20.40-1147287 for ubuntu 18.04 and a Radeon 5700XT.
I would be happy to post more info and if anyone has an example code of working encoding using amf with vulkan on linux.

@MikhailAMD
Copy link
Collaborator

Could you please share command line and input clip if possible?

@hunterkiller11
Copy link

Unfortunately it is not possible since I have code that uses the avcodec library (not ffmpeg command), and I am passing a blank black image to the encoder (as a test). The 1st call to avcodec_send_frame hangs and no error code is returned.

@MikhailAMD
Copy link
Collaborator

Here are few things you can do:

  • Reproduce the problem using AMF sample
  • Ensure that AMF traces /logs are maximized and share the log. ffmpeg integration has an adapter which connects AMF traces with ffmpeg.
  • Limit submission avoiding flooding. Normally AMF encoder should handle this and return INPUT_FULL but it would be a good indicator.
  • Try the latest 20.45 driver.

@hunterkiller11
Copy link

Can you please direct me to what and where is the AMF sample, and some information regarding this adapter for AMF traces? I am mostly unfamiliar with ffmpeg or AMF and only used avcodec encode/decode functionality through libx264 and nvenc which did not require any advanced knowledge.

@MikhailAMD
Copy link
Collaborator

Here is full AMF SDK: https://github.com/GPUOpen-LibrariesAndSDKs/AMF
Here is AMF SimpleEncoder sample you may want to start with: https://github.com/GPUOpen-LibrariesAndSDKs/AMF/tree/master/amf/public/samples/CPPSamples/SimpleEncoder
Here is ffmpeg code with AMF integration: https://git.ffmpeg.org/gitweb/ffmpeg.git/blob_plain/HEAD:/libavcodec/amfenc.c
look for AMFTraceWriterVtbl

@RiantAnda
Copy link

What is the state of HEVC support in AMF for Linux?
Is it supported and if not, are there plans?

@MikhailAMD
Copy link
Collaborator

Yes, there are definite plans. I cannot provide a date though..

@MikhailAMD
Copy link
Collaborator

I would like to close this general issue and discuss problems and questions separately.

@nyanmisaka
Copy link

nyanmisaka commented Nov 6, 2021

AMF on open source driver would be possible once Khronos finalizes specs for Vulkan encoder and decoder extensions and AMD implements them.

Hi Mikhail!

As of the end of 2021, the open source standard for Vulkan Video has been published by Khronos group.
https://www.khronos.org/blog/an-introduction-to-vulkan-video

Any progress on making Vulkan Video extensions public available and adopt them by AMF?
I have made a request on AMDVLK and hope AMD will not fall behind in Vulkan Video.

VK_KHR_video_queue
VK_KHR_video_decode_queue
VK_KHR_video_encode_queue

VK_EXT_video_decode_h264
VK_EXT_video_encode_h264
VK_EXT_video_decode_h265
VK_EXT_video_encode_h265

@MikhailAMD
Copy link
Collaborator

Hi, few notes:

  • Current status of Khronos video extensions is provisional (not finalized).
  • Decoder spec will be used by AMF once finalized and implemented.
  • For encoder, Khronos spec goes for lowest common denominator, while AMF provides more options. To name few: rate control modes, SVC extension, intra-refresh.
  • Khronos encoder is low level API, it requires external reference management
  • All-in-all, AMF encoder will coexist with Khronos for time been, the same way as AMF encoder coexists with MFT encoder on Windows.
  • I cannot comment on future SW releases and timing.

@rajhlinux
Copy link

When will AMF have HEVC (H.265) encoding support for Ubuntu Linux?

@MikhailAMD
Copy link
Collaborator

It is supported for a while. Install the latest proprietary Ubuntu driver for supported distro and add optional AMF package:
https://www.amd.com/en/support/linux-drivers
https://amdgpu-install.readthedocs.io/en/latest/
$ amdgpu-install -y --usecase=workstation,amf
Obviously you need GPU which supports HEVC. RX 5xxx and RX 6xxx have more comprehensive support from feature perspective.

@nyanmisaka
Copy link

It is supported for a while. Install the latest proprietary Ubuntu driver for supported distro and add optional AMF package: https://www.amd.com/en/support/linux-drivers https://amdgpu-install.readthedocs.io/en/latest/ $ amdgpu-install -y --usecase=workstation,amf Obviously you need GPU which supports HEVC. RX 5xxx and RX 6xxx have more comprehensive support from feature perspective.

Is this only supported on RX5000 and RX6000?

[hevc_amf @ 0x55dca93ff080] AMF initialization succeeded via Vulkan
[hevc_amf @ 0x55dca93ff080] AMFEncoderCoreHevc: 0122-06-05 22:37:54 E5BA8480 [AMFEncoderCoreHevc] Warning: EncodeQueue not found, fall back to UVE path
[hevc_amf @ 0x55dca93ff080] AMFEncoderCoreHevc: 0122-06-05 22:37:54 E5BA8480 [AMFEncoderCoreHevc] Warning: CreateServices failed.
[hevc_amf @ 0x55dca93ff080] AMFEncoderCoreHevc: 0122-06-05 22:37:54 E5BA8480 [AMFEncoderCoreHevc]    Info: *****Fallback to UVE path!
[hevc_amf @ 0x55dca93ff080] AMFEncoderCoreHevc: 0122-06-05 22:37:54 E5BA8480 [AMFEncoderCoreHevc]   Debug: AMFEncoderCoreHevcImpl::Terminate()
[hevc_amf @ 0x55dca93ff080] CreateComponent(AMFVideoEncoderHW_HEVC) failed with error 11

@MikhailAMD
Copy link
Collaborator

Sorry, correction: On Linux, HEVC is supported in RX5000 and RX6000 only. From the log it seems you have older GPU.

@Milor123
Copy link

Milor123 commented Sep 1, 2023

i get this error using a compiled FFMPEG (--enable-vaapi --enable-amf --enable-nonfree) in ubuntu with AMF
AMFVideoEncoderHW_HEVC) failed with error 11 :/ shit AMD
in AMD all is a problem, that poor tecnology

I have pro drivers and amf in drivers, too workstation.
My crappy card is rx6750 (I hate this buy :/)

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