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

Asked by Umesh

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.

Question information

English Edit question
Ubuntu Edit question
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :

The recommended way of usage is having the NVidia GPU disabled and to enable it for a single command with

You might also need to do the steps in

Revision history for this message
Umesh (umeshkalyani) said :

If we can have command that can disable and enable the GPU, that would be great.

Revision history for this message
actionparsnip (andrew-woodhead666) said :

You do. Read the link given....

Can you help with this problem?

Provide an answer of your own, or ask Umesh for more information if necessary.

To post a message you must log in.