diff options
author | Aaron Plattner <aplattner@nvidia.com> | 2016-10-21 08:05:25 -0700 |
---|---|---|
committer | Aaron Plattner <aplattner@nvidia.com> | 2016-10-21 08:05:25 -0700 |
commit | d6190c92db2ffb84e721afe5bf9d4ef41243cc02 (patch) | |
tree | 72fbe8daf3e07a8dcf7beb945d74dab44bf239bc | |
parent | f63e032a431b02f86da1e16434566c0f53b74525 (diff) |
375.10375.10
-rw-r--r-- | conflicting-kernel-modules.c | 1 | ||||
-rw-r--r-- | files.c | 208 | ||||
-rw-r--r-- | install-from-cwd.c | 7 | ||||
-rw-r--r-- | kernel.c | 35 | ||||
-rw-r--r-- | manifest.c | 3 | ||||
-rw-r--r-- | nvLegacy.h | 7 | ||||
-rw-r--r-- | nvidia-installer.c | 7 | ||||
-rw-r--r-- | nvidia-installer.h | 10 | ||||
-rw-r--r-- | option_table.h | 26 | ||||
-rw-r--r-- | version.mk | 2 |
10 files changed, 252 insertions, 54 deletions
diff --git a/conflicting-kernel-modules.c b/conflicting-kernel-modules.c index 4d9e890..c6e6dcb 100644 --- a/conflicting-kernel-modules.c +++ b/conflicting-kernel-modules.c @@ -27,6 +27,7 @@ */ const char * const conflicting_kernel_modules[] = { + "nvidia-vgpu-vfio", "nvidia-uvm", "nvidia-drm", "nvidia-modeset", @@ -603,7 +603,8 @@ static void check_libGLX_indirect_links(Options *op, Package *p) int set_destinations(Options *op, Package *p) { char *name; - char *prefix, *dir, *path; + char *dir, *path; + const char *prefix; char *xdg_data_dir; int i; if (!op->kernel_module_src_dir) { @@ -632,6 +633,8 @@ int set_destinations(Options *op, Package *p) case FILE_TYPE_GLVND_SYMLINK: case FILE_TYPE_GLX_CLIENT_LIB: case FILE_TYPE_GLX_CLIENT_SYMLINK: + case FILE_TYPE_EGL_CLIENT_LIB: + case FILE_TYPE_EGL_CLIENT_SYMLINK: if (p->entries[i].compat_arch == FILE_COMPAT_ARCH_COMPAT32) { prefix = op->compat32_prefix; dir = op->compat32_libdir; @@ -854,6 +857,14 @@ int set_destinations(Options *op, Package *p) path = ""; break; + case FILE_TYPE_GLVND_EGL_ICD_JSON: + // We'll set this path later in check_libglvnd_files. We have to + // wait until we figure out whether we're going to install our own + // build of the libglvnd libraries, which will determine where the + // JSON file goes. + p->entries[i].dst = NULL; + continue; + default: /* @@ -3213,6 +3224,41 @@ done: } /* + * set_libglvnd_egl_json_path() - Tries to figure out what path to install the + * JSON file to for a libglvnd EGL vendor library. + * + * This is only needed to work with an existing copy of the libglvnd libraries. + * If we're installing our own build, then we already know what path libEGL + * expects. + */ +static void set_libglvnd_egl_json_path(Options *op) +{ + if (op->libglvnd_json_path == NULL) { + if (op->utils[PKG_CONFIG]) { + char *path = NULL; + char *cmd = nvstrcat(op->utils[PKG_CONFIG], " --variable=datadir libglvnd", NULL); + int ret = run_command(op, cmd, &path, FALSE, 0, TRUE); + nvfree(cmd); + + if (ret == 0) { + op->libglvnd_json_path = nvstrcat(path, "/glvnd/egl_vendor.d", NULL); + collapse_multiple_slashes(op->libglvnd_json_path); + } + nvfree(path); + } + } + + if (op->libglvnd_json_path == NULL) { + ui_warn(op, "Unable to determine the path to install the " + "libglvnd EGL vendor library config files. Check that " + "you have pkg-config and the libglvnd development " + "libraries installed, or specify a path with " + "--glvnd-egl-config-path."); + op->libglvnd_json_path = nvstrdup(DEFAULT_GLVND_EGL_JSON_PATH); + } +} + +/* * check_libglvnd_files() - Checks whether or not the installer should install * the libglvnd libraries. * @@ -3229,6 +3275,7 @@ int check_libglvnd_files(Options *op, Package *p) { int shouldInstall = op->install_libglvnd_libraries; int foundAnyFiles = FALSE; + int foundJSONFile = FALSE; int i; // Start by checking for any libGLX_indirect.so.0 links. @@ -3239,7 +3286,11 @@ int check_libglvnd_files(Options *op, Package *p) if (p->entries[i].type == FILE_TYPE_GLVND_LIB || p->entries[i].type == FILE_TYPE_GLVND_SYMLINK) { foundAnyFiles = TRUE; - break; + } + + if (p->entries[i].type == FILE_TYPE_GLVND_EGL_ICD_JSON) { + foundAnyFiles = TRUE; + foundJSONFile = TRUE; } } if (!foundAnyFiles) { @@ -3299,14 +3350,32 @@ int check_libglvnd_files(Options *op, Package *p) for (i = 0; i < p->num_entries; i++) { if (p->entries[i].type == FILE_TYPE_GLVND_LIB || p->entries[i].type == FILE_TYPE_GLVND_SYMLINK || - ((p->entries[i].type == FILE_TYPE_GLX_CLIENT_LIB || - p->entries[i].type == FILE_TYPE_GLX_CLIENT_SYMLINK) && - p->entries[i].glvnd == FILE_GLVND_GLVND_ONLY)) { + p->entries[i].glvnd == FILE_GLVND_GLVND_ONLY) { + ui_log(op, "Skipping GLVND file: \"%s\"", p->entries[i].file); invalidate_package_entry(&(p->entries[i])); } } + + if (foundJSONFile) { + set_libglvnd_egl_json_path(op); + } } else { log_printf(op, NULL, "Will install libglvnd libraries."); + + if (foundJSONFile && op->libglvnd_json_path == NULL) { + op->libglvnd_json_path = nvstrdup(DEFAULT_GLVND_EGL_JSON_PATH); + } + } + if (foundJSONFile) { + log_printf(op, NULL, + "Will install libEGL vendor library config file to %s", + op->libglvnd_json_path); + for (i = 0; i < p->num_entries; i++) { + if (p->entries[i].type == FILE_TYPE_GLVND_EGL_ICD_JSON) { + p->entries[i].dst = nvstrcat(op->libglvnd_json_path, "/", p->entries[i].name, NULL); + collapse_multiple_slashes(p->entries[i].dst); + } + } } return TRUE; } @@ -3314,59 +3383,126 @@ int check_libglvnd_files(Options *op, Package *p) /* Select between GLVND and non-GLVND installation; invalidate any * package entries incompatible with the selection */ -void select_glvnd(Options *op, Package *p) +static int prompt_user_glvnd(Options *op, Package *p, + const char *api, int defaultEnabled) { - int i, glvnd_only_files_present = FALSE; +#define GLVND_PROMPT_QUESTION "The NVIDIA OpenGL %s client libraries " \ + "may be installed using the GL Vendor Neutral " \ + "Dispatch (GLVND) architecture, or using a " \ + "traditional, non-GLVND architecture. Choosing " \ + "GLVND will allow GLVND-compliant client " \ + "libraries from other OpenGL implementations to " \ + "coexist with the NVIDIA client libraries, but " \ + "may result in compatibility problems with some " \ + "programs. What type of client libraries do you " \ + "want to install?" + + const char *choices[2] = { + "GLVND", + "non-GLVND" + }; + int result = ui_multiple_choice(op, choices, 2, + defaultEnabled ? 0 : 1, + GLVND_PROMPT_QUESTION, api); + return (result == 0); +} - /* Always install non-GLVND when the package lacks GLVND-specific files */ +void select_glvnd(Options *op, Package *p) +{ + int i; + int glvnd_glx_present = FALSE; + int glvnd_egl_present = FALSE; + int non_glvnd_glx_present = FALSE; + int non_glvnd_egl_present = FALSE; + /* Figure out if the package contains GLVND or non-GLVND files for EGL and GLX. */ for (i = 0; i < p->num_entries; i++) { if (p->entries[i].glvnd == FILE_GLVND_GLVND_ONLY) { - glvnd_only_files_present = TRUE; - break; + if (p->entries[i].type == FILE_TYPE_GLX_CLIENT_LIB || + p->entries[i].type == FILE_TYPE_GLX_CLIENT_SYMLINK) { + glvnd_glx_present = TRUE; + } else if (p->entries[i].type == FILE_TYPE_EGL_CLIENT_LIB || + p->entries[i].type == FILE_TYPE_EGL_CLIENT_SYMLINK) { + glvnd_egl_present = TRUE; + } + } else if (p->entries[i].glvnd == FILE_GLVND_NON_GLVND_ONLY) { + if (p->entries[i].type == FILE_TYPE_GLX_CLIENT_LIB || + p->entries[i].type == FILE_TYPE_GLX_CLIENT_SYMLINK) { + non_glvnd_glx_present = TRUE; + } else if (p->entries[i].type == FILE_TYPE_EGL_CLIENT_LIB || + p->entries[i].type == FILE_TYPE_EGL_CLIENT_SYMLINK) { + non_glvnd_egl_present = TRUE; + } } } - if (!glvnd_only_files_present) { - op->glvnd_glx_client = FALSE; + if (!glvnd_glx_present && non_glvnd_glx_present) { ui_log(op, "Package does not include GLVND GLX client libraries: " "forcing '--no-glvnd-glx-client'."); + op->glvnd_glx_client = FALSE; + } else if (glvnd_glx_present && !non_glvnd_glx_present) { + ui_log(op, "Package does not include non-GLVND GLX client libraries: " + "forcing '--glvnd-glx-client'."); + op->glvnd_glx_client = TRUE; + } + + if (!glvnd_egl_present && non_glvnd_egl_present) { + ui_log(op, "Package does not include GLVND EGL client libraries: " + "forcing '--no-glvnd-egl-client'."); + op->glvnd_egl_client = FALSE; + } else if (glvnd_egl_present && !non_glvnd_egl_present) { + ui_log(op, "Package does not include non-GLVND EGL client libraries: " + "forcing '--glvnd-egl-client'."); + op->glvnd_egl_client = TRUE; + } + + if (!(glvnd_glx_present && non_glvnd_glx_present) && + !(glvnd_egl_present && non_glvnd_egl_present)) { + return; } /* Allow expert users to change the default or commandline given choice */ if (op->expert) { - const char *choices[2] = { - "GLVND", - "non-GLVND" - }; - const char *question = "The NVIDIA OpenGL GLX client libraries may be " - "installed using the GL Vendor Neutral " - "Dispatch (GLVND) architecture, or using a " - "traditional, non-GLVND architecture. Choosing " - "GLVND will allow GLVND-compliant GLX client " - "libraries from other OpenGL implementations " - "to coexist with the NVIDIA GLX client " - "libraries, but may result in compatibility " - "problems with some programs. What type of GLX " - "client libraries do you want to install?"; - - op->glvnd_glx_client = ui_multiple_choice(op, choices, 2, - op->glvnd_glx_client ? 0 : 1, - "%s", question) == 0; + if (glvnd_glx_present && non_glvnd_glx_present) { + op->glvnd_glx_client = prompt_user_glvnd(op, p, "GLX", op->glvnd_glx_client); + } + if (glvnd_egl_present && non_glvnd_egl_present) { + op->glvnd_egl_client = prompt_user_glvnd(op, p, "EGL", op->glvnd_egl_client); + } } ui_log(op, "Will install %sGLVND GLX client libraries.", op->glvnd_glx_client ? "" : "non-"); + ui_log(op, "Will install %sGLVND EGL client libraries.", + op->glvnd_egl_client ? "" : "non-"); + + // Select the correct GLX and EGL libraries. for (i = 0; i < p->num_entries; i++) { - if (op->glvnd_glx_client && - p->entries[i].glvnd == FILE_GLVND_NON_GLVND_ONLY) { - invalidate_package_entry(&(p->entries[i])); - } else if (!op->glvnd_glx_client && - p->entries[i].glvnd == FILE_GLVND_GLVND_ONLY) { - invalidate_package_entry(&(p->entries[i])); + if (p->entries[i].type == FILE_TYPE_GLX_CLIENT_LIB || + p->entries[i].type == FILE_TYPE_GLX_CLIENT_SYMLINK) { + if (op->glvnd_glx_client && + p->entries[i].glvnd == FILE_GLVND_NON_GLVND_ONLY) { + ui_log(op, "Skipping GLX non-GLVND file: \"%s\"", p->entries[i].file); + invalidate_package_entry(&(p->entries[i])); + } else if (!op->glvnd_glx_client && + p->entries[i].glvnd == FILE_GLVND_GLVND_ONLY) { + ui_log(op, "Skipping GLX GLVND file: \"%s\"", p->entries[i].file); + invalidate_package_entry(&(p->entries[i])); + } + } else if (p->entries[i].type == FILE_TYPE_EGL_CLIENT_LIB || + p->entries[i].type == FILE_TYPE_EGL_CLIENT_SYMLINK) { + if (op->glvnd_egl_client && + p->entries[i].glvnd == FILE_GLVND_NON_GLVND_ONLY) { + ui_log(op, "Skipping EGL non-GLVND file: \"%s\"", p->entries[i].file); + invalidate_package_entry(&(p->entries[i])); + } else if (!op->glvnd_egl_client && + p->entries[i].glvnd == FILE_GLVND_GLVND_ONLY) { + ui_log(op, "Skipping EGL GLVND file: \"%s\"", p->entries[i].file); + invalidate_package_entry(&(p->entries[i])); + } } } } diff --git a/install-from-cwd.c b/install-from-cwd.c index a2c5861..3a1f8f6 100644 --- a/install-from-cwd.c +++ b/install-from-cwd.c @@ -315,6 +315,12 @@ int install_from_cwd(Options *op) if (!load_kernel_module(op, "nvidia-drm")) { goto failed; } + + if (package_includes_kernel_module(p, "nvidia-vgpu-vfio")) { + if (!load_kernel_module(op, "nvidia-vgpu-vfio")) { + goto failed; + } + } } /* run the distro postinstall script */ @@ -600,6 +606,7 @@ static int has_separate_interface_file(char *name) { int i; static const char* no_interface_modules[] = { + "nvidia-vgpu-vfio", "nvidia-uvm", "nvidia-drm", }; @@ -1422,7 +1422,7 @@ int test_kernel_modules(Options *op, Package *p) ret = ignore_load_error(op, p, p->kernel_modules[i].module_filename, cmd_output, ret); if (ret) { - op->load_error_ignored = TRUE; + op->skip_module_load = TRUE; handle_optional_module_failure(op, p->kernel_modules[i], ui_warn, "load"); @@ -1491,7 +1491,7 @@ static int modprobe_helper(Options *op, const char *module_name, int ret = 0, old_loglevel, loglevel_set; char *cmd, *data; - if (op->load_error_ignored) { + if (op->skip_module_load) { return TRUE; } @@ -1772,7 +1772,7 @@ PrecompiledInfo *find_precompiled_kernel_interface(Options *op, Package *p) /* * get_kernel_name() - get the kernel name: this is either what - * the user specified via the --kernel-name option, or `name -r`. + * the user specified via the --kernel-name option, or `uname -r`. */ char __kernel_name[256]; @@ -1781,18 +1781,29 @@ char *get_kernel_name(Options *op) { struct utsname uname_buf; - if (op->kernel_name) { - return op->kernel_name; + __kernel_name[0] = '\0'; + + if (uname(&uname_buf) == -1) { + ui_warn(op, "Unable to determine the version of the running kernel " + "(%s).", strerror(errno)); } else { - if (uname(&uname_buf) == -1) { - ui_warn(op, "Unable to determine kernel version (%s).", - strerror(errno)); - return NULL; - } else { - strncpy(__kernel_name, uname_buf.release, 256); - return __kernel_name; + strncpy(__kernel_name, uname_buf.release, sizeof(__kernel_name)); + __kernel_name[sizeof(__kernel_name) - 1] = '\0'; + } + + if (op->kernel_name) { + if (strcmp(op->kernel_name, __kernel_name) != 0) { + /* Don't load kernel modules built against a non-running kernel */ + op->skip_module_load = TRUE; } + return op->kernel_name; + } + + if (__kernel_name[0]) { + return __kernel_name; } + + return NULL; } /* get_kernel_name() */ @@ -128,6 +128,9 @@ static const struct { { ENTRY(GLX_CLIENT_LIB, T, F, T, F, F, T, T, F, F, F, T) }, { ENTRY(GLX_CLIENT_SYMLINK, T, F, F, F, T, F, T, F, F, F, T) }, { ENTRY(VULKAN_ICD_JSON, F, F, T, F, F, F, F, F, F, F, F) }, + { ENTRY(GLVND_EGL_ICD_JSON, F, F, T, F, F, F, T, F, F, F, F) }, + { ENTRY(EGL_CLIENT_LIB, T, F, T, F, F, T, T, F, F, F, T) }, + { ENTRY(EGL_CLIENT_SYMLINK, T, F, F, F, T, F, T, F, F, F, T) }, }; /* @@ -41,6 +41,7 @@ typedef struct _LEGACY_STRINGS { * This table describes how we should refer to legacy branches. */ static const LEGACY_STRINGS LegacyStrings[] = { + { 6, "367.xx" }, { 5, "340.xx" }, { 4, "304.xx" }, { 3, "173.14.xx" }, @@ -564,7 +565,11 @@ static const LEGACY_INFO LegacyList[] = { { 0x10C0, 0x0000, 0x0000, 5, "GeForce 9300 GS" }, { 0x10C3, 0x0000, 0x0000, 5, "GeForce 8400GS" }, { 0x10C5, 0x0000, 0x0000, 5, "GeForce 405" }, - { 0x10D8, 0x0000, 0x0000, 5, "NVS 300" } + { 0x10D8, 0x0000, 0x0000, 5, "NVS 300" }, + { 0x0FEF, 0x0000, 0x0000, 6, "GRID K340" }, + { 0x0FF2, 0x0000, 0x0000, 6, "GRID K1" }, + { 0x118A, 0x0000, 0x0000, 6, "GRID K520" }, + { 0x11BF, 0x0000, 0x0000, 6, "GRID K2" } }; #endif /* __NV_LEGACY_H */ diff --git a/nvidia-installer.c b/nvidia-installer.c index 1427c50..fd1af11 100644 --- a/nvidia-installer.c +++ b/nvidia-installer.c @@ -143,6 +143,7 @@ static Options *load_default_options(void) op->check_for_alternate_installs = TRUE; op->install_uvm = TRUE; op->glvnd_glx_client = TRUE; + op->glvnd_egl_client = TRUE; op->install_compat32_libs = NV_OPTIONAL_BOOL_DEFAULT; op->install_libglx_indirect = NV_OPTIONAL_BOOL_DEFAULT; op->install_libglvnd_libraries = NV_OPTIONAL_BOOL_DEFAULT; @@ -452,6 +453,12 @@ static void parse_commandline(int argc, char *argv[], Options *op) case GLVND_GLX_CLIENT_OPTION: op->glvnd_glx_client = boolval; break; + case GLVND_EGL_CONFIG_FILE_PATH_OPTION: + op->libglvnd_json_path = strval; + break; + case GLVND_EGL_CLIENT_OPTION: + op->glvnd_egl_client = boolval; + break; default: goto fail; } diff --git a/nvidia-installer.h b/nvidia-installer.h index 8409305..f25d9ef 100644 --- a/nvidia-installer.h +++ b/nvidia-installer.h @@ -155,8 +155,9 @@ typedef struct __options { int compat32_files_packaged; int x_files_packaged; int concurrency_level; - int load_error_ignored; + int skip_module_load; int glvnd_glx_client; + int glvnd_egl_client; NVOptionalBool install_libglx_indirect; NVOptionalBool install_libglvnd_libraries; @@ -222,6 +223,8 @@ typedef struct __options { char *module_signing_hash; char *module_signing_x509_hash; + char *libglvnd_json_path; + int kernel_module_signed; void *ui_priv; /* for use by the ui's */ @@ -288,6 +291,9 @@ typedef enum { FILE_TYPE_VULKAN_ICD_JSON, FILE_TYPE_GLX_CLIENT_LIB, FILE_TYPE_GLX_CLIENT_SYMLINK, + FILE_TYPE_GLVND_EGL_ICD_JSON, + FILE_TYPE_EGL_CLIENT_LIB, + FILE_TYPE_EGL_CLIENT_SYMLINK, FILE_TYPE_MAX } PackageEntryFileType; @@ -505,6 +511,8 @@ typedef struct __package { #define XORG7_DEFAULT_X_PREFIX "/usr" #define XORG7_DEFAULT_X_MODULEDIR "xorg/modules" +#define DEFAULT_GLVND_EGL_JSON_PATH "/usr/share/glvnd/egl_vendor.d" + /* * Older versions of Debian GNU/Linux for x86-64 install 32-bit * compatibility libraries relative to a chroot-like top-level diff --git a/option_table.h b/option_table.h index 326d84a..d50e939 100644 --- a/option_table.h +++ b/option_table.h @@ -101,6 +101,8 @@ enum { NO_LIBGLX_INDIRECT, INSTALL_LIBGLVND_OPTION, GLVND_GLX_CLIENT_OPTION, + GLVND_EGL_CONFIG_FILE_PATH_OPTION, + GLVND_EGL_CLIENT_OPTION, }; static const NVGetoptOption __options[] = { @@ -662,15 +664,33 @@ static const NVGetoptOption __options[] = { "they appear to be missing." }, { "glvnd-glx-client", GLVND_GLX_CLIENT_OPTION, NVGETOPT_IS_BOOLEAN, NULL, - "By default, the NVIDIA OpenGL driver will be installed with the new " + "By default, the NVIDIA GLX driver will be installed with the new " "GLVND architecture, to support coexisting with other GLVND-compliant " - "OpenGL drivers. However, some applications which do not conform to " + "GLX drivers. However, some applications which do not conform to " "the Linux OpenGL ABI may not be fully compatible with a GLVND-based " - "OpenGL driver. The --no-glvnd-glx-client option will select a " + "GLX driver. The --no-glvnd-glx-client option will select a " "non-GLVND GLX client library (libGL.so.1), which may help to avoid " "compatibility issues with such applications." }, + { "glvnd-egl-config-path", GLVND_EGL_CONFIG_FILE_PATH_OPTION, NVGETOPT_STRING_ARGUMENT, NULL, + "If the package includes a libglvnd-based EGL library, then install the " + "EGL vendor library config file to this directory. If the libglvnd " + "libraries are already present, then by default the installer will try " + "to determine the path by running `pkg-config --variable=datadir " + "libglvnd`. If that fails, then it will default to " + DEFAULT_GLVND_EGL_JSON_PATH "." + }, + + { "glvnd-egl-client", GLVND_EGL_CLIENT_OPTION, NVGETOPT_IS_BOOLEAN, NULL, + "By default, the NVIDIA EGL driver will be installed with the new " + "GLVND architecture, to support coexisting with other GLVND-compliant " + "EGL drivers. However, some applications may not be fully compatible " + "with a GLVND-based EGL driver. The --no-glvnd-egl-client option will " + "select a non-GLVND EGL client library, which may help to avoid " + "compatibility issues with such applications." + }, + /* Orphaned options: These options were in the long_options table in * nvidia-installer.c but not in the help. */ { "debug", 'd', 0, NULL,NULL }, @@ -1 +1 @@ -NVIDIA_VERSION = 370.28 +NVIDIA_VERSION = 375.10 |