Getting Started with AMD AMA Video SDK Cards on Premises

Chassis Setup

Note

Generic kernel 5.15 is required for successful operation of this SDK. See Linux VM Guest, Step 2, for details on how to install kernel 5.15 and other required packages.

  1. BIOS setting:

    1. PCIe bifurcation must be enabled on each slot with a MA35 card.

    2. Secure boot must be disabled.

    3. Enable Above 4G Decoding.

    4. Enable virtualization.

  2. Enable IOMMU by updating /etc/default/grub file to include

    • GRUB_CMDLINE_LINUX_DEFAULT="quiet splash amd_iommu=on iommu=pt", for AMD based systems

    • GRUB_CMDLINE_LINUX_DEFAULT="quiet splash intel_iommu=on iommu=pt", for Intel based chassis

  3. Update Grub

    sudo update-grub
    
  4. Allocate at least 4GB of huge pages, per device, plus an extra 96 huge pages, e.g., 2048+96=2144

    sudo sh -c "echo 'vm.nr_hugepages=2144' >> /etc/sysctl.conf"
    

    Note that if a chassis is being configured to host VMs, then the total number of huge pages, on the host, needs to be the sum of allocated RAM of all VM instances plus 96. As an example, on a bare-metal chassis, with a single card containing 2 devices, the required number of huge pages is 4096+96=4192. On the other hand, running 6 VMs, each with 12GB of RAM, requires 6*12GB/2MB+96=36960 huge pages. (See Virtualization for details.)

  5. Reboot

    sudo reboot
    
  6. Verify settings

    cat /proc/cmdline
    BOOT_IMAGE=/vmlinuz-5.15.0-50-generic root=/dev/mapper/vg00-rootlv ro quiet splash amd_iommu=on iommu=pt
    

    and

    cat /proc/meminfo | grep -i huge
    

    , should return:

    HugePages_Total:    4096
    HugePages_Free:     4096
    HugePages_Rsvd:        0
    Hugepagesize:       2048 kB
    

Check Cards

To establish whether deployed cards have proper firmware installed, proceed as follows:

  1. List AMD AMA Video SDK PCIe devices

    sudo lspci -vvvd 10ee:
    

    If devices are not listed as Multimedia controller and/or Region 4 size is not 512MB, a flash update is required. Refer to Flash Firmware section, for instructions.

Install the AMD AMA Video SDK

  • Ensure that you PPA feed is setup. See Package Feed Setup

  • Ubuntu

    1. Install packages

      sudo apt -y install dkms libhugetlbfs0 libboost-all-dev
      dpkg --get-selections '*ma35*' | awk '{system("sudo apt -y purge " $1)}'
      dpkg --get-selections 'amd-ama*' | awk '{system("sudo apt -y purge " $1)}'
      sudo apt update
      sudo apt install amd-ama-driver=1.0.0 amd-ama-core=1.0.0 amd-ama-xma=1.0.0 amd-ama-ffmpeg=1.0.0 amd-ama-gstreamer=1.0.0
      sudo apt-mark hold amd-ama-driver amd-ama-core amd-ama-xma amd-ama-ffmpeg amd-ama-gstreamer
      
    2. Verify packages

      sudo dpkg -l amd-ama*
      

      The expected output is:

      Desired=Unknown/Install/Remove/Purge/Hold
      | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
      |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
      ||/ Name              Version      Architecture Description
      +++-=================-============-============-=================================
      ii  amd-ama-core      1.0.0        amd64        Supernova
      ii  amd-ama-driver    1.0.0        amd64        Supernova
      ii  amd-ama-ffmpeg    1.0.0        amd64        Supernova
      ii  amd-ama-gstreamer 1.0.0        amd64        Supernova
      ii  amd-ama-xma       1.0.0        amd64        Supernova
      
    3. Insert kernel module

      sudo modprobe ama_transcoder
      

Installation Verification

After each reboot or SDK update execute the following command:

  1. Confirm driver's successful installation by:

cat /sys/class/misc/ama_transcoder0/version_information

It should return:

<<<Version Info>>>
ZSP Version = 1.0.5
SC Version = 9.7.10
eSecure Version = 1.0.0
PCIe FW Version = 2.1.0
PCIe CTRL Patch Version = 1.0.3
PCIe PHY Patch A Version = 1.0.0

If the observed version numbers are older than the above, flashing is required. Refer to Flash Firmware section, for instructions.

Flash Firmware

If flashing is required, due to older firmware versions, proceed as follows:

  1. Flash the security patch firmware:

    sudo /opt/amd/ama/ma35/bin/maflash program -d all  <patch firmware bin>
    

    , where patch firmware bin is /opt/amd/ama/ma35/firmware/ma35d_security_patch.bin.

  2. Cold reboot:

    sudo systemctl poweroff
    

    , and power up.

  3. To flash all devices, in parallel, issue the following:

    sudo /opt/amd/ama/ma35/bin/maflash program -d all -p <firmware bin>
    

    , where firmware bin is /opt/amd/ama/ma35/firmware/ma35_firmware.bin.

    Ignore warning messages that state:

    ...
    Warning: SC update is not supported from ASIC 1 (skipping)
    ...
    
  4. Cold reboot:

    sudo systemctl poweroff
    

    , and power up.

For more details on flashing, refer to Programing a Device.

Set Up the Runtime Environment

  1. Run setup script

    source /opt/amd/ama/ma35/scripts/setup.sh
    

Note that this script requires Bash shell to run.

Run Your First Examples

See the tutorials and examples page to learn how to run jobs on your system.