microsoft / WSL

Issues found on WSL
https://docs.microsoft.com/windows/wsl
MIT License
17.25k stars 812 forks source link

libva error: /usr/lib/x86_64-linux-gnu/dri/d3d12_drv_video.so init failed #11939

Open Ailina0728 opened 3 weeks ago

Ailina0728 commented 3 weeks ago

Windows Version

Microsoft Windows [版本 10.0.22621.3447]

WSL Version

2.2.4.0

Are you using WSL 1 or WSL 2?

Kernel Version

5.15.153.1

Distro Version

Ubuntu 22.04

Other Software

No response

Repro Steps

1.Newly installed WSL2 2.run apt install vainfo mesa-utils 3.run glxinfo -B 4.run export LIBVA_DRIVER_NAME=d3d12 5.run vainfo 6:run vainfo --display drm --device /dev/dri/renderD128 vainfo --display drm --device /dev/dri/card0 7.run glxgears

Expected Behavior

After running glxinfo -B and confirming that the Device and OpenGL renderer are using D3D12 (Intel (R) UHD Graphics 770), running vainfo will provide complete support information for example

libva info: VA-API version 1.14.0
libva info: User environment variable requested driver 'd3d12'
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/d3d12_drv_video.so
libva info: Found init function __vaDriverInit_1_14
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.14 (libva 2.12.0)
vainfo: Driver version: Mesa Gallium driver 22.3.3 - kisak-mesa PPA for D3D12 (Intel(R) UHD Graphics 630)
vainfo: Supported profile and entrypoints
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
root@Yunn:~# glxinfo -B
name of display: :0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: Microsoft Corporation (0xffffffff)
    Device: D3D12 (Intel(R) UHD Graphics 770) (0xffffffff)
    Version: 23.2.1
    Accelerated: yes
    Video memory: 32777MB
    Unified memory: yes
    Preferred profile: core (0x1)
    Max core profile version: 4.1
    Max compat profile version: 4.1
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.0
OpenGL vendor string: Microsoft Corporation
OpenGL renderer string: D3D12 (Intel(R) UHD Graphics 770)
OpenGL core profile version string: 4.1 (Core Profile) Mesa 23.2.1-1ubuntu3.1~22.04.2
OpenGL core profile shading language version string: 4.10
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 4.1 (Compatibility Profile) Mesa 23.2.1-1ubuntu3.1~22.04.2
OpenGL shading language version string: 4.10
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile

OpenGL ES profile version string: OpenGL ES 3.0 Mesa 23.2.1-1ubuntu3.1~22.04.2
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00

Actual Behavior

There was an error when entering 'vainfo'

root@Yunn:~# vainfo
libva info: VA-API version 1.14.0
libva info: User environment variable requested driver 'd3d12'
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/d3d12_drv_video.so
libva info: Found init function __vaDriverInit_1_14
libva error: /usr/lib/x86_64-linux-gnu/dri/d3d12_drv_video.so init failed
libva info: va_openDriver() returns 18
vaInitialize failed with error code 18 (invalid parameter),exit

But when I entered vainfo -- display drm -- device/dev/dri/renderD128, there was no error

libva info: VA-API version 1.14.0
libva info: User environment variable requested driver 'd3d12'
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/d3d12_drv_video.so
libva info: Found init function __vaDriverInit_1_14
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.14 (libva 2.12.0)
vainfo: Driver version: Mesa Gallium driver 23.2.1-1ubuntu3.1~22.04.2 for D3D12 (Intel(R) UHD Graphics 770)
vainfo: Supported profile and entrypoints
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointEncSlice
      VAProfileH264High               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointEncSlice
      VAProfileHEVCMain               : VAEntrypointVLD
      VAProfileHEVCMain               : VAEntrypointEncSlice
      VAProfileHEVCMain10             : VAEntrypointVLD
      VAProfileHEVCMain10             : VAEntrypointEncSlice
      VAProfileVP9Profile0            : VAEntrypointVLD
      VAProfileVP9Profile2            : VAEntrypointVLD
      VAProfileAV1Profile0            : VAEntrypointVLD
      VAProfileNone                   : VAEntrypointVideoProc

The result of entering vainfo -- display drm -- device/dev/dri/card0 is the same as above After re-verifying and entering glxgears, I observed the window in the process of rendering, and in the task manager, I noticed that about half of the Intel GPU's workload is attributed to 3D rendering.

Why does entering 'vainfo' prompt 'd3d12 driver parameter error 18', and what other verification methods are available

Diagnostic Logs

root@Yunn:~# dmesg | grep 'dxg'
[    0.286481] hv_vmbus: registering driver dxgkrnl
[    1.564415] misc dxg: dxgk: dxgkio_is_feature_enabled: Ioctl failed: -22
[    1.568518] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[    1.568864] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[    1.569197] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[    1.569584] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[    1.570585] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[    1.570954] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[    1.571267] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[    1.571893] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[   41.182660] misc dxg: dxgk: dxgkio_is_feature_enabled: Ioctl failed: -22
[   41.187706] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[   41.188154] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[   41.188660] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[   41.189293] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[   41.190635] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[   41.191136] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[   41.191549] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[   41.192016] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[ 1730.590095] misc dxg: dxgk: dxgkio_is_feature_enabled: Ioctl failed: -22
[ 1730.592531] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 1730.592912] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 1730.593470] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 1730.593872] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[ 1730.595060] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 1730.595663] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 1730.596190] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 1730.596862] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[ 5325.528992] misc dxg: dxgk: dxgkio_is_feature_enabled: Ioctl failed: -22
[ 5325.533585] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 5325.534084] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 5325.534525] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 5325.535079] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[ 5325.536195] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 5325.536598] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 5325.537002] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 5325.537417] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[ 5965.102427] misc dxg: dxgk: dxgkio_is_feature_enabled: Ioctl failed: -22
[ 5965.110992] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 5965.111386] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 5965.111745] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 5965.112151] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[ 5965.113358] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 5965.113862] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 5965.114214] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 5965.114594] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[ 7276.282217] misc dxg: dxgk: dxgkio_is_feature_enabled: Ioctl failed: -22
[ 7276.289310] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 7276.289858] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 7276.290266] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 7276.290724] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[ 7276.291945] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 7276.292311] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 7276.292678] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 7276.293095] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[ 7402.444257] misc dxg: dxgk: dxgkio_is_feature_enabled: Ioctl failed: -22
[ 7402.449739] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 7402.450411] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 7402.451070] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 7402.451638] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[ 7402.452638] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 7402.453043] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 7402.453410] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 7402.453883] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[ 7582.059730] misc dxg: dxgk: dxgkio_is_feature_enabled: Ioctl failed: -22
[ 7582.064861] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 7582.065292] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 7582.065817] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 7582.066184] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
[ 7582.067142] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 7582.067499] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 7582.067813] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -22
[ 7582.068169] misc dxg: dxgk: dxgkio_query_adapter_info: Ioctl failed: -2
github-actions[bot] commented 3 weeks ago

Logs are required for review from WSL team

If this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. Otherwise please attach logs by following the instructions below, your issue will not be reviewed unless they are added. These logs will help us understand what is going on in your machine.

How to collect WSL logs Download and execute [collect-wsl-logs.ps1](https://github.com/Microsoft/WSL/blob/master/diagnostics/collect-wsl-logs.ps1) in an **administrative powershell prompt**: ``` Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1 Set-ExecutionPolicy Bypass -Scope Process -Force .\collect-wsl-logs.ps1 ``` The script will output the path of the log file once done. If this is a networking issue, please use [collect-networking-logs.ps1](https://github.com/Microsoft/WSL/blob/master/diagnostics/collect-networking-logs.ps1), following the instructions [here](https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#collect-wsl-logs-for-networking-issues) Once completed please upload the output files to this Github issue. [Click here for more info on logging](https://github.com/microsoft/WSL/blob/master/CONTRIBUTING.md#8-collect-wsl-logs-recommended-method) If you choose to email these logs instead of attaching to the bug, please send them to wsl-gh-logs@microsoft.com with the number of the github issue in the subject, and in the message a link to your comment in the github issue and reply with '/emailed-logs'.

View similar issues

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

Ailina0728 commented 3 weeks ago

需要日志才能从 WSL 团队进行评审

如果这是功能请求,请回复“/feature”。如果这是一个问题,请回复“/question”。 否则,请按照以下说明附加日志,除非添加日志,否则不会审核您的问题。这些日志将帮助我们了解您的机器中发生的情况。

如何收集 WSL 日志 在管理 powershell 提示符下下载并执行 collect-wsl-logs.ps1

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1

完成后,该脚本将输出日志文件的路径。

如果这是网络问题,请按照此处的说明使用 collect-networking-logs.ps1

完成后,请将输出文件上传到此 Github 问题。

单击此处了解有关日志记录的更多信息 如果您选择通过电子邮件发送这些日志而不是附加到 bug 上,请将它们发送到 wsl-gh-logs@microsoft.com,并在主题中注明 github 问题的编号,并在消息中提供指向您在 github issue 中的评论的链接,并回复“/emailed-logs”。

查看相似问题

请查看下面的问题,看看它们是否解决了您的问题,如果问题描述了您的问题,请考虑关闭这个问题并竖起大拇指另一个问题,以帮助我们确定问题的优先级!

打开类似问题:

已关闭类似问题:

注意:您可以通过竖起大拇指或竖起大拇指来给我反馈。

/question

github-actions[bot] commented 3 weeks ago
Diagnostic information ``` Found '/question', adding tag 'question' ```
Ailina0728 commented 3 weeks ago

WslLogs-2024-08-20_02-06-57.zip

github-actions[bot] commented 3 weeks ago

The log file doesn't contain any WSL traces. Please make sure that you reproduced the issue while the log collection was running.

Diagnostic information ``` .wslconfig found Detected appx version: 2.2.4.0 Found no WSL traces in the logs ```
Ailina0728 commented 3 weeks ago

WslLogs-2024-08-20_02-14-38.zip

github-actions[bot] commented 3 weeks ago
Diagnostic information ``` .wslconfig found Detected appx version: 2.2.4.0 ```
Ailina0728 commented 3 weeks ago

Why is there an error when entering vainfo, but adding the parameter -- display drm -- device/dev/dri/renderD128 seems fine, and glxgears can also render. Using ffmpeg to report error KMS: DRM-IOCTL_MODE_CREATE-DUMB failed: Permission denied, KMS: DRM_IOCTL_MODE_CREATE_DUMB failed: Invalid argument。 When I enter drm-info, it prompts Failed to retrieve information from/dev/dri/card0