Amazon EC2 인스턴스에 AMD 드라이버 설치 - Amazon Elastic Compute Cloud

Amazon EC2 인스턴스에 AMD 드라이버 설치

G4ad 인스턴스와 같이 연결된 AMD GPU가 있는 인스턴스에는 적절한 AMD 드라이버가 설치되어 있어야 합니다. 요구 사항에 따라 드라이버가 사전 설치된 AMI를 사용하거나 Amazon S3에서 드라이버를 다운로드할 수 있습니다.

G4dn 인스턴스와 같이 연결된 NVIDIA GPU가 있는 인스턴스에 NVIDIA 드라이버를 설치하려면 NVIDIA 드라이버 설치 섹션을 참조하세요.

AMD Radeon Pro Software for Enterprise Driver

AMD Radeon Pro Software for Enterprise Driver는 전문가 등급의 그래픽 사용 사례를 지원하도록 구축되었습니다. 이 드라이버를 사용하면 GPU당 2개의 4K 디스플레이로 인스턴스를 구성할 수 있습니다.

지원되는 API
  • OpenGL, OpenCL

  • Vulkan

  • AMD Advanced Media Framework

  • Video Acceleration API

  • DirectX 9 이상

  • Microsoft Hardware Media Foundation Transform

AMD 드라이버가 설치된 AMI

AWS는 AMD 드라이버가 설치되어 있는 다양한 Amazon Machine Image(AMI)를 제공합니다. AMD 드라이버가 포함된 Marketplace 제품을 엽니다.

AMD 드라이버 다운로드

AMD 드라이버가 설치된 AMI를 사용하지 않는 경우 AMD 드라이버를 다운로드하여 인스턴스에 설치할 수 있습니다. 다음 운영 체제 버전만 AMD 드라이버를 지원합니다.

  • 커널 버전 4.14가 포함된 Amazon Linux 2

    참고

    AMD 드라이버 버전 amdgpu-pro-20.20-1184451 및 최신 드라이버 릴리스에는 커널 버전 5.15 이상이 필요합니다.

  • Windows Server 2016

  • Windows Server 2019

이러한 다운로드는 AWS 고객만 사용할 수 있습니다. 드라이버를 다운로드하면 AMD Radeon Pro V520 하드웨어와 함께 사용할 목적으로 AMIs를 개발하는 데에만 다운로드한 소프트웨어를 사용한다는 것에 동의하게 됩니다. 소프트웨어를 설치하면 AMD 소프트웨어 최종 사용자 라이선스 계약의 약관이 적용됩니다.

  1. Linux 인스턴스에 연결합니다.

  2. Linux 인스턴스에 AWS CLI를 설치하고 기본 자격 증명을 구성합니다. 자세한 내용은 AWS Command Line Interface 사용 설명서에서 AWS CLI 설치를 참조하세요.

    중요

    사용자 또는 역할에 AmazonS3ReadOnlyAccess 정책이 포함된 권한이 부여되어야 합니다. 자세한 내용을 알아보려면 Amazon Simple Storage Service 사용 설명서AWS 관리형 정책: AmazonS3ReadOnlyAccess를 참조하세요.

  3. gccmake를 설치합니다(아직 설치되지 않은 경우).

    $ sudo yum install gcc make
  4. 패키지 캐시를 업데이트하고 인스턴스에 대한 패키지 업데이트를 가져옵니다.

    • 대상 Amazon Linux 2:

      $ sudo amazon-linux-extras install epel -y $ sudo yum update -y
    • Ubuntu 22.04의 경우:

      $ wget https://repo.radeon.com/.preview/a0e4ef1dffbc95b4abb54e891f265e61/amdgpu-install/5.5.02.05.2/ubuntu/jammy/amdgpu-install_5.5.02.05.50502-1_all.deb $ sudo apt install ./amdgpu-install_5.5.02.05.50502-1_all.deb $ sudo sed -i 's#repo.radeon.com#&/.preview/a0e4ef1dffbc95b4abb54e891f265e61#' /etc/apt/sources.list.d/{amdgpu.list,rocm.list,amdgpu-proprietary.list}
    • 기타 Ubuntu 버전의 경우:

      $ sudo dpkg --add-architecture i386 $ sudo apt-get update -y && sudo apt upgrade -y
    • CentOS:

      $ sudo yum install epel-release -y $ sudo yum update -y
  5. 인스턴스를 재부팅합니다.

    $ sudo reboot
  6. 재부팅된 후 인스턴스에 다시 연결합니다.

  7. 최신 AMD 드라이버를 다운로드합니다.

    참고

    Ubuntu 22.04의 경우 이 단계를 건너뛰세요.

    $ aws s3 cp --recursive s3://ec2-amd-linux-drivers/latest/ .
  8. 파일의 압축을 풉니다.

    • Amazon Linux 2 및 CentOS:

      $ tar -xf amdgpu-pro-*rhel*.tar.xz
    • Ubuntu:

      참고

      Ubuntu 22.04의 경우 이 단계를 건너뛰세요.

      $ tar -xf amdgpu-pro*ubuntu*.xz
  9. 압축을 푼 드라이버의 폴더로 변경합니다.

  10. 드라이버 설치를 위해 누락된 모듈을 추가합니다.

    • Amazon Linux 2 및 CentOS:

      이 단계를 건너뜁니다.

    • Ubuntu:

      참고

      Ubuntu 22.04의 경우 이 단계를 건너뛰세요.

      $ sudo apt install linux-modules-extra-$(uname -r) -y
  11. 자체 설치 스크립트를 실행하여 전체 그래픽 스택을 설치합니다.

    • Ubuntu 22.04의 경우:

      $ sudo amdgpu-install --usecase=workstation --vulkan=pro --opencl=rocr,legacy -y
    • Amazon Linux 2, CentOS 및 기타 Ubuntu 버전의 경우:

      $ ./amdgpu-pro-install -y --opencl=pal,legacy
  12. 인스턴스를 재부팅합니다.

    $ sudo reboot
  13. 드라이버가 작동하는지 확인합니다.

    $ dmesg | grep amdgpu

    응답은 다음과 같아야 합니다.

    Initialized amdgpu
  1. Windows 인스턴스에 연결하고 PowerShell 창을 엽니다.

  2. Windows 인스턴스에서 AWS Tools for Windows PowerShell에 대한 기본 자격 증명을 구성합니다. 자세한 내용은 AWS Tools for Windows PowerShell 사용 설명서에서 AWS Tools for Windows PowerShell 시작하기를 참조하세요.

    중요

    사용자 또는 역할에 AmazonS3ReadOnlyAccess 정책이 포함된 권한이 부여되어야 합니다. 자세한 내용을 알아보려면 Amazon Simple Storage Service 사용 설명서AWS 관리형 정책: AmazonS3ReadOnlyAccess를 참조하세요.

  3. 다음 PowerShell 명령을 사용하여 Amazon S3 드라이버를 데스크톱에 다운로드합니다.

    $Bucket = "ec2-amd-windows-drivers" $KeyPrefix = "latest" # use "archives" for Windows Server 2016 $LocalPath = "$home\Desktop\AMD" $Objects = Get-S3Object -BucketName $Bucket -KeyPrefix $KeyPrefix -Region us-east-1 foreach ($Object in $Objects) { $LocalFileName = $Object.Key if ($LocalFileName -ne '' -and $Object.Size -ne 0) { $LocalFilePath = Join-Path $LocalPath $LocalFileName Copy-S3Object -BucketName $Bucket -Key $Object.Key -LocalFile $LocalFilePath -Region us-east-1 } }
  4. 다운로드한 드라이버 파일의 압축을 풀고 다음 PowerShell 명령을 사용하여 설치 프로그램을 실행합니다.

    Expand-Archive $LocalFilePath -DestinationPath "$home\Desktop\AMD\$KeyPrefix" -Verbose

    다음으로, 새 디렉터리의 콘텐츠를 확인합니다. 디렉터리 이름은 Get-ChildItem PowerShell 명령을 사용하여 검색할 수 있습니다.

    Get-ChildItem "$home\Desktop\AMD\$KeyPrefix"

    다음과 유사하게 출력됩니다.

    Directory: C:\Users\Administrator\Desktop\AMD\latest
    
    Mode                LastWriteTime         Length Name
    ----                -------------         ------ ----
    d-----       10/13/2021  12:52 AM                210414a-365562C-Retail_End_User.2

    드라이버 설치:

    pnputil /add-driver $home\Desktop\AMD\$KeyPrefix\*.inf /install /subdirs
  5. 안내에 따라 드라이버를 설치하고 필요에 따라 인스턴스를 재부팅합니다.

  6. GPU가 제대로 작동하는지 확인하려면 장치 관리자를 확인합니다. "AMD Radeon Pro V520 MxGPU"가 디스플레이어 어댑터로 나열됩니다.

  7. 최대 4K 해상도의 디스플레이 4개를 활용하는 데 도움이 되도록 고성능 디스플레이 프로토콜인 NICE DCV를 설정합니다.

Linux용 대화형 데스크톱 설정

Linux 인스턴스에 AMD GPU 드라이버가 설치되어 있고 AMD GPU가 사용 중인지 확인한 후 대화형 데스크톱 관리자를 설치할 수 있습니다. 호환성 및 성능을 최대화하려면 MATE 데스크톱 환경을 사용하는 것이 좋습니다.

전제 조건

텍스트 편집기를 열고 다음을 xorg.conf라는 파일로 저장합니다. 인스턴스에 이 파일이 필요합니다.

Section "ServerLayout" Identifier "Layout0" Screen 0 "Screen0" InputDevice "Keyboard0" "CoreKeyboard" InputDevice "Mouse0" "CorePointer" EndSection Section "Files" ModulePath "/opt/amdgpu/lib64/xorg/modules/drivers" ModulePath "/opt/amdgpu/lib/xorg/modules" ModulePath "/opt/amdgpu-pro/lib/xorg/modules/extensions" ModulePath "/opt/amdgpu-pro/lib64/xorg/modules/extensions" ModulePath "/usr/lib64/xorg/modules" ModulePath "/usr/lib/xorg/modules" EndSection Section "InputDevice" # generated from default Identifier "Mouse0" Driver "mouse" Option "Protocol" "auto" Option "Device" "/dev/psaux" Option "Emulate3Buttons" "no" Option "ZAxisMapping" "4 5" EndSection Section "InputDevice" # generated from default Identifier "Keyboard0" Driver "kbd" EndSection Section "Monitor" Identifier "Monitor0" VendorName "Unknown" ModelName "Unknown" EndSection Section "Device" Identifier "Device0" Driver "amdgpu" VendorName "AMD" BoardName "Radeon MxGPU V520" BusID "PCI:0:30:0" EndSection Section "Extensions" Option "DPMS" "Disable" EndSection Section "Screen" Identifier "Screen0" Device "Device0" Monitor "Monitor0" DefaultDepth 24 Option "AllowEmptyInitialConfiguration" "True" SubSection "Display" Virtual 3840 2160 Depth 32 EndSubSection EndSection
Amazon Linux 2에서 대화형 데스크톱을 설정하려면
  1. EPEL 리포지토리를 설치합니다.

    $ C:\> sudo amazon-linux-extras install epel -y
  2. MATE 데스크톱을 설치합니다.

    $ C:\> sudo amazon-linux-extras install mate-desktop1.x -y $ C:\> sudo yum groupinstall "MATE Desktop" -y $ C:\> sudo systemctl disable firewalld
  3. xorg.conf 파일을 /etc/X11/xorg.conf에 복사합니다.

  4. 인스턴스를 재부팅합니다.

    $ C:\> sudo reboot
  5. (선택 사항) NICE DCV를 고성능 디스플레이 프로토콜로 사용하도록 NICE DCV 서버를 설치한 다음 원하는 클라이언트를 사용하여 NICE DCV 세션에 연결합니다.

Ubuntu에서 대화형 데스크톱을 설정하려면
  1. MATE 데스크톱을 설치합니다.

    $ sudo apt install xorg-dev ubuntu-mate-desktop -y $ C:\> sudo apt purge ifupdown -y
  2. xorg.conf 파일을 /etc/X11/xorg.conf에 복사합니다.

  3. 인스턴스를 재부팅합니다.

    $ sudo reboot
  4. 적절한 버전의 Ubuntu에 대한 AMF 인코더를 설치합니다.

    $ sudo apt install ./amdgpu-pro-20.20-*/amf-amdgpu-pro_20.20-*_amd64.deb
  5. (선택 사항) NICE DCV를 고성능 디스플레이 프로토콜로 사용하도록 NICE DCV 서버를 설치한 다음 원하는 클라이언트를 사용하여 NICE DCV 세션에 연결합니다.

  6. DCV 설치 후 DCV 사용자에게 비디오 사용 권한을 부여합니다.

    $ sudo usermod -aG video dcv
CentOS에서 대화형 데스크톱을 설정하려면
  1. EPEL 리포지토리를 설치합니다.

    $ sudo yum update -y $ C:\> sudo yum install epel-release -y
  2. MATE 데스크톱을 설치합니다.

    $ sudo yum groupinstall "MATE Desktop" -y $ C:\> sudo systemctl disable firewalld
  3. xorg.conf 파일을 /etc/X11/xorg.conf에 복사합니다.

  4. 인스턴스를 재부팅합니다.

    $ sudo reboot
  5. (선택 사항) NICE DCV를 고성능 디스플레이 프로토콜로 사용하도록 NICE DCV 서버를 설치한 다음 원하는 클라이언트를 사용하여 NICE DCV 세션에 연결합니다.