ubuntu-drivers-common icon indicating copy to clipboard operation
ubuntu-drivers-common copied to clipboard

Conflict logic to Nvidia RTD3 README.

Open os369510 opened this issue 3 years ago • 6 comments

In a desktop with iGPU (Intel) + dGPU (Nvidia with RTD3 supports), if system boot from iGPU then the nvidia mode will be on-demand mode[1].

Which is conflict with the README Nvidia provided.

Supported Configurations
* This feature is available only when the following conditions are satisfied:

* This feature is supported only on notebooks.

[1]

    else if (cards_n > 1) {
        /* Get data about the boot_vga card */
        get_boot_vga(current_devices, cards_n,
                     &boot_vga_vendor_id,
                     &boot_vga_device_id);

        /* Get data about the first discrete card */
        get_first_discrete(current_devices, cards_n,
                           &discrete_device);

        /* Intel or AMD + another GPU */
        if ((boot_vga_vendor_id == INTEL) || (boot_vga_vendor_id == AMD)) {
            fprintf(log_handle, "%s IGP detected\n", (boot_vga_vendor_id == INTEL) ? "Intel" : "AMD");
            /* AMDGPU-Pro Switchable */
            if (has_changed && amdgpu_loaded && amdgpu_is_pro && amdgpu_pro_px_installed) {
...
            }
            /* NVIDIA Optimus */
            else if ((intel_loaded || amdgpu_loaded) && !nouveau_loaded &&
                                 (nvidia_loaded || nvidia_kmod_available)) {
                fprintf(log_handle, "NVIDIA hybrid system\n");

                /* Try to enable prime */
                if (enable_prime(prime_settings,
                             &discrete_device, current_devices, cards_n)) {

                    /* Write permanent settings about offloading */
                    set_offloading();
                }
                else {
                    fprintf(log_handle, "Nothing to do\n");
                }

                goto end;
            }
...
        }

os369510 avatar Aug 19 '21 07:08 os369510

@os369510 On-demand mode doesn't necessarily enable RTD3. It only does so if the GPU claims to support it in the json database NVIDIA provides. Have you run into a case where one of the GPUs which support RTD3 belong to a Desktop system?

tseliot avatar Aug 19 '21 09:08 tseliot

@tseliot I thought the on-demand mode only configured if RTD3 is supported.

Supported Configurations
This feature is available only when the following conditions are satisfied:

* This feature is supported only on notebooks.

* This feature requires system hardware as well as ACPI support (ACPI "_PR0" and "_PR3" methods are needed to control PCIe power). The necessary hardware and ACPI support was first added in Intel Coffeelake chipset series. Hence, this feature is supported from Intel Coffeelake chipset series.

* This feature requires a Turing or newer GPU.

* This feature is supported with Linux kernel versions 4.18 and newer. With older kernel versions, it may not work as intended.

* This feature is supported when Linux kernel defines CONFIG_PM (CONFIG_PM=y). Typically, if the system supports S3 (suspend-to-RAM), then CONFIG_PM would be defined.

FWIT, if the ID is listed in json file which meaning it's supported GPU (This feature requires a Turing or newer GPU.). We still need to consider other condition to enable it? (e.g. This feature is supported only on notebooks.) or do you thing it's ok to always set to on-demand mode (if supported) and ask Nvidia to remove the notebook condition since the nvidia driver might not reference chassis type.

Yes, we have some desktop/workstation those support many dGPU and the part of nvidia graphic are supporting RTD3 but the ubuntu-drivers install do nothing to keep them in performance mode if bootvga is dGPU (Nvidia) but it's on-demand mode if bootvga is iGPU (Intel). Which means they will have different behavior if user installs ubuntu with different bootvga device.

os369510 avatar Aug 19 '21 17:08 os369510

@tseliot @os369510 We should have a consistent logic selecting the default mode after Nvidia driver installed, if we would like to de-couple the on-demand from RTD3, then how about to always select on-demand mode?

So far, looks gpu-manager will select on-demand only for gpu supported RTD3 (Why? When on-demand is decoupled from RTD3).

It is confusing that end-user will get different default mode between the different cases of the bootvga when they are installing the nvidia driver.

alex-tu-cc avatar Aug 23 '21 15:08 alex-tu-cc

@alex-tu-cc on-demand mode should be the default if the GPU is supported by the 460 driver or newer (the code for it comes from a time when 460 wasn't available yet).

I agree that on-demand mode should be default now. We just need to make sure that RTD3 is only applied to laptops though (checking the chassis should be enough).

tseliot avatar Aug 30 '21 09:08 tseliot

If I understand it correctly, "prime-select on-demand" means: GUI Program only uses NV GPU as the user intended to.

Even if RTD3 is not supported, a user might want to reserve GPU to deep-learning or maybe bit-coin mining. For such use cases, the on-demand mode will be the proper one to use.

ycheng avatar Sep 20 '21 11:09 ycheng

I think the latest commits in ubuntu-drivers-common and in nvidia-prime should solve the problem.

tseliot avatar Sep 20 '21 11:09 tseliot