Announcement

Collapse
No announcement yet.

UVD and VCE showing as disabled?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • UVD and VCE showing as disabled?

    I run this command sometimes to get info from my GPU:

    $ watch -n 1 sudo tail -n 15 /sys/kernel/debug/dri/0/amdgpu_pm_info

    At the very bottom of the output I see:

    UVD: Disabled

    VCE: Disabled

    There are times when I see Enabled on both. But I can't seem to pinpoint how this gets turned on. Not sure if it's the kernel, Mesa, etc. so I figured I'd ask after looking a little online.

    I'm currently on Mesa 18.1.3, happens on both Linux kernels 4.17 and 4.18. Ubuntu 18.10 cosmic.

    Anyone info would be great. Thanks.

    EDIT: dmesg output:

    [ 0.651236] [drm] add ip block number 7 <uvd_v6_0>
    [ 0.651242] [drm] UVD is enabled in VM mode
    [ 0.651242] [drm] UVD ENC is enabled in VM mode
    [ 0.652016] [drm] Found UVD firmware Version: 1.130 Family ID: 16
    [ 0.807016] [drm] UVD and UVD ENC initialized successfully
    Last edited by perpetually high; 08-04-2018, 03:27 PM.

  • #2
    I don't know for sure, but guessing the relevant code is this:

    EDIT - having some formatting problems, removed <CODE> section - but search amdgpu_pm.h for those messages

    I haven't traced the code through yet (function pointers always slow me down) but I think the message means "the logic that would otherwise provide UVD/VCE clock speeds is Disabled" rather than UVD/VCE themselves being disabled.
    Last edited by bridgman; 08-04-2018, 05:03 PM.

    Comment


    • #3
      Originally posted by bridgman View Post
      I don't know for sure, but guessing the relevant code is this:

      EDIT - having some formatting problems, removed <CODE> section - but search amdgpu_pm.h for those messages

      I haven't traced the code through yet (function pointers always slow me down) but I think the message means "the logic that would otherwise provide UVD/VCE clock speeds is Disabled" rather than UVD/VCE themselves being disabled.
      Ah, I see. Thanks for the quick response.

      I looked at the code in drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c:

      Code:
          /* UVD clocks */
          if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_UVD_POWER, (void *)&value, &size)) {
              if (!value) {
                  seq_printf(m, "UVD: Disabled\n");
              } else {
                  seq_printf(m, "UVD: Enabled\n");
                  if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_UVD_DCLK, (void *)&value, &size))
                      seq_printf(m, "\t%u MHz (DCLK)\n", value/100);
                  if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_UVD_VCLK, (void *)&value, &size))
                      seq_printf(m, "\t%u MHz (VCLK)\n", value/100);
              }
          }
      Digging deeper into that variable I see:

      linux-4.18-rc7 ❯ grep -r 'AMDGPU_PP_SENSOR_UVD_POWER' .
      ./drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c: if (!amdgpu_dpm_read_sensor(adev, AMDGPU_PP_SENSOR_UVD_POWER, (void *)&value, &size)) {
      ./drivers/gpu/drm/amd/powerplay/hwmgr/vega12_hwmgr.c: case AMDGPU_PP_SENSOR_UVD_POWER:
      ./drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c: case AMDGPU_PP_SENSOR_UVD_POWER:
      ./drivers/gpu/drm/amd/powerplay/hwmgr/vega10_hwmgr.c: case AMDGPU_PP_SENSOR_UVD_POWER:
      ./drivers/gpu/drm/amd/powerplay/hwmgr/smu8_hwmgr.c: case AMDGPU_PP_SENSOR_UVD_POWER:
      ./drivers/gpu/drm/amd/include/kgd_pp_interface.h: AMDGPU_PP_SENSOR_UVD_POWER,

      I'll keep looking. Starting to think it is for sure disabled because I've seen the MHz (DCLK) and (VCLK) in amdgpu_pm_info, I *believe*.

      I also wonder if this is because I built amdgpu into the kernel instead of as a module, either way I'll see if I can get it to show Enabled. Thanks again.

      Comment


      • #4
        But do they actually work? For UVD play something HD with h264 in mpv/smplayer and see the console output. For vce you could try transcoding with ffmpeg:

        Code:
        ffmpeg -y -vaapi_device /dev/dri/renderD128 -i $inputfile -vf 'format=nv12,hwupload' -bf 0 -c:v h264_vaapi $outputfile

        Comment


        • #5
          Originally posted by gradinaruvasile View Post
          But do they actually work? For UVD play something HD with h264 in mpv/smplayer and see the console output. For vce you could try transcoding with ffmpeg:

          Code:
          ffmpeg -y -vaapi_device /dev/dri/renderD128 -i $inputfile -vf 'format=nv12,hwupload' -bf 0 -c:v h264_vaapi $outputfile
          Thanks for the suggestion. Here's the output when I run that.

          Code:
          Videos ❯ ffmpeg -y -vaapi_device /dev/dri/renderD128 -i video.mp4 -vf 'format=nv12,hwupload' -bf 0 -c:v h264_vaapi video-output.mp4
          ffmpeg version 3.4.2-2build2 Copyright (c) 2000-2018 the FFmpeg developers
            built with gcc 7 (Ubuntu 7.3.0-21ubuntu1)
            configuration: --prefix=/usr --extra-version=2build2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
            WARNING: library configuration mismatch
            avcodec     configuration: --prefix=/usr --extra-version=2build2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared --enable-version3 --disable-doc --disable-programs --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libtesseract --enable-libvo_amrwbenc
            libavutil      55. 78.100 / 55. 78.100
            libavcodec     57.107.100 / 57.107.100
            libavformat    57. 83.100 / 57. 83.100
            libavdevice    57. 10.100 / 57. 10.100
            libavfilter     6.107.100 /  6.107.100
            libavresample   3.  7.  0 /  3.  7.  0
            libswscale      4.  8.100 /  4.  8.100
            libswresample   2.  9.100 /  2.  9.100
            libpostproc    54.  7.100 / 54.  7.100
          Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'video.mp4':
            Metadata:
              major_brand     : isom
              minor_version   : 1
              compatible_brands: isomavc1
              creation_time   : 2012-06-08T16:15:29.000000Z
            Duration: 01:49:37.66, start: 0.000000, bitrate: 893 kb/s
              Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x528 [SAR 1:1 DAR 80:33], 795 kb/s, 23.98 fps, 23.98 tbr, 96k tbn, 47.95 tbc (default)
              Metadata:
                creation_time   : 2012-06-08T16:15:29.000000Z
              Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 93 kb/s (default)
              Metadata:
                creation_time   : 2012-06-08T16:15:41.000000Z
                handler_name    : GPAC ISO Audio Handler
          Stream mapping:
            Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_vaapi))
            Stream #0:1 -> #0:1 (aac (native) -> aac (native))
          Press [q] to stop, [?] for help
          [h264_vaapi @ 0x557f765178c0] Warning: some packed headers are not supported (want 0xd, got 0).
          Output #0, mp4, to 'video-output.mp4':
            Metadata:
              major_brand     : isom
              minor_version   : 1
              compatible_brands: isomavc1
              encoder         : Lavf57.83.100
              Stream #0:0(und): Video: h264 (h264_vaapi) (High) (avc1 / 0x31637661), vaapi_vld(progressive), 1280x528 [SAR 1:1 DAR 80:33], q=0-31, 23.98 fps, 24k tbn, 23.98 tbc (default)
              Metadata:
                creation_time   : 2012-06-08T16:15:29.000000Z
                encoder         : Lavc57.107.100 h264_vaapi
              Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 128 kb/s (default)
              Metadata:
                creation_time   : 2012-06-08T16:15:41.000000Z
                handler_name    : GPAC ISO Audio Handler
                encoder         : Lavc57.107.100 aac
          frame=157705 fps=146 q=-0.0 Lsize= 1610916kB time=01:49:37.65 bitrate=2006.3kbits/s dup=2 drop=0 speed=6.08x    
          video:1503704kB audio:103497kB subtitle:0kB other streams:0kB global headers:0kB muxing overhead: 0.231102%
          [aac @ 0x557f76619f00] Qavg: 1149.211
          Checking for UVD/VCE again now shows:

          UVD: Disabled

          VCE: Enabled

          And then while it was converting, I ran the original video and checked the output of amdgpu_pm_info again and it shows:

          UVD: Enabled

          VCE: Enabled


          Nice! So looks like it will only show Enabled/Disabled when it's being used. I'm still not seeing the clocks when they're Enabled, but all good. Thanks again guys.

          Comment

          Working...
          X