On-demand and RTD3 need to be separated

Bug #1942789 reported by jeremyszu
16
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OEM Priority Project
Fix Released
High
Dirk Su
nvidia-prime (Ubuntu)
Fix Released
High
Alberto Milone
Focal
Fix Released
High
Alberto Milone
Hirsute
Won't Fix
High
Alberto Milone

Bug Description

RTD3 is a nvidia GPU feature to support runtime suspend.

On-demand would be a X offloading feature.

They are independent, according to discussion on https://github.com/tseliot/ubuntu-drivers-common/issues/55.

Some parts need to be adjusted, e.g.

```
    # If we are dealing with NVIDIA PRIME, and runtimepm
    # is supported, enable it
    if (os.path.isfile('/run/nvidia_runtimepm_supported') and
        os.path.isfile('/usr/bin/prime-select')):
        print('Trying to select the on-demand PRIME profile')
        try:
            subprocess.call(['prime-select', 'on-demand'])
        except:
            pass

        # Create the override file for gpu-manager
        with open('/etc/u-d-c-nvidia-runtimepm-override', 'w') as f:
            f.write('# File created by ubuntu-drivers\n')
```

---

[Impact]

 * Ubuntu will set GPU mode to performance as default which may use more power
 * User can't use GPU for other purpose (eg: deep-learning) if RTD3 is not supported
 * According to Nvidia README, the RTD3 doesn't support on non-laptop machine

[Test Plan]

 * Install Ubuntu, and then execute 'ubuntu-drivers install' to install GPU driver. After the installation, reboot the system. Execute "prime-select query" should get "on-demand"
 * Old GPU (which supported by nvidia-390 only) will keep in performance mode, refer LP:1957094. Execute "prime-select query" should get "nvidia"
 * On non-laptop machine. Can set GPU mode to on-demand
 * On laptop with GPU in runtime PM support list. Set GPU mode to on-demand and Nvidia driver is loaded with "NVreg_DynamicPowerManagement=0x02"

[Where problems could occur]

 * With GPU supported RTD3 not able enable runtime PM on non-laptop. But based on the Nvidia README, this case shall not happened.

[Other Info]

Changelogs:

nvidia-prime (0.8.16~0.20.04.2) focal; urgency=medium

  [ Jeremy Szu ]
  * Set on-demand mode as default nvidia mode (LP: #1942307)

  [ Alberto Milone ]
  * prime-select:
    - Detect chassis type and enable RTD3 only
      on laptops (LP: #1942788).
    - on-demand mode doesn't need to depend on
      RTD3 (LP: #1942789).
    - Use bootvga detection when last_gfx_boot
      is not available.
    - Don't check the current profile when setting
      a profile (LP: #1946476).
    - Handle BrokenPipeError (LP: #1965520).

jeremyszu (os369510)
Changed in oem-priority:
assignee: nobody → jeremyszu (os369510)
importance: Undecided → High
status: New → Confirmed
Changed in ubuntu-drivers-common (Ubuntu):
status: New → In Progress
importance: Undecided → High
assignee: nobody → Alberto Milone (albertomilone)
Changed in nvidia-prime (Ubuntu):
status: New → In Progress
importance: Undecided → High
assignee: nobody → Alberto Milone (albertomilone)
Rex Tsai (chihchun)
tags: added: oem-priority
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package nvidia-prime - 0.8.17

---------------
nvidia-prime (0.8.17) impish; urgency=medium

  [ Jeremy Szu ]
  * Set on-demand mode as default nvidia mode (LP: #1942307)

  [ Alberto Milone ]
  * prime-select:
    - Detect chassis type and enable RTD3 only
      on laptops (LP: #1942788).
    - on-demand mode doesn't need to depend on
      RTD3 (LP: #1942789).
    - Use bootvga detection when last_gfx_boot
      is not available.

 -- Alberto Milone <email address hidden> Fri, 17 Sep 2021 16:45:11 +0200

Changed in nvidia-prime (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
jeremyszu (os369510) wrote :

@Alberto,

Could we please apply them to focal as well?

Changed in oem-priority:
status: Confirmed → Triaged
Dirk Su (dirksu)
description: updated
Revision history for this message
Brian Murray (brian-murray) wrote : Missing SRU information

Thanks for uploading the fix for this bug report to -proposed. However, when reviewing the package in -proposed and the details of this bug report I noticed that the bug description is missing information required for the SRU process. You can find full details at http://wiki.ubuntu.com/StableReleaseUpdates#Procedure but essentially this bug is missing some of the following: a statement of impact, a test case and details regarding where problems may occur. Thanks in advance!

Dirk Su (dirksu)
Changed in oem-priority:
assignee: jeremyszu (os369510) → Dirk Su (dirksu)
description: updated
Dirk Su (dirksu)
description: updated
Dirk Su (dirksu)
description: updated
Changed in nvidia-prime (Ubuntu Focal):
assignee: nobody → Alberto Milone (albertomilone)
Changed in nvidia-prime (Ubuntu Hirsute):
assignee: nobody → Alberto Milone (albertomilone)
Changed in ubuntu-drivers-common (Ubuntu Focal):
assignee: nobody → Alberto Milone (albertomilone)
Changed in ubuntu-drivers-common (Ubuntu Hirsute):
assignee: nobody → Alberto Milone (albertomilone)
Revision history for this message
Brian Murray (brian-murray) wrote :

I find the statement "focal does not have nvidia driver lower than 450" in the bug description confusing. I see the source package nvidia-graphics-drivers-390 as being available in Focal.

https://launchpad.net/ubuntu/+source/nvidia-graphics-drivers-390

Could somebody give some more information about how setting the GPU mode to on-demand will work with this driver?

Changed in nvidia-prime (Ubuntu Focal):
status: New → Incomplete
Revision history for this message
jeremyszu (os369510) wrote (last edit ):

Hi Brian,

Let me think about your case, it's not a fresh installed system since all nvidia drivers are backward compatible. Thus, user will get the newer (e.g. 460 or 470) when installing the new stock ubuntu.

Since the Bug1942307, I will assume the user is staying at "nvidia" mode if user didn't select the nvidia mode manually. (which means the "/etc/prime-discrete" is "on" in the users you worry about)

Revision history for this message
Timo Aaltonen (tjaalton) wrote (last edit ):

But if you have hw that drivers newer than -390 don't support, you're stuck with -390. What would happen on such system?

Revision history for this message
jeremyszu (os369510) wrote :

Hi Timo,

For new installation (e.g. 20.04.4) with old GPU, I _think_ (I don't have such hardware) it will switch to on-demand mode (nvidia offload) and won't enable RTD3.

Dirk Su (dirksu)
description: updated
description: updated
Revision history for this message
Dirk Su (dirksu) wrote :

@Brian

I updated the description. Do you think the information in description is enough to continue the SRU process?
And the packages is uploaded to queue.
Focal: https://launchpad.net/ubuntu/focal/+upload/27068997/+files/nvidia-prime_0.8.16~0.20.04.2_source.changes
Hirsute: https://launchpad.net/ubuntu/hirsute/+upload/27068995/+files/nvidia-prime_0.8.16.2~0.21.04.1_source.changes

Revision history for this message
Chris Halse Rogers (raof) wrote :

So, I think the next step here is to work out how to answer the question “what happens with -390”, and to commit to *testing* what happens with -390 as a part of the test plan.

Revision history for this message
Dirk Su (dirksu) wrote :

With test on Dell Vostro 5568 witch got GPU can be supported by nvidia-driver-390 package. Install nvidia-driver-390 via ubuntu-drivers install nvidia:390. The default GPU mode will be nvidia. Manually switch GPU mode to on-demand, and running glxinfo will get "Error: couldn't find RGB GLX visual or fbconfig". It seems on-demand mode not work with nvidia-driver-390.

Revision history for this message
jeremyszu (os369510) wrote :

As comment#10, this SRU introduces a regression[1], I'll propose some packages and asking Alberto to review.

[1] https://bugs.launchpad.net/ubuntu/+source/ubuntu-drivers-common/+bug/1957094

Changed in ubuntu-drivers-common (Ubuntu Focal):
status: New → In Progress
Changed in ubuntu-drivers-common (Ubuntu Hirsute):
status: New → In Progress
Changed in ubuntu-drivers-common (Ubuntu Focal):
importance: Undecided → High
Changed in ubuntu-drivers-common (Ubuntu Hirsute):
importance: Undecided → High
status: In Progress → Won't Fix
no longer affects: ubuntu-drivers-common (Ubuntu)
no longer affects: ubuntu-drivers-common (Ubuntu Focal)
no longer affects: ubuntu-drivers-common (Ubuntu Hirsute)
Dirk Su (dirksu)
description: updated
Changed in oem-priority:
status: Triaged → Confirmed
Revision history for this message
Dirk Su (dirksu) wrote :

Test plan had been updated to cover the nvidia-driver-390 case.

Changed in nvidia-prime (Ubuntu Hirsute):
status: New → Invalid
Revision history for this message
jeremyszu (os369510) wrote :

Hi Chris,

For -390, we did find a machine to test it and also provided a corresponding handler in
https://bugs.launchpad.net/ubuntu/+source/ubuntu-drivers-common/+bug/1957094

The bug1957094 is completed, does it solve your concerns?

Also CC, Brian and Timo for awareness.

Mathew Hodson (mhodson)
Changed in nvidia-prime (Ubuntu Hirsute):
status: Invalid → Won't Fix
Changed in nvidia-prime (Ubuntu Focal):
importance: Undecided → High
Changed in nvidia-prime (Ubuntu Hirsute):
importance: Undecided → High
Dirk Su (dirksu)
description: updated
Dirk Su (dirksu)
description: updated
Revision history for this message
Chris Halse Rogers (raof) wrote : Please test proposed package

Hello jeremyszu, or anyone else affected,

Accepted nvidia-prime into focal-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/nvidia-prime/0.8.16~0.20.04.2 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-focal to verification-done-focal. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-focal. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in nvidia-prime (Ubuntu Focal):
status: Incomplete → Fix Committed
tags: added: verification-needed verification-needed-focal
Revision history for this message
Dirk Su (dirksu) wrote :

Install Focal on Dell notebook Precision 7750 (202004-27817). Enable focal-proposed channel, install nvidia with "sudo ubuntu-drivers install nvidia" then reboot system. Check system is in on-demand with "prime-select query". Check nvidia module parameter with "cat /proc/driver/nvidia/params | grep DynamicPowerManagement" and get result 2 which means GPU enabled with RTD3.

Revision history for this message
Dirk Su (dirksu) wrote :

Install Focal on HP EliteOne 800 G6 All-in-One (202008-28167). Enable focal-proposed channel, install nvidia with "sudo ubuntu-drivers install nvidia" then reboot system. Check system is in on-demand with "prime-select query". Since this machine has all-in-one in chassis type, only enabled off-load mode and disabled RTD3.

Dirk Su (dirksu)
tags: added: verification-done verification-done-focal
removed: verification-needed verification-needed-focal
Revision history for this message
Łukasz Zemczak (sil2100) wrote : Update Released

The verification of the Stable Release Update for nvidia-prime has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package nvidia-prime - 0.8.16~0.20.04.2

---------------
nvidia-prime (0.8.16~0.20.04.2) focal; urgency=medium

  [ Jeremy Szu ]
  * Set on-demand mode as default nvidia mode (LP: #1942307)

  [ Alberto Milone ]
  * prime-select:
    - Detect chassis type and enable RTD3 only
      on laptops (LP: #1942788).
    - on-demand mode doesn't need to depend on
      RTD3 (LP: #1942789).
    - Don't check the current profile when setting
      a profile (LP: #1946476).
    - Handle BrokenPipeError (LP: #1965520).

 -- Alberto Milone <email address hidden> Thu, 28 Oct 2021 16:40:04 +0200

Changed in nvidia-prime (Ubuntu Focal):
status: Fix Committed → Fix Released
jeremyszu (os369510)
Changed in oem-priority:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.