Easy-GPU-PV icon indicating copy to clipboard operation
Easy-GPU-PV copied to clipboard

nvidia sample programe BSOD with gpu-p

Open jack2007 opened this issue 1 year ago • 9 comments

Hi, I setup hyper-v gpu-p in my computer with esay-gpu-pv script. When I run nvidia sample programe in nvidia sdk, the windows host get BSOD. These sample programes are AppEncD3D9/AppEncD3D11/AppEncCuda in SDK package\Samples\AppEncode directory. By the way, the AppEncD3D12 sample is OK in gpu-p.

host&guest windows: win11 10.0.22631.2861 nvidia gpu driver: 546.33 nvidia sdk version: Video_Codec_SDK_11.1.5 gpu: geforce 3060

Best Wishes

jack2007 avatar Jan 17 '24 04:01 jack2007

Hi I'm facing the same issue.

In this case it's a piece of code i wrote. And i was able to narrow it down to "end of nvenc session". When i try to close the nvenc session, this is happening. I couldn't find any logs in event viewer

It also happens when I try to force idr refresh in nvenc encoder.

kittuov avatar Feb 05 '24 19:02 kittuov

Try using 517.40 and earlier (see https://github.com/LizardByte/Sunshine/issues/2141) and please let me know what happens.

devusr1x avatar Feb 15 '24 02:02 devusr1x

517.40 does not support RTX 4090 :( Lowest supported driver is 522.25, which already has NVIDIA Video Codec SDK v12.0 And thus crashes the Host

sschamp avatar May 04 '24 15:05 sschamp

Strange thing is, on 536.99 this just works on the VM:

ffmpeg.exe -y -hwaccel cuda -hwaccel_output_format cuda ^
-f lavfi -i testsrc -t 50 ^
-vf hwupload -fps_mode passthrough -c:a copy -c:v av1_nvenc -b:v 4M -f null - ^
-vf hwupload -fps_mode passthrough -c:a copy -c:v av1_nvenc -b:v 1M -f null - ^
-vf hwupload -fps_mode passthrough -c:a copy -c:v av1_nvenc -b:v 8M -f null - ^
-vf hwupload -fps_mode passthrough -c:a copy -c:v av1_nvenc -b:v 6M -f null - ^
-vf hwupload -fps_mode passthrough -c:a copy -c:v av1_nvenc -b:v 5M -f null -

sschamp avatar May 04 '24 15:05 sschamp

Adding -outputInVidMem 1 to the sample apps mentioned above, does not BSOD the host.

Somehow it seems that some implementations do:

    RegisterOutputResources();
...
    FlushEncoder();
    ReleaseOutputBuffers();

And others don't.

So rewrite your code to use the implementation of:

Video_Codec_SDK_12.2.72/Samples/NvCodec/NvEncoder/NvEncoderOutputInVidMemCuda.cpp or Video_Codec_SDK_12.2.72/Samples/NvCodec/NvEncoder/NvEncoderOutputInVidMemD3D11.cpp

sschamp avatar May 15 '24 23:05 sschamp

Try Server 2025 (vNext Preview), GPU-P runs more stable there.

sschamp avatar May 29 '24 11:05 sschamp

@sschamp Can you please explain what do you mean by that ("more stable")? Did you manage to make it work without specific flags? What's your setup?

devusr1x avatar Jun 09 '24 17:06 devusr1x

@sschamp Can you please explain what do you mean by that ("more stable")? Did you manage to make it work without specific flags? What's your setup?

Since 555 drivers there are no more crashes. The main reason for this is that they can use WDDM 3.2 on Server 2025 (vNext).

But I have since switched to Windows 11 24H2 (Insider Preview Dev Channel), as that also has WDDM 3.2 and is more suited for my needs.

sschamp avatar Jun 10 '24 18:06 sschamp

Interesting, thanks for the info.

devusr1x avatar Jun 13 '24 17:06 devusr1x