ValveSoftware / csgo-osx-linux

Counter-Strike: Global Offensive
http://counter-strike.net
782 stars 69 forks source link

Assertion failure at SDL_GetDesktopDisplayMode_REAL #2669

Open emiladelen opened 3 years ago

emiladelen commented 3 years ago

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
kisak-valve commented 3 years ago

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?

emiladelen commented 3 years ago

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»

lixinou commented 3 years ago

Hi, did you find a solution?

emiladelen commented 3 years ago

Hi, did you find a solution?

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

MaharshSuryawala commented 3 years ago

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

rockstar-fak commented 3 years ago

@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

MaharshSuryawala commented 3 years ago

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

kisak-valve commented 3 years ago

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

icculus commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

(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.)

MaharshSuryawala commented 3 years ago

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.

icculus commented 3 years ago

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.

MaharshSuryawala commented 3 years ago

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.

icculus commented 3 years ago

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

kisak-valve commented 3 years ago

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.

icculus commented 3 years ago

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.)

TTimo commented 3 years ago

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.

icculus commented 3 years ago

Thanks, @TTimo!

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

rockstar-fak commented 3 years ago

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

icculus commented 3 years ago

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:

7k50 commented 3 years ago

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).

mfikre commented 3 years ago

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.

ajdinm commented 2 years ago

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.

dtolj commented 2 years ago

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

kisak-valve commented 2 years ago

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

siddharthghugharwal commented 2 years ago

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

mcaap commented 2 years ago

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!

jac0x commented 2 years ago

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

CryptoRhinoGH commented 2 years ago

@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.

mohammadFromIran commented 2 years ago

Replying to https://github.com/ValveSoftware/csgo-osx-linux/issues/2669#issue-808920481

hi everyone , i solved this problem open steam , go library, choose cs go (don't play),in the right of window click on setting , go properties , paste this code in launch option :" -w 800 -h 600 -refresh 60 " play the game and enjoy :)

rockstar-fak commented 2 years ago

Hello! Today I had to play with the screen of my Macbook, I found this solution, in my case it is the definitive one! https://steamcommunity.com/app/730/discussions/0/1727575977576349792/

jukrb0x commented 2 years ago

2021 m1 pro MacBook pro, same problem. but it looks playable but the assertion pop up with the app starts.

Moorviper commented 2 years ago

On the first start on a clean install just ignore it once. Then set the display to fullscreen oder window-fullscreen. After that it works perfect.

Lier0102 commented 2 years ago

hmm. I think that restarting one's own macbook is good solution.

kimbaswaggin commented 1 year ago

guys help i cant play csgo im on a 2021 Macbook pro i dont understand anything please some one help me it gives me the assertion failed thing i cant fix it pls someone help