RHEL 6.6의 NVIDIA Tesla K20c GPU에서 mp3 파일을 디코딩하려고 합니다.

RHEL 6.6의 NVIDIA Tesla K20c GPU에서 mp3 파일을 디코딩하려고 합니다.

mpg123을 사용하여 mp3 파일을 재생하려고 하는데 GPU에서는 어렵습니다.

많은 연구 끝에 내 요구 사항에 가장 가까운 명령은 다음과 같습니다.

mplayer -vo vdpau and -vc ffh264vdpau, ffmpeg12vdpau, ffmwmv3vdpau, ffvc1vdpau -ao alsa filename.mp4

하지만 이러한 명령 중 일부를 인터넷 검색한 후에 이 명령이 비디오 디코딩을 위한 것임을 깨달았습니다.

나는 이 명령을 mpg123으로 조정하여 실행해 보았습니다(어떤 응답을 받을지 확인하기 위해).

mpg123 -vo vdpau and -vc ffh264vdpau, ffmpeg12vdpau, ffmwmv3vdpau, ffvc1vdpau -ao alsa /root/Downloads/Traintoleave.mp3

내가 얻는 결과는 다음과 같습니다.

High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
    version 1.23.8; written and copyright by Michael Hipp and others
    free software (LGPL) without any warranty but with best wishes
Decoder: x86-64 (AVX)
Trying output module: vdpau, device: <nil>
[src/libout123/legacy_module.c:40] error: Unable to open requested module 'vdpau'.
[src/libout123/legacy_module.c:42] error: The only available statically compiled module is 'alsa'.
[src/libout123/libout123.c:432] error: Found no driver out of [vdpau] working with device <default>.
main: [src/mpg123.c:333] error: out123 error 3: failure loading driver module

mpg123을 사용하여 NVIDIA GPU에서 오디오 파일을 실행하고 실행 시간을 모니터링하는 방법을 아직도 이해하지 못합니다.

어떤 도움이나 조언이라도 대단히 감사하겠습니다.

편집: 터미널에서 다음 명령을 실행했습니다.

sudo aplay -L

다음 출력을 얻습니다.

default
    Default
front:CARD=PCH,DEV=0
    HDA Intel PCH, ALC280 Analog
    Front speakers
surround40:CARD=PCH,DEV=0
    HDA Intel PCH, ALC280 Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=PCH,DEV=0
    HDA Intel PCH, ALC280 Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=PCH,DEV=0
    HDA Intel PCH, ALC280 Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=PCH,DEV=0
    HDA Intel PCH, ALC280 Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=PCH,DEV=0
    HDA Intel PCH, ALC280 Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
hdmi:CARD=NVidia,DEV=0
    HDA NVidia, HDMI 0
    HDMI Audio Output
hdmi:CARD=NVidia,DEV=1
    HDA NVidia, HDMI 1
    HDMI Audio Output

그러나 이는 mpg123 정보가 아닌 aplay 정보일 뿐입니다. 다른 소스에서 aplay는 wav 파일 재생에만 사용된다는 것을 알았습니다.

또 다른 stackoverflow 질문 덕분에 장치 ID를 성공적으로 추적할 수 있었습니다. 명령을 실행 sudo aplay -l하고 다음 출력을 얻습니다.

**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC280 Analog [ALC280 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: NVidia [HDA NVidia], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

이 정보를 사용하여 mpg123을 사용하여 mp3 파일을 재생했습니다.

mpg123 -D hw:1,3 sample.mp3

그러면 다음과 같은 결과가 나옵니다.

High Performance MPEG 1.0/2.0/2.5 Audio Player for Layers 1, 2 and 3
    version 1.23.8; written and copyright by Michael Hipp and others
    free software (LGPL) without any warranty but with best wishes
Invalid shared memory segment size
Invalid shared memory segment size


Terminal control enabled, press 'h' for listing of keys and functions.

Playing MPEG stream 1 of 1: sample.mp3 ...
Invalid shared memory segment size

MPEG 1.0 L III cbr128 44100 stereo
Invalid shared memory segment size
ALSA lib pcm.c:7246:(snd_pcm_recover) underrun occured
ALSA lib pcm.c:7246:(snd_pcm_recover) underrun occured
ALSA lib pcm.c:7246:(snd_pcm_recover) underrun occured
ALSA lib pcm.c:7246:(snd_pcm_recover) underrun occured
ALSA lib pcm.c:7246:(snd_pcm_recover) underrun occured
ALSA lib pcm.c:7246:(snd_pcm_recover) underrun occured
ALSA lib pcm.c:7246:(snd_pcm_recover) underrun occured
ALSA lib pcm.c:7246:(snd_pcm_recover) underrun occured

[0:06] Decoding of sample.mp3 finished.

이 오디오 파일이 GPU에서 재생되는지, 다른 프로세서에서 재생되는지는 알 수 없습니다. 이 파일이 GPU에서 재생되고 있는지 어떻게 확인할 수 있나요?

편집하다:

VLC가 GPU 성능을 활용하여 오디오를 디코딩할 수 있습니까? 이 링크에서 아이디어를 얻었지만 확실하지 않습니다.https://askubuntu.com/questions/240386/how-do-i-enable-hardware-accelerated-video-in-vlc-with-intel-hd-4000-gpu

답변1

나는 GPU에서 실행되는 MP3 디코더의 공개적으로 사용 가능한 구현을 알지 못합니다. 확실히 Linux에서는 아니며 mpg123vdpau(비디오 디코딩용)를 사용하지도 않습니다.

GPU에서 효율적으로 실행하는 데 필요한 MP3 디코딩을 병렬화하는 것은 쉽지 않을 수 있습니다.

예를 들어 일부 Google 검색에서이 기사, 이는 맞춤형 CUDA 구현을 사용하는 것으로 보이며 CPU에서 실행하는 것과 비교하여 절전 효과를 보고합니다. (원문은 요청 시에만 제공되므로 공연에 대해서는 알 수 없습니다.)

수행하는 모든 측정은 CPU 및 GPU 사례 모두에서 구현 품질에 크게 좌우됩니다.

관련 정보