Skip to content

Instantly share code, notes, and snippets.

@yamatt
Created April 14, 2025 20:20
Show Gist options
  • Save yamatt/26afd53652245256de050b538587293b to your computer and use it in GitHub Desktop.
Save yamatt/26afd53652245256de050b538587293b to your computer and use it in GitHub Desktop.
optimus troubleshooting

Troubleshooting

Discrete card will not switch off

On some secondary GPUs they report that they have the VGA port enabled. This has been seen on the GeForce GT 520M.

Symptoms include higher drain on the battery, fans constantly running, Xorg attempting to treat the discrete card as a secondary monitor.

This issue can be detected by opening a console and typing xrandr:

[root@localhost ~]# xrandr
Screen 0: minimum 8 x 8, current 2390 x 768, maximum 32767 x 32767
LVDS1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 293mm x 164mm
   1366x768      60.02*+
   1024x768      60.00  
   800x600       60.32    56.25  
   640x480       59.94  
DP1 disconnected (normal left inverted right x axis y axis)
HDMI1 disconnected (normal left inverted right x axis y axis)
VGA1 disconnected (normal left inverted right x axis y axis)
VIRTUAL1 disconnected (normal left inverted right x axis y axis)
VGA-1-2 connected 1024x768+1366+0 (normal left inverted right x axis y axis) 0mm x 0mm
   1024x768      60.00*
   800x600       60.32    56.25  
   848x480       60.00  
   640x480       59.94  
  1024x768 (0x63) 65.000MHz
        h: width  1024 start 1048 end 1184 total 1344 skew    0 clock  48.36KHz
        v: height  768 start  771 end  777 total  806           clock  60.00Hz
  800x600 (0x64) 40.000MHz
        h: width   800 start  840 end  968 total 1056 skew    0 clock  37.88KHz
        v: height  600 start  601 end  605 total  628           clock  60.32Hz
  800x600 (0x65) 36.000MHz
        h: width   800 start  824 end  896 total 1024 skew    0 clock  35.16KHz
        v: height  600 start  601 end  603 total  625           clock  56.25Hz

In this instance you can see there is an LVDS1 device which is your normal screen and GPU. We also have a VGA1 which is the VGA port on the laptop, and VGA-1-2. This is the VGA port that the discrete GPU is reporting it has.

To get your machine working to it's optimum we need to disable that VGA1-2 port. This has to be accomplished by setting video=VGA-2:d as a kernel flag.

This can be done manually in grub at boot time (press e) or made perminent by appending to the line GRUB_CMDLINE_LINUX in the /etc/default/grub file and updating your grub config.

Be aware that in some instances this could mean your external VGA port may no-longer work. This is because it is possible that the discrete GPU is connected directly to your VGA port on your laptop or used as a pass through.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment