Skip to content

switch: opensource drivers without monitors should switch to internal #107

Open
@hertg

Description

@hertg

If /etc/X11/xorg.conf.d/99-egpu-switcher.conf exists:
Expected Behavior: Running sudo egpu-switcher switch auto in the above case of AMD eGPU connected with no displays removes the X11 conf file.
Actual Behavior: Running sudo egpu-switcher switch auto in the above case only prints an error, /etc/X11/xorg.conf.d/99-egpu-switcher.conf still exists.

I believe that at line 139 in

egpu-switcher/cmd/switch.go

Lines 137 to 153 in 13b8a06

logger.Warn("No eGPU attached display detected with open source drivers. (Of %d eGPU outputs detected) Internal mode and setting DRI_PRIME variable are recommended for this configuration.\n", outputs)
if !override {
return fmt.Errorf("Not setting eGPU mode. Run the command with the '--override' flag to force loading eGPU mode")
}
logger.Debug("-> Overridden: setting eGPU mode")
}
}
nomodesetting = nomodesetting || viper.GetBool("egpu.nomodesetting")
conf := xorg.RenderConf("Device0", driver, gpu.XorgPCIString(), !nomodesetting)
if err := xorg.CreateEgpuFile(x11ConfPath, conf, verbose); err != nil {
return err
}
if post := viper.GetString("hooks.egpu"); post != "" {
if err := runHook(post); err != nil {
logger.Error("egpu hook error: %s", err)
}
should also remove the eGPU file unless the --override is issued. Otherwise the behavior of the switching is inconsistent in this case, as it keeps the file if it previously existed, but doesn't create it if it doesn't exist.

Originally posted by @ewagner12 in #106 (comment)

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

Status

Planned

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions