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

Update Subnautica (use latest Wine devel version, disable nvapi workaround, set environment variables) #1197

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

Zemogiter
Copy link
Contributor

@Zemogiter Zemogiter commented Jan 10, 2020

Description

Tried playing this game today. It crashed with standard "Subnautica.exe stoped working" error. before displaying anything. Tried disabling any mods and QModManager. Still crashes. Reinstalling verbs via winetricks. Still crashes. Changing wine version from 4.0.3 to 5.0-rc3 finally did the trick.

What works

Game installation, starting the game, gameplay itself

What was not tested

Gameplay, will have some time after weekend to see if changes to the script affect the game in any negative wayNothing

Test

  • Operating system (and linux kernel version): Ubuntu 19.10
  • Hardware (GPU/CPU): GTX 1080 ti, i7-7700K

Ready for review

  • Script tested as a regular phoenicis user and working (if you have a problem -> create as draft and ask for help).
  • json-align and eslint run according to the documentation.
  • Codacy and travis checked.

@Zemogiter
Copy link
Contributor Author

Ready for review.

)
);
})
.gameOverlay(false);
.gameOverlay(false)
.environment('{"DXVK_CONFIG_FILE": "dxvkConfigFile", "STAGING_SHARED_MEMORY": "0", "WINEESYNC": "1"}')
Copy link
Contributor

@ImperatorS79 ImperatorS79 Jan 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will simply put the string dxvkConfigFile in the environment variable. Even with the right syntax, there is no dxvkConfigFile variable defined. The variable is only present in the lambda function code you pass to .postInstall. This will not work.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I change it to wine.prefixDirectory() + "/drive_c/dxvk.conf"?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You cannot access wine is .environment since it is not defined. The best would be to modify .environment() function to get a lambda (wine) => {} so that .environment could call that lambda by sending it the wine object and get the string for the environment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Like this?

    environment(environment) {
        this._environment = environment;
        lambda(wine) => {};
        return this;
    }

Copy link
Contributor

@ImperatorS79 ImperatorS79 Jan 13, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something like this:

 environment(environmentFunc) {
        this._environment = environmentFunc(this.wine());
        return this;
    }

and you would call it like this

.environtment((wine) => {
    //do things to obtain the jsonString
    return jsonString;
})

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK now I get this error:

Error: The argument of environment() should be a function !
	at <js> environment(Unnamed:139:3777-3845)
	at <js> :program(Unnamed:14-45:689-1859)
	at org.graalvm.polyglot.Context.eval(Context.java:370)
	at org.phoenicis.scripts.engine.implementation.PolyglotScriptEngine.evalAndReturn(PolyglotScriptEngine.java:73)
	at org.phoenicis.scripts.session.PhoenicisInteractiveScriptSession.eval(PhoenicisInteractiveScriptSession.java:35)
	at 
org.phoenicis.scripts.interpreter.BackgroundScriptInterpreter.lambda$createInteractiveSession$1(BackgroundScriptInterpreter.java:45)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
[ERROR] org.phoenicis.multithreading.ControlledThreadPoolExecutorService (l.64) - java.lang.ClassCastException: class java.lang.String cannot be cast to class org.graalvm.polyglot.Value (java.lang.String is in module java.base of loader 'bootstrap'; org.graalvm.polyglot.Value is in unnamed module of loader java.net.URLClassLoader @76c548f)
	at org.phoenicis.javafx.components.application.skin.ApplicationInformationPanelSkin.lambda$installScript$7(ApplicationInformationPanelSkin.java:235)
	at org.phoenicis.scripts.session.PhoenicisInteractiveScriptSession.eval(PhoenicisInteractiveScriptSession.java:35)
	at org.phoenicis.scripts.interpreter.BackgroundScriptInterpreter.lambda$createInteractiveSession$1(BackgroundScriptInterpreter.java:45)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)

[WARNING] 
java.lang.ClassCastException: class java.lang.String cannot be cast to class org.graalvm.polyglot.Value (java.lang.String is in module java.base of loader 'bootstrap'; org.graalvm.polyglot.Value is in unnamed module of loader java.net.URLClassLoader @76c548f)
    at org.phoenicis.javafx.components.application.skin.ApplicationInformationPanelSkin.lambda$installScript$7 (ApplicationInformationPanelSkin.java:235)
    at org.phoenicis.scripts.session.PhoenicisInteractiveScriptSession.eval (PhoenicisInteractiveScriptSession.java:35)
    at org.phoenicis.scripts.interpreter.BackgroundScriptInterpreter.lambda$createInteractiveSession$1 (BackgroundScriptInterpreter.java:45)
    at java.util.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor.java:1128)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run (ThreadPoolExecutor.java:628)
    at java.lang.Thread.run (Thread.java:834)
Error: The argument of environment() should be a function !
	at <js> environment(Unnamed:139:3777-3845)
	at <js> :program(Unnamed:14-45:689-1859)
	at org.graalvm.polyglot.Context.eval(Context.java:370)
	at org.phoenicis.scripts.engine.implementation.PolyglotScriptEngine.evalAndReturn(PolyglotScriptEngine.java:73)
	at org.phoenicis.scripts.session.PhoenicisInteractiveScriptSession.eval(PhoenicisInteractiveScriptSession.java:35)
	at org.phoenicis.scripts.interpreter.BackgroundScriptInterpreter.lambda$createInteractiveSession$1(BackgroundScriptInterpreter.java:45)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the argument of environment in your script ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ImperatorS79 '{"DXVK_CONFIG_FILE": "dxvkConfigFile", "STAGING_SHARED_MEMORY": "0", "WINEESYNC": "1"}'

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be:

.environment((wine) => {
    const dxvkConfigFile = wine.prefixDirectory() + "/drive_c/dxvk.conf";

    return  '{"DXVK_CONFIG_FILE": "${dxvkConfigFile}", "STAGING_SHARED_MEMORY": "0", "WINEESYNC": "1"}';
})

or something like this for the template string.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's done but wine.log still shows info: DXGI: NvAPI workaround enabled, reporting AMD GPU

@plata plata changed the title Update Subnautica, using latest dev Wine version, disabling nvapi workaround, introduce environment values Update Subnautica (use latest Wine devel version, disable nvapi workaround, set environment variables) Jan 13, 2020
Added a proper variable reading in environment
@ImperatorS79
Copy link
Contributor

@Zemogiter You should do a PR about the environment modification first. (Because it will be needed to modify each QuickScript + each script using environment)

@Zemogiter
Copy link
Contributor Author

@Zemogiter You should do a PR about the environment modification first. (Because it will be needed to modify each QuickScript + each script using environment)

I know.

@Zemogiter
Copy link
Contributor Author

Blocked until #1198 is merged.

@PhoenicisOrg PhoenicisOrg deleted a comment from Zemogiter Feb 15, 2020
Using proper json format
.gameOverlay(false);
.gameOverlay(false)
.environment((wine) => {
const dxvkConfigFile = wine.prefixDirectory() + "/drive_c/dxvk.conf";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Zemogiter
Copy link
Contributor Author

I'm receiving the same error as in #1119 (comment)

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

Successfully merging this pull request may close these issues.

3 participants