intel / gvt-linux

Other
503 stars 94 forks source link

golden_hw_state failed with error -2 #212

Open smsilva98 opened 2 years ago

smsilva98 commented 2 years ago

I'm getting the "golden_hw_state failed with error -2" error in my dmesg logs, it doesn't stop me from creating and using vgpu's though, what does this error affect? I saw issue #77 mentioned that it's not actually a real error but that issue was closed so I'm not sure if the issue was ever fixed, if it's not actually a real error can the error message be removed?

The full error message: Direct firmware load for i915/gvt/vid_0x8086_did_0x5917_rid_0x07.golden_hw_state failed with error -2

I assume the error has something to do with [drivers/gpu/drm/i915/gvt/firmware.c] line 230 sprintf(path, "%s/vid_0x%04x_did_0x%04x_rid_0x%02x.golden_hw_state", GVT_FIRMWARE_PATH, pdev->vendor, pdev->device, pdev->revision); and line 236 ret = request_firmware(&fw, path, gvt->gt->i915->drm.dev);

System: Arch Linux (5.17.5-arch1-1) CPU: Kabby Lake (i7-8550U) GPU: UHD Graphics 620 (Gen9) Driver: mesa Mkinitcpio Modules: kvmgt vfio vfio-iommu-type1 mdev Kernel Parameters: intel_iommu=on i915.enable_guc=0 i915.enable_gvt=1

smsilva98 commented 2 years ago

I found the code that prints the message in the source code of request_firmware it internally calls _request_firmware and passes in FW_OPT_UEVENT for opt_flags which is an enum value for BIT(0), I think the only way to disable this message is to replace request_firmware with another function where we can pass in a different value for opt_flags to disable the message, does anyone have any thoughts on this?

if (ret) {
    if (!(opt_flags & FW_OPT_NO_WARN))
        dev_warn(device,
            "Direct firmware load for %s failed with error %d\n",
            name, ret);
smsilva98 commented 2 years ago

I think the problem can be solved by replacing line 236 of [drivers/gpu/drm/i915/gvt/firmware.c] ret = request_firmware(&fw, path, gvt->gt->i915->drm.dev); with either ret = firmware_request_nowarn(&fw, path, gvt->gt->i915->drm.dev); or potentially ret = request_firmware_direct(&fw, path, gvt->gt->i915->drm.dev); can someone please confirm if this would be an acceptable solution?

TerrenceXu commented 2 years ago

Thanks @smsilva98 , we will check it.

jnikula commented 2 years ago

Also hit by other folks at https://gitlab.freedesktop.org/drm/intel/-/issues/6167

mhalano commented 1 year ago

I'm getting this log and black screen, but no problem to load firmware. It is similar to issue @jnikula mentioned before. Could it be related?

journalctl -b -2 |grep i915          
jul 27 18:46:49 glados kernel: i915 0000:00:02.0: enabling device (0006 -> 0007)
jul 27 18:46:49 glados kernel: i915 0000:00:02.0: vgaarb: changed VGA decodes: olddecodes=io+mem,decodes=none:owns=mem
jul 27 18:46:49 glados kernel: i915 0000:00:02.0: [drm] Finished loading DMC firmware i915/tgl_dmc_ver2_12.bin (v2.12)
jul 27 18:46:49 glados kernel: mei_hdcp 0000:00:16.0-b638ab7e-94e2-4ea2-a552-d1c54b627f04: bound 0000:00:02.0 (ops i915_hdcp_component_ops [i915])
jul 27 18:46:49 glados kernel: i915 0000:00:02.0: [drm] failed to retrieve link info, disabling eDP
jul 27 18:46:49 glados kernel: mei_pxp 0000:00:16.0-fbf6fcf1-96cf-4e2e-a6a6-1bab8cbe36b1: bound 0000:00:02.0 (ops i915_pxp_tee_component_ops [i915])
jul 27 18:46:49 glados kernel: i915 0000:00:02.0: [drm] Protected Xe Path (PXP) protected content support initialized
jul 27 18:46:51 glados kernel: [drm] Initialized i915 1.6.0 20201103 for 0000:00:02.0 on minor 0
jul 27 18:46:51 glados kernel: sof-audio-pci-intel-tgl 0000:00:1f.3: bound 0000:00:02.0 (ops i915_audio_component_bind_ops [i915])
jul 27 18:46:51 glados kernel: i915 0000:00:02.0: [drm] Cannot find any crtc or sizes
jul 27 18:46:51 glados kernel: i915 0000:00:02.0: [drm] Cannot find any crtc or sizes
insomnia417 commented 1 year ago

Is this problem fixed now? I still have this problem on unreid 6.11.5. CPU: 9900ES (QQZ5)

rahulc07 commented 1 year ago

Are you having problems actually creating a vgpu?

I think this error could be solved by installing the linux-firmware or firmware-linux package

insomnia417 commented 1 year ago

but unraid is not support

smsilva98 commented 1 year ago

The error still needs to be fixed. I found the source of the error, and it only required a one-line of code change to fix. I submitted a pull request with the fix a while ago, but it has not been merged yet. I've tried pull requests to multiple branches, and I've raised a second issue #218 asking where I need to submit the pull request, in order to get it merged but haven't heard back anything from anyone. Does anybody know what I need to do to get my pull request merged into the project?

zhenyw commented 1 year ago

sorry, gvt development doesn't use github to merge any patch, it's still required to be sent to intel-gvt-dev@lists.freedesktop.org mail list for review and merge.

T4ylan commented 1 year ago

Any news about this issue?

smsilva98 commented 11 months ago

@T4ylan I don't think anyone has looked at this, I'll email the mail list to see if it can be merged.