Disable Intel GPU and activate Nvidia GPU

Hello,

i brought an old Lenovo T540p Thinkpad. Everything works good with Garuda so far. But when I start games, it utilizes the inbuild Graphic chip from the i7. I would like to run the system on the nVidia chip. Could someone give me an Idea how to disable the INTEL GPU?
Garuda-Inxi:

Graphics:
Device-1: Intel 4th Gen Core Processor Integrated Graphics vendor: Lenovo
driver: i915 v: kernel arch: Gen-7.5 process: Intel 22nm built: 2013 ports:
active: eDP-1 empty: DP-1, DP-2, HDMI-A-1, HDMI-A-2, VGA-1 bus-ID: 00:02.0
chip-ID: 8086:0416 class-ID: 0300

Device-2: NVIDIA GK208M [GeForce GT 730M] vendor: Lenovo driver: N/A
alternate: nouveau, nvidia_drm, nvidia non-free: series: 470.xx+
status: legacy-active (EOL~2023/24) arch: Kepler code: GKxxx
process: TSMC 28nm built: 2012-18 pcie: gen: 1 speed: 2.5 GT/s lanes: 8
link-max: gen: 3 speed: 8 GT/s bus-ID: 01:00.0 chip-ID: 10de:1290
class-ID: 0300

Thank you guys!

Please go through the wiki atleast once it clearly explains how to offload a program to your nvidia GPU.

The reason we don't recommend always using your dedicated GPU is that nvidia cards are known to often cause issues with linux. There is a reason linux community hates nvidia. If you don't wanna someday suddenly boot up to blank screens bcoz of nvidia driver issue it's best to use your integrated graphics card for normal tasks and offload graphics heavy tasks like games to nvidia.

You can view your nvidia card usage and the processes running on it with

nvidia-smi

in terminal. It will output something like this when no processes are running on it

nvidia-smi output
Sat Jul 22 23:41:47 2023       
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 535.86.05              Driver Version: 535.86.05    CUDA Version: 12.2     |
|-----------------------------------------+----------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |         Memory-Usage | GPU-Util  Compute M. |
|                                         |                      |               MIG M. |
|=========================================+======================+======================|
|   0  NVIDIA GeForce MX330           Off | 00000000:01:00.0 Off |                  N/A |
| N/A   48C    P8              N/A / ERR! |      4MiB /  2048MiB |      0%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
                                                                                         
+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|    0   N/A  N/A       812      G   /usr/lib/Xorg                                 4MiB |
+---------------------------------------------------------------------------------------+

PS: In future please post full output of garuda-inxi even if you think it's not necessary.

4 Likes

I just noticed but why have you blacklisted nvidia drivers as well? I understand that nouveau and nvidia_drm are blacklisted by default otherwise they will conflict with nvidia but why have you blacklisted nvidia? unless there is a specific reason please un-blacklist it so that prime offloading works.

1 Like

Maybe not blacklisted–quite likely just the incorrect drivers have been installed.

This is right, there is a lot of missing information here. Please post the rest of the output. Please also identify the driver you installed, and explain your process for installing it.

3 Likes

Hi,
thank you both for the answers. I have tried a lot internet tutorials before I posted here, some of them only means: Take this endless long console command and execute it, than this, than this.. and so on. So I cannot be entirely sure that there wasnt a "disable nvidia" command. Simply because the fact, that I dont know how such a command look like, so I wouldn´t know if I see it.

Here is your Inxi:

╰─λ garuda-inxi
System:
Kernel: 6.4.6-zen1-1-zen arch: x86_64 bits: 64 compiler: gcc v: 13.1.1
parameters: BOOT_IMAGE=/@/boot/vmlinuz-linux-zen
root=UUID=38d11f49-afe0-4b6b-953b-9addc52154a9 rw rootflags=subvol=@
rd.udev.log_priority=3 vt.global_cursor_default=0
resume=UUID=6d7a35cf-7ffb-4292-914c-96f115fef57f loglevel=3 quiet ibt=off
Desktop: KDE Plasma v: 5.27.6 tk: Qt v: 5.15.10 info: latte-dock
wm: kwin_x11 vt: 2 dm: SDDM Distro: Garuda Linux base: Arch Linux
Machine:
Type: Laptop System: LENOVO product: 20BFS12K00 v: ThinkPad T540p
serial: <superuser required> Chassis: type: 10 serial: <superuser required>
Mobo: LENOVO model: 20BFS12K00 serial: <superuser required> UEFI: LENOVO
v: GMET59WW (2.07 ) date: 02/12/2014
Battery:
ID-1: BAT0 charge: 98.9 Wh (97.1%) condition: 101.9/99.5 Wh (102.4%)
volts: 12.1 min: 10.8 model: SANYO 45N1779 type: Li-ion serial: <filter>
status: not charging
CPU:
Info: model: Intel Core i7-4710MQ bits: 64 type: MT MCP arch: Haswell
gen: core 4 level: v3 note: check built: 2013-15 process: Intel 22nm
family: 6 model-id: 0x3C (60) stepping: 3 microcode: 0x28
Topology: cpus: 1x cores: 4 tpc: 2 threads: 8 smt: enabled cache:
L1: 256 KiB desc: d-4x32 KiB; i-4x32 KiB L2: 1024 KiB desc: 4x256 KiB
L3: 6 MiB desc: 1x6 MiB
Speed (MHz): avg: 3122 high: 3500 min/max: 800/3500 scaling:
driver: intel_cpufreq governor: performance cores: 1: 3500 2: 3500 3: 2494
4: 2495 5: 3500 6: 3500 7: 2494 8: 3500 bogomips: 39908
Flags: avx avx2 ht lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx
Vulnerabilities: <filter>
Graphics:
Device-1: Intel 4th Gen Core Processor Integrated Graphics vendor: Lenovo
driver: i915 v: kernel arch: Gen-7.5 process: Intel 22nm built: 2013 ports:
active: eDP-1 empty: DP-1, DP-2, HDMI-A-1, HDMI-A-2, VGA-1 bus-ID: 00:02.0
chip-ID: 8086:0416 class-ID: 0300
Device-2: NVIDIA GK208M [GeForce GT 730M] vendor: Lenovo driver: N/A
alternate: nouveau, nvidia_drm, nvidia non-free: series: 470.xx+
status: legacy-active (EOL~2023/24) arch: Kepler code: GKxxx
process: TSMC 28nm built: 2012-18 pcie: gen: 1 speed: 2.5 GT/s lanes: 8
link-max: gen: 3 speed: 8 GT/s bus-ID: 01:00.0 chip-ID: 10de:1290
class-ID: 0300
Device-3: Lite-On Integrated Camera driver: uvcvideo type: USB rev: 2.0
speed: 480 Mb/s lanes: 1 mode: 2.0 bus-ID: 3-12:6 chip-ID: 04ca:7035
class-ID: 0e02
Display: x11 server: X.Org v: 21.1.8 with: Xwayland v: 23.1.2
compositor: kwin_x11 driver: X: loaded: modesetting
alternate: fbdev,intel,vesa dri: crocus gpu: i915 display-ID: :0
screens: 1
Screen-1: 0 s-res: 1920x1080 s-dpi: 96 s-size: 508x285mm (20.00x11.22")
s-diag: 582mm (22.93")
Monitor-1: eDP-1 model: AU Optronics 0x34ed built: 2012 res: 1920x1080
hz: 60 dpi: 142 gamma: 1.2 size: 344x193mm (13.54x7.6") diag: 394mm (15.5")
ratio: 16:9 modes: 1920x1080
API: OpenGL v: 4.6 Mesa 23.1.4 renderer: Mesa Intel HD Graphics 4600 (HSW
GT2) direct-render: Yes
Audio:
Device-1: Intel Xeon E3-1200 v3/4th Gen Core Processor HD Audio
vendor: Lenovo driver: snd_hda_intel v: kernel bus-ID: 00:03.0
chip-ID: 8086:0c0c class-ID: 0403
Device-2: Intel 8 Series/C220 Series High Definition Audio
vendor: Lenovo 8 driver: snd_hda_intel v: kernel bus-ID: 00:1b.0
chip-ID: 8086:8c20 class-ID: 0403
API: ALSA v: k6.4.6-zen1-1-zen status: kernel-api with: aoss
type: oss-emulator tools: N/A
Server-1: PipeWire v: 0.3.75 status: active with: 1: pipewire-pulse
status: active 2: wireplumber status: active 3: pipewire-alsa type: plugin
4: pw-jack type: plugin tools: pactl,pw-cat,pw-cli,wpctl
Network:
Device-1: Intel Ethernet I217-LM vendor: Lenovo driver: e1000e v: kernel
port: 5080 bus-ID: 00:19.0 chip-ID: 8086:153a class-ID: 0200
IF: enp0s25 state: down mac: <filter>
Device-2: Intel Centrino Advanced-N 6235 driver: iwlwifi v: kernel pcie:
gen: 1 speed: 2.5 GT/s lanes: 1 bus-ID: 04:00.0 chip-ID: 8086:088f
class-ID: 0280
IF: wlp4s0 state: up mac: <filter>
IF-ID-1: wwp0s20u10 state: down mac: <filter>
Bluetooth:
Device-1: Intel Centrino Bluetooth Wireless Transceiver driver: btusb v: 0.8
type: USB rev: 2.0 speed: 12 Mb/s lanes: 1 mode: 1.1 bus-ID: 3-11:5
chip-ID: 8087:07da class-ID: e001
Report: bt-adapter ID: hci0 rfk-id: 3 state: up address: <filter>
Drives:
Local Storage: total: 698.64 GiB used: 80.49 GiB (11.5%)
SMART Message: Unable to run smartctl. Root privileges required.
ID-1: /dev/sda maj-min: 8:0 vendor: Hitachi model: HTS541075A9E680
size: 698.64 GiB block-size: physical: 4096 B logical: 512 B speed: 3.0 Gb/s
tech: HDD rpm: 5400 serial: <filter> fw-rev: B480 scheme: GPT
Partition:
ID-1: / raw-size: 681.23 GiB size: 681.23 GiB (100.00%)
used: 80.49 GiB (11.8%) fs: btrfs dev: /dev/sda2 maj-min: 8:2
ID-2: /boot/efi raw-size: 300 MiB size: 299.4 MiB (99.80%)
used: 576 KiB (0.2%) fs: vfat dev: /dev/sda1 maj-min: 8:1
ID-3: /home raw-size: 681.23 GiB size: 681.23 GiB (100.00%)
used: 80.49 GiB (11.8%) fs: btrfs dev: /dev/sda2 maj-min: 8:2
ID-4: /var/log raw-size: 681.23 GiB size: 681.23 GiB (100.00%)
used: 80.49 GiB (11.8%) fs: btrfs dev: /dev/sda2 maj-min: 8:2
ID-5: /var/tmp raw-size: 681.23 GiB size: 681.23 GiB (100.00%)
used: 80.49 GiB (11.8%) fs: btrfs dev: /dev/sda2 maj-min: 8:2
Swap:
Kernel: swappiness: 133 (default 60) cache-pressure: 100 (default)
ID-1: swap-1 type: zram size: 15.5 GiB used: 0 KiB (0.0%) priority: 100
dev: /dev/zram0
ID-2: swap-2 type: partition size: 17.11 GiB used: 0 KiB (0.0%)
priority: -2 dev: /dev/sda3 maj-min: 8:3
Sensors:
System Temperatures: cpu: 45.0 C mobo: N/A
Fan Speeds (RPM): fan-1: 2081
Info:
Processes: 271 Uptime: 4m wakeups: 1 Memory: total: 16 GiB
available: 15.5 GiB used: 1.81 GiB (11.7%) Init: systemd v: 253
default: graphical tool: systemctl Compilers: gcc: 13.1.1 clang: 15.0.7
Packages: pm: pacman pkgs: 2132 libs: 582 tools: pamac,paru Shell: fish
v: 3.6.1 running-in: konsole inxi: 3.3.28
Garuda (2.6.16-1):
System install date:     2023-02-28
Last full system update: 2023-07-27
Is partially upgraded:   No
Relevant software:       snapper NetworkManager mkinitcpio nvidia-dkms
Windows dual boot:       No/Undetected
Failed units:            fancontrol.service

Update:

As noticed, I may have installed the wrong driver. To correct this, I downloaded the official driver from the NVIDIA website again, along with the kernel headers.

The installation of the driver using sh started, uninstalled the old (apparently wrong) graphics driver, but then aborted after 60% of the installation. The error message stated that the driver could not be built for the kernel. After that, I ran sudo garuda-update. Interestingly, the update routine then installed the driver successfully.

Unfortunately, in games, only the Intel chip is still being used. Also, nvidia-smi immediately throws an error again, saying it cannot communicate with the driver.

Furthermore, I have looked into how to manually remove drivers from the blacklist. The internet suggests the same solution every time. Edit the file '/etc/modprobe.d/blacklist.conf' and comment out the desired drivers. However, this file does not exist in my system. The folder is empty. Any advice on this would be greatly appreciated.

Thanks in advance.

Um, that’s your inxi. :joy:

Installing drivers off of the Nvidia website is not recommended. Even if the installation were successful (which is really a long shot), Pacman can’t update the drivers and they will just break when the kernel takes an update. See the ArchWiki Nvidia article:

Warning: Avoid installing the NVIDIA driver through the package provided from the NVIDIA website. Installation through pacman allows upgrading the driver together with the rest of the system.

An easy way to figure out what drivers to install is to compare the GPU model against the guidance on the ArchWiki Nvidia article.

From the ArchWiki:

First, go ahead and remove the driver you installed from the Nvidia website according to whatever method is available for that. If you can’t figure out how to remove it, you can always just boot to a snapshot from before the installation effort, restore the snapshot, reboot, then bring your system fully up to date with garuda-update. (See here: Restoring snapshots to get the system back to working state | Garuda Linux wiki)

Next, install the package:

sudo pacman -S nvidia-470xx-dkms

If you run into any issues during the installation, copy the full input/output of the commands you are running and paste into the thread so we can see what is happening.

Once you have the driver installed, read through this document (posted by @NaN above) for guidance on how to make sure it is getting used when you want it to be (i.e. for games and such):

1 Like

Thank you very much for the help. It works fine now.

By the way, if someone have similar issues, you can uninstall the proprietary driver by the command sudo sh NVIDIA-Linux-x86_64-390.157.run --uninstall.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.