Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CRIT skcraft runs only on integrated graphics (does not use gpu) #520

Open
Envel-Nikita-Gutsenkov opened this issue Oct 24, 2023 · 6 comments

Comments

@Envel-Nikita-Gutsenkov
Copy link

I haven't been able to figure out why skcraft doesn't use, say, rtx, but uses integrated intel graphics. There is no such problem in the official launcher. An unmodified version from the skcraft source code has been tested. Tested on various hardware.

@Envel-Nikita-Gutsenkov Envel-Nikita-Gutsenkov changed the title skcraft runs only on integrated graphics (does not use gpu) CRIT skcraft runs only on integrated graphics (does not use gpu) Oct 24, 2023
@hedgehog1029
Copy link
Member

Do you mean the launcher itself, or the game?

In #86 it seems the solution is running the game with javaw; my guess is that this initializes the graphics context earlier and the GPU switching software picks up on it. I can put in a patch to try this. But it's probably difficult to do much else; switchable graphics isn't a standard and doesn't have any standardized APIs, to my knowledge.

@Envel-Nikita-Gutsenkov
Copy link
Author

Envel-Nikita-Gutsenkov commented Oct 25, 2023

Do you mean the launcher itself, or the game?

In #86 it seems the solution is running the game with javaw; my guess is that this initializes the graphics context earlier and the GPU switching software picks up on it. I can put in a patch to try this. But it's probably difficult to do much else; switchable graphics isn't a standard and doesn't have any standardized APIs, to my knowledge.

I mean the game. Unfortunately, the problem is not in the java/javaw choice (I also tried java flags), and the code that is proposed in #86 is no longer available, so I can’t try it. The problem is observed only in skcraft :(
I tested on different hardware and in no case did it run on the GPU

@hedgehog1029
Copy link
Member

I imagine the diff was changing the following line in JavaProcessBuilder to invoke javaw instead:

File javaBinary = new File(getJavaBinPath(), "java");

But yeah I can't confirm this is a solution. Can you also provide the following details for each affected system:

  • Operating system
  • Model of the Integrated GPU
  • Model of the Dedicated GPU

I have a laptop with switchable graphics myself (Linux, intel + nvidia) so I'll be able to do some Linux-specific debugging at least.

@Envel-Nikita-Gutsenkov
Copy link
Author

I imagine the diff was changing the following line in JavaProcessBuilder to invoke javaw instead:

File javaBinary = new File(getJavaBinPath(), "java");

But yeah I can't confirm this is a solution. Can you also provide the following details for each affected system:

  • Operating system
  • Model of the Integrated GPU
  • Model of the Dedicated GPU

I have a laptop with switchable graphics myself (Linux, intel + nvidia) so I'll be able to do some Linux-specific debugging at least.

It was all so simple, but I didn’t realize it :D Thank you very much!
The problem is solved by replacing it with File javaBinary = new File(getJavaBinPath(), "javaw");

@Envel-Nikita-Gutsenkov
Copy link
Author

Envel-Nikita-Gutsenkov commented Oct 25, 2023

Although I think this should be fixed in this skcraft repository?

@hedgehog1029
Copy link
Member

Yeah I'll apply this change here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants