Score:0

How to disable and Enable the NVIDIA GPU from command line?

in flag

I am using the OS Ubuntu "18.04.5 LTS (Bionic Beaver)" on an HP machine with NVIDIA graphics card. My applications can run both with and without GPU. I want to test and compare the results on the same box with and without GPU. So I want to run the test on the box once with GPU and once run the same test again by disabling the GPU and compare the results.

So, I want to understand how can I disable the GPU from command prompt and after the completion of the test again enable the GPU.

Please help me with the steps/commands.

Score:0
in flag

You can use this command to switch between intel or Nvidia GPU

sudo prime-select nvidia
sudo prime-select intel

You need to reboot for the change to apply

Make sure that Nvidia driver is already installed correctly. The easiest way to install it is go to Software & Updates -> Additional Drivers

Umesh Kalyani avatar
in flag
Thanks ffauzan for the response. I tried the same and I see that profile is set to intel. root@ubuntu:~# sudo prime-select intel Info: the intel profile is already set But, when I check the resource utilization by the nvidia GPU, it still uses the resources.
Umesh Kalyani avatar
in flag
# nvidia-smi |-------------------------------+----------------------+----------------------+ | 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 Tesla P4 Off | 00000000:14:00.0 Off | 0 | | N/A 37C P0 23W / 75W | 5980MiB / 7611MiB | 0% Default | | | | N/A |
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.