ValveSoftware / Source-1-Games

Source 1 based games such as TF2 and Counter-Strike: Source
643 stars 74 forks source link

[TF2] [LINUX x64] Game doesn't launch and resets monitors #5704

Open Mistyttm opened 6 months ago

Mistyttm commented 6 months ago

Game doesn't launch and resets monitors

Hardware/software details

Distro: Arch Linux Kernal: 6.8.7-arch1-1 (64-bit) Desktop manager: KDE 6.0.4 Graphics Platform: X11 File System Type: ext4

Steam version: Steam Native Runtime

GPU: NVIDIA GTX 1650 mobile Graphics Driver Version: 550.67 (closed source drivers) CPU: Intel® Core™ i5-10500H

TF2 Launch options: -condebug -conclearlog -usercon -g15 -dxlevel 95 -fullscreen -w 1920 -h 1080 -console -novid Play Team Fortress 2 selected

Compatability Layer: none

TF2 Build ID: 14104688

Details

When launching TF2 it starts its normal launch process, but I assume when trying to create the window it errors out and turns off my second monitor. It fully disables it at an OS level and requires me going into my settings to re-enable it, it also requires me to reset my primary monitor. After this happens the game then stops launching and switches back to the play button in the steam library.

I have managed to get the game to "properly" launch once, during that time I managed to get to the loading screen, the game then locked up and froze my DE forcing me to swap to a TTY to force a restart.

Running the game through the command line is unsuccessful as it errors out with this message:

./tf_linux64: error while loading shared libraries: libmimalloc.so: cannot open shared object file: No such file or directory

a file called tf_linux64_d3d9.log has also now appeared after launching the game through steam:

info:  Game: tf_linux64
info:  DXVK: v2.3
info:  Vulkan: Found vkGetInstanceProcAddr in libvulkan.so.1 @ 0x7233081b0b80
info:  Built-in extension providers:
info:    SDL2 WSI
info:  Enabled instance extensions:
info:    VK_EXT_surface_maintenance1
info:    VK_KHR_get_surface_capabilities2
info:    VK_KHR_surface
info:    VK_KHR_xlib_surface
info:  D3D9: VK_FORMAT_D16_UNORM_S8_UINT -> VK_FORMAT_D24_UNORM_S8_UINT
info:  NVIDIA GeForce GTX 1650:
info:    Driver : NVIDIA 550.67.0
info:    Memory Heap[0]: 
info:      Size: 4096 MiB
info:      Flags: 0x1
info:      Memory Type[1]: Property Flags = 0x1
info:      Memory Type[2]: Property Flags = 0x1
info:    Memory Heap[1]: 
info:      Size: 23907 MiB
info:      Flags: 0x0
info:      Memory Type[0]: Property Flags = 0x0
info:      Memory Type[3]: Property Flags = 0x6
info:      Memory Type[4]: Property Flags = 0xe
info:    Memory Heap[2]: 
info:      Size: 246 MiB
info:      Flags: 0x1
info:      Memory Type[5]: Property Flags = 0x7
info:  Device properties:
info:    Device : NVIDIA GeForce GTX 1650
info:    Driver : NVIDIA 550.67.0
info:  Enabled device extensions:
info:    VK_EXT_attachment_feedback_loop_layout
info:    VK_EXT_conservative_rasterization
info:    VK_EXT_custom_border_color
info:    VK_EXT_depth_bias_control
info:    VK_EXT_depth_clip_enable
info:    VK_EXT_extended_dynamic_state3
info:    VK_EXT_fragment_shader_interlock
info:    VK_EXT_graphics_pipeline_library
info:    VK_EXT_memory_priority
info:    VK_EXT_non_seamless_cube_map
info:    VK_EXT_robustness2
info:    VK_EXT_shader_module_identifier
info:    VK_EXT_swapchain_maintenance1
info:    VK_EXT_transform_feedback
info:    VK_EXT_vertex_attribute_divisor
info:    VK_KHR_maintenance5
info:    VK_KHR_pipeline_library
info:    VK_KHR_present_id
info:    VK_KHR_present_wait
info:    VK_KHR_swapchain
info:    VK_NVX_binary_import
info:    VK_NVX_image_view_handle
info:  Device features:
info:    robustBufferAccess                     : 1
info:    fullDrawIndexUint32                    : 1
info:    imageCubeArray                         : 1
info:    independentBlend                       : 1
info:    geometryShader                         : 1
info:    tessellationShader                     : 0
info:    sampleRateShading                      : 1
info:    dualSrcBlend                           : 0
info:    logicOp                                : 0
info:    multiDrawIndirect                      : 0
info:    drawIndirectFirstInstance              : 0
info:    depthClamp                             : 1
info:    depthBiasClamp                         : 1
info:    fillModeNonSolid                       : 1
info:    depthBounds                            : 1
info:    wideLines                              : 1
info:    multiViewport                          : 1
info:    samplerAnisotropy                      : 1
info:    textureCompressionBC                   : 1
info:    occlusionQueryPrecise                  : 1
info:    pipelineStatisticsQuery                : 1
info:    vertexPipelineStoresAndAtomics         : 1
info:    fragmentStoresAndAtomics               : 0
info:    shaderImageGatherExtended              : 0
info:    shaderClipDistance                     : 1
info:    shaderCullDistance                     : 1
info:    shaderFloat64                          : 0
info:    shaderInt64                            : 0
info:    variableMultisampleRate                : 1
info:    shaderResourceResidency                : 0
info:    shaderResourceMinLod                   : 0
info:    sparseBinding                          : 0
info:    sparseResidencyBuffer                  : 0
info:    sparseResidencyImage2D                 : 0
info:    sparseResidencyImage3D                 : 0
info:    sparseResidency2Samples                : 0
info:    sparseResidency4Samples                : 0
info:    sparseResidency8Samples                : 0
info:    sparseResidency16Samples               : 0
info:    sparseResidencyAliased                 : 0
info:  Vulkan 1.1
info:    shaderDrawParameters                   : 0
info:  Vulkan 1.2
info:    samplerMirrorClampToEdge               : 1
info:    drawIndirectCount                      : 1
info:    samplerFilterMinmax                    : 0
info:    hostQueryReset                         : 1
info:    timelineSemaphore                      : 1
info:    bufferDeviceAddress                    : 1
info:    shaderOutputViewportIndex              : 1
info:    shaderOutputLayer                      : 1
info:    vulkanMemoryModel                      : 1
info:  Vulkan 1.3
info:    robustImageAccess                      : 0
info:    pipelineCreationCacheControl           : 1
info:    shaderDemoteToHelperInvocation         : 1
info:    shaderZeroInitializeWorkgroupMemory    : 0
info:    synchronization2                       : 1
info:    dynamicRendering                       : 1
info:  VK_AMD_shader_fragment_mask
info:    extension supported                    : 0
info:  VK_EXT_attachment_feedback_loop_layout
info:    attachmentFeedbackLoopLayout           : 1
info:  VK_EXT_conservative_rasterization
info:    extension supported                    : 1
info:  VK_EXT_custom_border_color
info:    customBorderColors                     : 1
info:    customBorderColorWithoutFormat         : 1
info:  VK_EXT_depth_clip_enable
info:    depthClipEnable                        : 1
info:  VK_EXT_depth_bias_control
info:    depthBiasControl                       : 1
info:    leastRepresentableValueForceUnormRepresentation : 1
info:    floatRepresentation                    : 0
info:    depthBiasExact                         : 1
info:  VK_EXT_extended_dynamic_state3
info:    extDynamicState3AlphaToCoverageEnable  : 1
info:    extDynamicState3DepthClipEnable        : 1
info:    extDynamicState3RasterizationSamples   : 1
info:    extDynamicState3SampleMask             : 1
info:    extDynamicState3LineRasterizationMode  : 1
info:  VK_EXT_fragment_shader_interlock
info:    fragmentShaderSampleInterlock          : 0
info:    fragmentShaderPixelInterlock           : 0
info:  VK_EXT_full_screen_exclusive
info:    extension supported                    : 0
info:  VK_EXT_graphics_pipeline_library
info:    graphicsPipelineLibrary                : 1
info:  VK_EXT_line_rasterization
info:    rectangularLines                       : 1
info:    smoothLines                            : 1
info:  VK_EXT_memory_budget
info:    extension supported                    : 1
info:  VK_EXT_memory_priority
info:    memoryPriority                         : 1
info:  VK_EXT_non_seamless_cube_map
info:    nonSeamlessCubeMap                     : 1
info:  VK_EXT_robustness2
info:    robustBufferAccess2                    : 1
info:    robustImageAccess2                     : 1
info:    nullDescriptor                         : 1
info:  VK_EXT_shader_module_identifier
info:    shaderModuleIdentifier                 : 1
info:  VK_EXT_shader_stencil_export
info:    extension supported                    : 0
info:  VK_EXT_swapchain_colorspace
info:    extension supported                    : 0
info:  VK_EXT_swapchain_maintenance1
info:    swapchainMaintenance1                  : 1
info:  VK_EXT_hdr_metadata
info:    extension supported                    : 0
info:  VK_EXT_transform_feedback
info:    transformFeedback                      : 0
info:    geometryStreams                        : 0
info:  VK_EXT_vertex_attribute_divisor
info:    vertexAttributeInstanceRateDivisor     : 1
info:    vertexAttributeInstanceRateZeroDivisor : 1
info:  VK_KHR_external_memory_win32
info:    extension supported                    : 0
info:  VK_KHR_external_semaphore_win32
info:    extension supported                    : 0
info:  VK_KHR_maintenance5
info:    maintenance5                           : 1
info:  VK_KHR_present_id
info:    presentId                              : 1
info:  VK_KHR_present_wait
info:    presentWait                            : 1
info:  VK_NVX_binary_import
info:    extension supported                    : 1
info:  VK_NVX_image_view_handle
info:    extension supported                    : 1
info:  VK_KHR_win32_keyed_mutex
info:    extension supported                    : 0

Steps to reproduce

  1. Use Arch Linux with KDE 6
  2. Install TF2
  3. Launch the game
Carbolemons commented 6 months ago

Can re-create on Linux Mint.

First monitor shuts off and permanently is not available until re-start. Crashes immediately.

Same result regardless of launch flags

deergoduc commented 6 months ago

For me the log file seems to end prematurely, the last line being info: Queue families:. The size of the log is exactly 8192B.

Continued from the output of the game:

info:  Queue families:
info:    Graphics : 0
info:    Transfer : 1
info:    Sparse   : 0
warn:  DXVK: No state cache file found
info:  DXVK: Graphics pipeline libraries supported
info:  D3D9DeviceEx::ResetSwapChain:
info:    Requested Presentation Parameters
info:      - Width:              1920
info:      - Height:             1080
info:      - Format:             D3D9Format::A8R8G8B8
info:      - Auto Depth Stencil: true
info:                  ^ Format: D3D9Format::D24S8
info:      - Windowed:           false
info:      - Swap effect:        1
info:  Presenter: Actual swap chain properties:
info:    Format:       VK_FORMAT_B8G8R8A8_UNORM
info:    Color space:  VK_COLOR_SPACE_SRGB_NONLINEAR_KHR
info:    Present mode: VK_PRESENT_MODE_IMMEDIATE_KHR (dynamic: yes)
info:    Buffer size:  1920x1080
info:    Image count:  3
info:    Exclusive FS: 0
err:   SDL2 WSI: enterFullscreenMode: SDL_SetWindowFullscreen: X11_XRRSetCrtcConfig failed
err:   D3D9: EnterFullscreenMode: Failed to enter fullscreen mode
err:   D3D9: Failed to set initial fullscreen state
Thr33Tree commented 6 months ago

Can replicate this issue on Opensuse Tumbleweed. OpenGL works but vulkan blanks my secondary and crashes then a second start causes it to load indefinably requiring a tty to reboot

neilunger commented 6 months ago

I'm having a similar issue. On Pop!_OS 22.04, launching TF2 not only crashes the game, but also causes my primary monitor's configuration to switch from X screen 0 to disabled in Nvidia X Server settings, so the monitor is completely disabled. My secondary monitor stays enabled. Primary is a 1440p, 144hz monitor, and secondary is configured to be to the left of primary (with bottom edges aligned) at 1080p 60hz. Using X11/Xorg (not wayland) with an RTX 2070 Super. This is true after removing all launch options, as well as deleting my custom and cfg folders.

Using the -windowed -noborder launch options fixes those issues, but since Gnome's status bar stays, the bottom portion of TF2's window is cut off, so it isn't an ideal solution. Additionally, if I try to switch it back to fullscreen in TF2's in-game settings, I encounter the "primary monitor disabled" issue again.

Using -gl (or simply the "Legacy OpenGL" launch option) even with fullscreen seems to completely fix it. However, as that option seems like it will be depreciated in the future, that also isn't an ideal solution. It's at least a good temporary workaround for those reading this.

Edit: some clarification

Mistyttm commented 6 months ago

@neilunger temporary fix works for me, but as they said, this is not a good fix given that flag is marked for deprecation

As another note, I had the issue happen with both the play TF2 option and the legacy OpenGL option

bracketracket commented 6 months ago

Someone similar is happening to me, as the game will only launch in windowed mode. Strangely, if I set the game to fullscreen in the ingame settings menu after the fact it runs fine in fullscreen. This is on Debian 12 testing with AMDGPU 6.0.60000-1697589.22.04

gmBlahaj commented 6 months ago

Same thing happens on Gentoo with a rtx 3070 ti

felipsmartins commented 6 months ago

I can reproduce the same. Also, I can reproduce the workaround like @bracketracket in the same OS and GPU.

System Information ``` Computer Information: Manufacturer: ASUSTeK COMPUTER INC. Model: ROG STRIX B650-A GAMING WIFI Form Factor: Desktop No Touch Input Detected Processor Information: CPU Vendor: AuthenticAMD CPU Brand: AMD Ryzen 9 7900 12-Core Processor CPU Family: 0x19 CPU Model: 0x61 CPU Stepping: 0x2 CPU Type: 0x0 Speed: 5482 MHz 24 logical processors 12 physical processors Hyper-threading: Supported FCMOV: Supported SSE2: Supported SSE3: Supported SSSE3: Supported SSE4a: Supported SSE41: Supported SSE42: Supported AES: Supported AVX: Supported AVX2: Supported AVX512F: Supported AVX512PF: Unsupported AVX512ER: Unsupported AVX512CD: Supported AVX512VNNI: Supported SHA: Supported CMPXCHG16B: Supported LAHF/SAHF: Supported PrefetchW: Unsupported Operating System Version: Debian GNU/Linux 12 (bookworm) (64 bit) Kernel Name: Linux Kernel Version: 6.6.13+bpo-amd64 X Server Vendor: The X.Org Foundation X Server Release: 12101007 X Window Manager: GNOME Shell Steam Runtime Version: steam-runtime_0.20240304.79797 Video Card: Driver: AMD AMD Radeon Graphics (gfx1100, LLVM 15.0.6, DRM 3.54, 6.6.13+bpo-amd64) Driver Version: 4.6 (Compatibility Profile) Mesa 22.3.6 OpenGL Version: 4.6 Desktop Color Depth: 24 bits per pixel Monitor Refresh Rate: 143 Hz VendorID: 0x1002 DeviceID: 0x744c Revision Not Detected Number of Monitors: 3 Number of Logical Video Cards: 1 Primary Display Resolution: 1920 x 1080 Desktop Resolution: 5396 x 3240 Primary Display Size: 20.75" x 11.65" (23.78" diag), 52.7cm x 29.6cm (60.4cm diag) Primary VRAM: 20480 MB Sound card: Audio device: USB Mixer Memory: RAM: 31833 Mb VR Hardware: VR Headset: None detected Miscellaneous: UI Language: English LANG: en_US.UTF-8 Total Hard Disk Space Available: 936330 MB Largest Free Hard Disk Block: 55937 MB Storage: Number of SSDs: 7 SSD sizes: 4000G,4000G,1000G,1000G,1000G,480G,240G Number of HDDs: 0 Number of removable drives: 0 ```
neilunger commented 6 months ago

I'm still experiencing this issue on an up-to-date version of Pop!_OS 22.04 after TF2's April 22nd update. Some things I tried to get around the issue:

Still, when launching with Vulkan and zero launch arguments, the game would briefly launch, the game window would "jiggle" for a second or two (Counter Strike 2 also did this during the first week or so of its release), then TF2 will crash and disable my primary monitor. Only opening in Legacy OpenGL (or launching in Windowed mode) will get around these issues.

Steam Runtime Diagnostics attached: steam_runtime_diagnostics.txt

neilunger commented 6 months ago

Replying to https://github.com/ValveSoftware/Source-1-Games/issues/5704#issuecomment-2078546815

I've just discovered Vulkan fullscreen will finally work on my setup if I use the -freq 144 launch argument (since I'm using a 144hz monitor). I'd guess the issue is the game trying to change the monitor's refresh rate or something, and this gets around it. Oddly, the game will minimize itself shortly after launch, but that's the only issue I've seen so far after using -freq. Seems to be the best workaround so far

Bakeshop9358 commented 6 months ago

Replying to #5704 (comment)

Adding the -refresh argument works too, but in my case the game doesn't minimize, played a few hours without issue.

neilunger commented 6 months ago

Valve developer wiki says -refresh, -refreshrate, and -freq are all the same. As expected, they all minimize my game shortly after launch. And after further testing, sometimes my game will minimize on level transition too.

Unmoon commented 6 months ago

Replying to #5704 (comment)

I've just discovered Vulkan fullscreen will finally work on my setup if I use the -freq 144 launch argument (since I'm using a 144hz monitor). I'd guess the issue is the game trying to change the monitor's refresh rate or something, and this gets around it. Oddly, the game will minimize itself shortly after launch, but that's the only issue I've seen so far after using -freq. Seems to be the best workaround so far

Thanks, setting -freq 240 seemed to fix the odd lag that was caused by launching the game for me.

BloodyIron commented 5 months ago

Valve developer wiki says -refresh, -refreshrate, and -freq are all the same. As expected, they all minimize my game shortly after launch. And after further testing, sometimes my game will minimize on level transition too.

Why doesn't that page declare what the default value is for refresh? :s

HollowVin commented 5 months ago

Replying to #5704 (comment)

I've just discovered Vulkan fullscreen will finally work on my setup if I use the -freq 144 launch argument (since I'm using a 144hz monitor). I'd guess the issue is the game trying to change the monitor's refresh rate or something, and this gets around it. Oddly, the game will minimize itself shortly after launch, but that's the only issue I've seen so far after using -freq. Seems to be the best workaround so far

@neilunger Hi. I was having very similar issues to yours since I'm on Pop OS too. One of the things that fixed it for me at first was installing Steam's .deb instead of the Flatpak version on the Pop Shop. That fixed the issue of TF2 crashing (and freezing my whole computer in the process), but I was still having another issue where TF2 launching on fullscreen would set my display rate back to 60hz and I had to manually revert it in the OS's settings. Using -freq has fixed that issue now after reading your experience, even if my game minimizes on getting to the main menu as well.

Anyway, if you care to answer, are you on the Flatpak version of Steam? Or the .deb? Just wanna get an idea of what could be happening and whether we can cross-check our experiences.

BloodyIron commented 5 months ago

I'm having continual problems with TF2 having a band along the top. It seems to be fixed SOMETIMES by switching to windowed, back to full screen... often having to do it multiple times. Sometimes it doesn't happen and TF2 "just works" first time. Pretty sure this is a bug.

neilunger commented 5 months ago

Replying to #5704 (comment)

@HollowVin I'm using the Steam .deb

Zopolis4 commented 4 months ago

Forcing the Steam Linux Runtime 3.0 (sniper) option fixes it for me, although preloading libmimalloc.so would also probably work, havent tried yet.

Mistyttm commented 3 months ago

I've moved over to nixOS since having this issue and upgraded my system specs to use a NVIDIA RTX 3090 and a Ryzen 7800X3D. The issue persists

@neilunger your frequency fix has now fixed the issue for me, so I think your assumption about the game trying to set the frequency is correct. Its such strange behavior that was somehow missed in development as this seems to be a wide enough spread issue.

Rykita commented 3 months ago

Issue still persists. Using -freq 144 does work to fix it.

Distro: Arch Linux x64 Kernel: 6.10.2-zen GPU: RTX 2070 Super CPU: AMD Ryzen 5 3600 Driver Version: nvidia-dkms 555.58.02 DE: KDE Display Server: X11

Xrandr output attached below:

DP-0 connected primary 3440x1440+1920+0 (normal left inverted right x axis y axis) 1mm x 1mm
   3440x1440     75.05 + 143.92*  120.00    99.98  
   2560x1440    120.00    59.95  
   2048x1152     60.00  
   1920x1200     59.88  
   1920x1080    119.98   119.88    60.00    59.94    50.00  
   1720x1440     59.98  
   1680x1050     59.95  
   1600x1200     60.00  
   1600x900      60.00  
   1280x1024     75.02    60.02  
   1280x800      59.81  
   1280x720      59.94  
   1024x768      75.03    70.07    60.00  
   800x600       75.00    72.19    60.32    56.25  
   720x576       50.00  
   720x480       59.94  
   640x480       75.00    72.81    59.94    59.93  
DP-1 disconnected (normal left inverted right x axis y axis)
HDMI-0 connected 1920x1080+0+180 (normal left inverted right x axis y axis) 527mm x 296mm
   1920x1080     74.97*+  60.00    59.94    50.00  
   1680x1050     59.95  
   1440x900      59.89  
   1280x1024     60.02  
   1280x800      59.81  
   1280x720      60.00    59.94    50.00  
   1152x864      75.00  
   1024x768      70.07    60.00  
   800x600       60.32    56.25  
   720x576       50.00  
   720x480       59.94  
   640x480       59.94    59.93  
DP-2 disconnected (normal left inverted right x axis y axis)
DP-3 disconnected (normal left inverted right x axis y axis)
DP-4 disconnected (normal left inverted right x axis y axis)
DP-5 disconnected (normal left inverted right x axis y axis)
lilnarco commented 3 weeks ago

Crazy how long this has gone unpatched. -freq resolved the issue for me.