csgo-osx-linux icon indicating copy to clipboard operation
csgo-osx-linux copied to clipboard

Assertion failure at SDL_GetDesktopDisplayMode_REAL

Open emiladelen opened this issue 4 years ago • 34 comments

  • System information from steam in a gist
  • Have you checked for system updates?: Yes

When I try to start CS:GO I get an error message:

Assertion Failure at SDL_GetDesktopDisplayMode_REAL (/Users/buildbot/buildslave/sdl_osx/build/dev/src/video/SDL_video.c:869), triggered 1 time: 'displayIndex < = 0 && displayIndex < _this->num_displays'

I have tried reinstalling Steam and the game, restoring the entire Mac OS Big Sur operating system and even trying to run the game on Mac OS Catalina. This has never happened before and the problem arose after the last update of the CS:GO game. The problem exists for at least 3 weeks.

Steps for reproducing this issue:

  1. Open Steam
  2. Download Counter-Strike Global Offensive
  3. Run

emiladelen avatar Feb 16 '21 01:02 emiladelen

Hello @emiladelen, this assertion has been seen before in #1601. Can you check if you have CS:GO installed on a case-sensitive filesystem like that issue report?

kisak-valve avatar Feb 16 '21 02:02 kisak-valve

Hello @emiladelen, this assertion has been seen before in #1601. Can you check if you have CS:GO installed on a case-sensitive filesystem like that issue report?

@kisak-valve, my file system was APFS (a default one) and I got the mentioned error. I tried to reinstall everything on a case-insensitive volume and now I get another error.

«Steam requires that ‘/Users/emil/Library/Application Support/Steam/Steam.Appbundle/Steam/Contents/MacOS’ be on a case-insensitive file system»

emiladelen avatar Feb 17 '21 20:02 emiladelen

Hi, did you find a solution?

lixinou avatar Feb 21 '21 17:02 lixinou

Hi, did you find a solution?

Unfortunately not. Tested everything, still can’t play.

emiladelen avatar Feb 21 '21 21:02 emiladelen

Hi @emiladelen. I am facing the same issue. Did you find a solution?

MaharshSuryawala avatar Mar 07 '21 08:03 MaharshSuryawala

@MaharshSuryawala hi y saw a video and could play You must connect another screen, like a tv or something. The problem is a display bug on Macbook Check this, It was so helpfull, I did not think about playin with an SSD https://www.youtube.com/watch?v=bmuFl-SlV20

rockstar-fak avatar Mar 07 '21 10:03 rockstar-fak

@rockstar-fak Thanks! This was helpful. The game launches fine when I connect another screen.

MaharshSuryawala avatar Mar 07 '21 17:03 MaharshSuryawala

Adding an SDL dev in case this is of interest to them.

kisak-valve avatar Mar 07 '21 17:03 kisak-valve

Just to be clear: this is failing on a MacBook that just has it's default MacBook screen, with no other screens attached, right? I'll try to reproduce it over here.

icculus avatar Mar 08 '21 16:03 icculus

Actually, before I reproduce this: @kisak-valve, the assertion in SDL is this:

SDL_assert(displayIndex >= 0 && displayIndex < _this->num_displays);

Which is from here.

But the error message in this report says

displayIndex < = 0 && displayIndex < _this->num_displays

(It has "<=" instead of ">=")

Can someone at Valve go check the SDL sources that CS:Go uses and just sanity check that character didn't get flipped somehow? Maybe something wild happened and converting the bug report to HTML used &lt; instead of &gt; and this isn't the problem, but that's probably why the assertion is failing otherwise.

icculus avatar Mar 08 '21 16:03 icculus

(Also, release builds of the game should probably disable assertions, and it's possible this is only happening on the Mac because SDL is accidentally built with assertions enabled on that platform? It's possible assertions are intentionally left in release builds, though, so I don't know for sure.)

icculus avatar Mar 08 '21 16:03 icculus

Just to be clear: this is failing on a MacBook that just has it's default MacBook screen, with no other screens attached, right? I'll try to reproduce it over here.

@icculus Yes, the launch fails on a MacBook. I even tried setting the launch options through steam "-w 800 -h 600." Unfortunately, that doesn't work too. If I connect an external screen, the game launches just fine on either of the screens. On the other hand, everything works just fine on my Windows machine.

MaharshSuryawala avatar Mar 08 '21 17:03 MaharshSuryawala

Also, I don't know if CS:GO replaces SDL's error message box with its own, which SDL allows, but: is there an "ignore" button on the message box? If so, click that and see if the game otherwise works.

If there isn't a button for that, and you're comfortable with the Terminal, you can try launching the game with this environment variable set...

SDL_ASSERT=always_ignore

...which tells SDL not to pop up a message box at all and just try to keep going...and see if that bypasses the problem. Sometimes this works, sometimes you just have a different disastrous crash right afterwards.

Otherwise, we'll wait to see what Valve says.

icculus avatar Mar 09 '21 04:03 icculus

Also, I don't know if CS:GO replaces SDL's error message box with its own, which SDL allows, but: is there an "ignore" button on the message box? If so, click that and see if the game otherwise works.

If there isn't a button for that, and you're comfortable with the Terminal, you can try launching the game with this environment variable set...

SDL_ASSERT=always_ignore

...which tells SDL not to pop up a message box at all and just try to keep going...and see if that bypasses the problem. Sometimes this works, sometimes you just have a different disastrous crash right afterwards.

Otherwise, we'll wait to see what Valve says.

@icculus There were the following options on the box -> "Retry", "Break", "Abort", "Always Ignore", and "Ignore." Hitting the break button worked for me. I am not getting the error message. However, still cannot play without the external screen. If I try to launch the game on the default Mac display, it crashes.

MaharshSuryawala avatar Mar 09 '21 15:03 MaharshSuryawala

Okay, I'm going to poke at this today while waiting to hear back from @kisak-valve

icculus avatar Mar 09 '21 15:03 icculus

Friendly reminder that I'm a moderator for Valve's issue trackers, and not a Valve dev myself. Unfortunately, I don't have access to check into the SDL code bundled with the game.

kisak-valve avatar Mar 09 '21 15:03 kisak-valve

Friendly reminder that I'm a moderator for Valve's issue trackers, and not a Valve dev myself. Unfortunately, I don't have access to check into the SDL code bundled with the game.

Whoops, my bad, I didn't know that! I'll follow up internally.

(I did reproduce this here on an Intel MacBook running Big Sur. Fwiw, clicking "Always Ignore" got me to the "Operation Broken Fang" intro movie, but then it seemed to hang. In any case, this definitely is a legit bug that needs to be fixed, so I'll follow up and report back.)

icculus avatar Mar 09 '21 16:03 icculus

Hey Ryan,

The code correctly states SDL_assert(displayIndex >= 0 && displayIndex < _this->num_displays); and hasn't changed for a long time. I think the copy paste from OP is just incorrect here.

TTimo avatar Mar 09 '21 18:03 TTimo

Thanks, @TTimo!

I'm digging into this on the SDL side, hopefully today, and will report back with what I see. :)

icculus avatar Mar 09 '21 19:03 icculus

Thanks @TTimo ! Please tell us if you could solve it, I really would like to play CS:GO only with my MacBook. Maybe this can help https://support.steampowered.com/kb_article.php?p_faqid=772

rockstar-fak avatar Mar 10 '21 14:03 rockstar-fak

To follow up: this is on a Valve employee's radar now, but I don't have a timeline for when it will be fixed or when that fix will be public. I'm an outsider to this process as well.

IN THE MEANTIME, to mitigate this on your end, either:

  • Add sdl_displayindex "0" to the game's config file (which tells CS:GO to use the primary display; on the Mac, that means the screen with the Dock, even if it's an external display and not the MacBook's built-in screen. You can try 1 for a secondary display, 2 for a third, etc). I think if you stumble into the game's video settings, it'll write this out to the config on your behalf (at least, I somehow got the game into a state where it stopped popping up the error at some point, and I think this was why).
  • Just click "Always ignore" in the error dialog when it pops up. You'll have to do this every time you start the game until Valve pushes a fix, but I think it's harmless otherwise. If this causes other problems, the config file fix will definitely remove the problem entirely.

icculus avatar Mar 11 '21 18:03 icculus

To follow up: this is on a Valve employee's radar now, but I don't have a timeline for when it will be fixed or when that fix will be public. I'm an outsider to this process as well.

IN THE MEANTIME, to mitigate this on your end, either:

  • Add sdl_displayindex "0" to the game's config file (which tells CS:GO to use the primary display; on the Mac, that means the screen with the Dock, even if it's an external display and not the MacBook's built-in screen. You can try 1 for a secondary display, 2 for a third, etc). I think if you stumble into the game's video settings, it'll write this out to the config on your behalf (at least, I somehow got the game into a state where it stopped popping up the error at some point, and I think this was why).
  • Just click "Always ignore" in the error dialog when it pops up. You'll have to do this every time you start the game until Valve pushes a fix, but I think it's harmless otherwise. If this causes other problems, the config file fix will definitely remove the problem entirely.

Sorry, but where is this config file located on the Mac drive? In ~/Library/Application Support/Steam/steamapps/common/Counter-Strike Global Offensive/csgo/cfg, I don't see either config.cfg or autoexec.cfg (just installed the game for the first time).

7k50 avatar May 14 '21 16:05 7k50

I was getting the same displayIndex pop-up error when launching CSGO on Big Sur.

Above recommendation to attach an external monitor works - CSGO loads ok with monitor attached.

Another simpler solution is to ensure Preferences -> Display -> Display Tab -> Resolution is set to "Default for display".

Mine was initially set to "Scaled" which I think confused Valve. CSGO loads fine now.

mfikre avatar Sep 15 '21 08:09 mfikre

I had the same issue, and none of the fixes suggested here worked for me. However, running "Verify files integrity" showed that 3 files needed to be reacquired, and after that my game run. The only other change I have is having -autoconfig flag in launch options.

ajdinm avatar Dec 10 '21 10:12 ajdinm

I saw this error for the first time today. I tried the following with no luck. The game runs but the player skin is messed up. Did a clean uninstall/reinstall verify integrity always shows 1 file failed to validate deleted folder under userdata

using Mac os Catalina Screen Shot 2021-12-12 at 7 59 42 PM

dtolj avatar Dec 13 '21 01:12 dtolj

Hello @dtolj, your screenshot is the issue being tracked at #2871 and is unrelated to this issue report.

kisak-valve avatar Dec 13 '21 01:12 kisak-valve

Its an issue with usb accessory adapter remove all the accessory or any connected device run the game and now you can reattach any usb device accessory/peripheral you want/need.

Thanks GG

siddharthghugharwal avatar Dec 15 '21 16:12 siddharthghugharwal

I verified files integrity. Not sure if this was the reason. But my solution was to hover the mouse few pixels BELOW the actual Close button (and you can see the Close button highlighted). Click below that highlight (below the close button) and it worked!

mcaap avatar Jan 01 '22 17:01 mcaap

Verifying local files in the Properties dialog fixed the Assertion failure for me.

jac0x avatar Jan 23 '22 15:01 jac0x

@kisak-valve Thanks to you, I combined 2 of yours and 1 of @rockstar-fak's solutions which makes it run perfectly on my mac. FYI, I have the latest Macbook pro (2021) running 12.1, the latest OS at the time. Solution for me: Open Terminal Type SDL_ASSERT=always_ignore Find the CSGO installation location. Probably in /Users/{your_username}/Library/Application\ Support/Steam/steamapps/common/Counter-Strike\ Global\ Offensive/csgo.sh Type the whole location or navigate to the file csgo.sh Finally, type in /FULL/PATH/TO/csgo.sh -nojoy -h 600 -w 800 And voila, it should start up and you should be able to interact. Finally, don't forget, go into settings and change the resolution as you see fit.

EDIT: Now this didn't allow me to play online, but I entered the options -h 600 -w 800 from steam > properties > startup command, restarted steam and ran the command open steam://run/730 and it started working perfectly for online too.

CryptoRhinoGH avatar Jan 29 '22 07:01 CryptoRhinoGH