Can't start packaged project on 5.1 (GraphicsContext error)

I upgraded my project to unreal 5.1 from 5.0, but I keep getting this error when starting a packaged game:

Assertion failed: GraphicsContext [File:E:\UE5_2\Engine\Source\Runtime\RHI\Public\RHICommandList.h] [Line: 581] 
There is no active graphics context on this command list. There may be a missing call to SwitchPipeline().

What is a graphics context? Is there some config required that I am missing? Everything worked fine in 5.0

2 Likes

The “graphics context” refers to a collection of information related to the current state of the graphics pipeline, such as the active shaders, render targets, and other parameters.

The error you’re encountering, suggests that the engine is trying to issue a GPU command, but there is no current context established. This error often occurs when you are trying to perform rendering operations outside of the normal render thread, or if there is an issue with the way the engine is switching between different pipelines.

To resolve this issue, you may need to investigate the code or assets that were changed or added during the upgrade from Unreal Engine 5.0 to 5.1, as that may have introduced the problem. You may also want to look into the engine’s log files or enable debugging features to see what exactly is causing the missing graphics context error.

Thanks for the answer!
There is not much what was changed during the upgrade, except for some plugins. I have check every plugin, it doesn’t seem to be the problem. Debugging does not help, I’ve tried to run game with the debugger on, but it gives no helpful context on what could cause this error.

It seems to be connected to some of the shaders: FRHICommandList | Unreal Engine Documentation

I suggest you try to verify the engine files using the Epic Games Launcher, and also try to try packaging a new template project.

Hi, I have the same issue, upgraded my project from 4.27.2-release and now using 5.1.1-release, the non packaged client works fine. When I package on windows with

-clientconfig=Shipping

I get that error:

[2023.02.14-21.01.30:149][ 0]LogWindows: Attached monitors:
[2023.02.14-21.01.30:149][ 0]LogWindows: resolution: 2560x1440, work area: (73, 0) → (2560, 1440), device: ‘\.\DISPLAY1’ [PRIMARY]
[2023.02.14-21.01.30:150][ 0]LogWindows: resolution: 1920x1080, work area: (2633, 169) → (4480, 1249), device: ‘\.\DISPLAY2’
[2023.02.14-21.01.30:150][ 0]LogWindows: Found 2 attached monitors.
[2023.02.14-21.01.30:151][ 0]LogWindows: Gathering driver information using Windows Setup API
[2023.02.14-21.01.30:151][ 0]LogRHI: RHI Adapter Info:
[2023.02.14-21.01.30:151][ 0]LogRHI: Name: NVIDIA GeForce RTX 2070 SUPER
[2023.02.14-21.01.30:151][ 0]LogRHI: Driver Version: 528.02 (internal:31.0.15.2802, unified:528.02)
[2023.02.14-21.01.30:152][ 0]LogRHI: Driver Date: 12-22-2022
[2023.02.14-21.01.30:152][ 0]LogD3D11RHI: Creating new Direct3DDevice
[2023.02.14-21.01.30:152][ 0]LogD3D11RHI: GPU DeviceId: 0x1e84 (for the marketing name, search the web for “GPU Device Id”)
[2023.02.14-21.01.30:153][ 0]LogRHI: Texture pool is 5602 MB (70% of 8003 MB)
[2023.02.14-21.01.30:153][ 0]LogD3D11RHI: Creating D3DDevice using adapter:
[2023.02.14-21.01.30:154][ 0]LogD3D11RHI: Description : NVIDIA GeForce RTX 2070 SUPER
[2023.02.14-21.01.30:154][ 0]LogD3D11RHI: VendorId : 10de
[2023.02.14-21.01.30:155][ 0]LogD3D11RHI: DeviceId : 1e84
[2023.02.14-21.01.30:155][ 0]LogD3D11RHI: SubSysId : 87281043
[2023.02.14-21.01.30:155][ 0]LogD3D11RHI: Revision : 00a1
[2023.02.14-21.01.30:156][ 0]LogD3D11RHI: DedicatedVideoMemory : 8391753728 bytes
[2023.02.14-21.01.30:156][ 0]LogD3D11RHI: DedicatedSystemMemory : 0 bytes
[2023.02.14-21.01.30:156][ 0]LogD3D11RHI: SharedSystemMemory : 17131378688 bytes
[2023.02.14-21.01.30:157][ 0]LogD3D11RHI: AdapterLuid : 0 70875
[2023.02.14-21.01.30:222][ 0]LogD3D11RHI: RHI has support for 64 bit atomics
[2023.02.14-21.01.30:223][ 0]LogD3D11RHI: Async texture creation enabled
[2023.02.14-21.01.30:224][ 0]LogD3D11RHI: D3D11_MAP_WRITE_NO_OVERWRITE for dynamic buffer SRVs is supported
[2023.02.14-21.01.30:225][ 0]LogD3D11RHI: Array index from any shader is supported
[2023.02.14-21.01.30:259][ 0]LogD3D11RHI: GPU Timing Frequency: 1000.000000 (Debug: 2 1)
[2023.02.14-21.01.30:279][ 0]LogWindows: Error: appError called: Assertion failed: GraphicsContext [File:G:\5.1.1\Engine\Source\Runtime\RHI\Public\RHICommandList.h] [Line: 581]
There is no active graphics context on this command list. There may be a missing call to SwitchPipeline().


I tried also to use -DX12 on the command line, and I see it’s now using DX12, but the error is the same.

[2023.02.14-21.33.54:452][ 0]LogD3D12RHI: Display: Creating D3D12 RHI with Max Feature Level SM5
[2023.02.14-21.33.54:453][ 0]LogWindows: Attached monitors:
[2023.02.14-21.33.54:454][ 0]LogWindows: resolution: 2560x1440, work area: (73, 0) → (2560, 1440), device: ‘\.\DISPLAY1’ [PRIMARY]
[2023.02.14-21.33.54:455][ 0]LogWindows: resolution: 1920x1080, work area: (2633, 169) → (4480, 1249), device: ‘\.\DISPLAY2’
[2023.02.14-21.33.54:455][ 0]LogWindows: Found 2 attached monitors.
[2023.02.14-21.33.54:455][ 0]LogWindows: Gathering driver information using Windows Setup API
[2023.02.14-21.33.54:456][ 0]LogRHI: RHI Adapter Info:
[2023.02.14-21.33.54:457][ 0]LogRHI: Name: NVIDIA GeForce RTX 2070 SUPER
[2023.02.14-21.33.54:458][ 0]LogRHI: Driver Version: 528.02 (internal:31.0.15.2802, unified:528.02)
[2023.02.14-21.33.54:458][ 0]LogRHI: Driver Date: 12-22-2022
[2023.02.14-21.33.54:458][ 0]LogD3D12RHI: GPU DeviceId: 0x1e84 (for the marketing name, search the web for “GPU Device Id”)
[2023.02.14-21.33.54:459][ 0]LogD3D12RHI: InitD3DDevice: -D3DDebug = off -D3D12GPUValidation = off
[2023.02.14-21.33.54:563][ 0]LogD3D12RHI: ID3D12Device1 is supported.
[2023.02.14-21.33.54:563][ 0]LogD3D12RHI: ID3D12Device2 is supported.
[2023.02.14-21.33.54:565][ 0]LogD3D12RHI: ID3D12Device3 is supported.
[2023.02.14-21.33.54:565][ 0]LogD3D12RHI: ID3D12Device4 is supported.
[2023.02.14-21.33.54:566][ 0]LogD3D12RHI: ID3D12Device5 is supported.
[2023.02.14-21.33.54:566][ 0]LogD3D12RHI: ID3D12Device6 is supported.
[2023.02.14-21.33.54:567][ 0]LogD3D12RHI: ID3D12Device7 is supported.
[2023.02.14-21.33.54:567][ 0]LogD3D12RHI: ID3D12Device8 is supported.
[2023.02.14-21.33.54:568][ 0]LogD3D12RHI: ID3D12Device9 is supported.
[2023.02.14-21.33.54:568][ 0]LogD3D12RHI: ID3D12Device10 is supported.
[2023.02.14-21.33.54:568][ 0]LogD3D12RHI: Bindless resources are supported
[2023.02.14-21.33.54:569][ 0]LogD3D12RHI: D3D12 ray tracing tier 1.1 and bindless resources are supported.
[2023.02.14-21.33.54:569][ 0]LogD3D12RHI: Mesh shader tier 1.0 is supported
[2023.02.14-21.33.54:570][ 0]LogD3D12RHI: AtomicInt64OnTypedResource is supported
[2023.02.14-21.33.54:570][ 0]LogD3D12RHI: AtomicInt64OnGroupShared is supported
[2023.02.14-21.33.54:570][ 0]LogD3D12RHI: AtomicInt64OnDescriptorHeapResource is supported
[2023.02.14-21.33.54:571][ 0]LogD3D12RHI: Shader Model 6.6 atomic64 is supported
[2023.02.14-21.33.54:677][ 0]LogD3D12RHI: Display: Not using pipeline state disk cache per r.D3D12.PSO.DiskCache=0
[2023.02.14-21.33.54:677][ 0]LogD3D12RHI: Display: Not using driver-optimized pipeline state disk cache per r.D3D12.PSO.DriverOptimizedDiskCache=0
[2023.02.14-21.33.54:681][ 0]LogRHI: Texture pool is 4558 MB (70% of 6511 MB)
[2023.02.14-21.33.54:681][ 0]LogD3D12RHI: Async texture creation enabled
[2023.02.14-21.33.54:682][ 0]LogD3D12RHI: RHI has support for 64 bit atomics
[2023.02.14-21.33.54:706][ 0]LogWindows: Error: appError called: Assertion failed: GraphicsContext [File:G:\5.1.1\Engine\Source\Runtime\RHI\Public\RHICommandList.h] [Line: 581]
There is no active graphics context on this command list. There may be a missing call to SwitchPipeline().


If I package the same project with

-clientconfig=Development

it doesn’t crash.

Also as a test I created a new fresh ThirdPerson game with the Editor and packaged it on the same machine. This one works in shipping build (and development build). So must be something happening in the 4.27->5.1.1 conversion.

I found out the issue. The problem is with this flag in Target.cs

    if (Configuration == UnrealTargetConfiguration.Shipping)
    {
        bUseChecksInShipping = true;
    }

I tried to create a simple ThirdPerson project, add a C++ class to get the Build and Target files. Add bUseChecksInShipping = true; and build it in shipping mode, it’s crashing with the same error as above:

LogWindows: Error: appError called: Assertion failed: GraphicsContext [File:G:\5.1.1\Engine\Source\Runtime\RHI\Public\RHICommandList.h] [Line: 581]
There is no active graphics context on this command list. There may be a missing call to SwitchPipeline().

This was not happening in 4.27.2, the flag bUseChecksInShipping could be used in shipping builds without any problem.

UPDATE: I found out that’s an already logged ticket as well: Unreal Engine Issues and Bug Tracker (UE-171275)

2 Likes

Thank you so much! This helped! This was not happening in 5.0 either

This broken …