Skip to content

Commit 6d33efe

Browse files
committed
535.161.07
1 parent ee55481 commit 6d33efe

File tree

79 files changed

+75706
-75409
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+75706
-75409
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## Release 535 Entries
44

5+
### [535.161.07] 2024-02-22
6+
57
### [535.154.05] 2024-01-16
68

79
### [535.146.02] 2023-12-07

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# NVIDIA Linux Open GPU Kernel Module Source
22

33
This is the source release of the NVIDIA Linux open GPU kernel modules,
4-
version 535.154.05.
4+
version 535.161.07.
55

66

77
## How to Build
@@ -17,7 +17,7 @@ as root:
1717

1818
Note that the kernel modules built here must be used with GSP
1919
firmware and user-space NVIDIA GPU driver components from a corresponding
20-
535.154.05 driver release. This can be achieved by installing
20+
535.161.07 driver release. This can be achieved by installing
2121
the NVIDIA GPU driver from the .run file using the `--no-kernel-modules`
2222
option. E.g.,
2323

@@ -180,15 +180,15 @@ software applications.
180180
## Compatible GPUs
181181

182182
The open-gpu-kernel-modules can be used on any Turing or later GPU
183-
(see the table below). However, in the 535.154.05 release,
183+
(see the table below). However, in the 535.161.07 release,
184184
GeForce and Workstation support is still considered alpha-quality.
185185

186186
To enable use of the open kernel modules on GeForce and Workstation GPUs,
187187
set the "NVreg_OpenRmEnableUnsupportedGpus" nvidia.ko kernel module
188188
parameter to 1. For more details, see the NVIDIA GPU driver end user
189189
README here:
190190

191-
https://us.download.nvidia.com/XFree86/Linux-x86_64/535.154.05/README/kernel_open.html
191+
https://us.download.nvidia.com/XFree86/Linux-x86_64/535.161.07/README/kernel_open.html
192192

193193
In the below table, if three IDs are listed, the first is the PCI Device
194194
ID, the second is the PCI Subsystem Vendor ID, and the third is the PCI
@@ -746,12 +746,15 @@ Subsystem Device ID.
746746
| NVIDIA H800 PCIe | 2322 10DE 17A4 |
747747
| NVIDIA H800 | 2324 10DE 17A6 |
748748
| NVIDIA H800 | 2324 10DE 17A8 |
749+
| NVIDIA H20 | 2329 10DE 198B |
750+
| NVIDIA H20 | 2329 10DE 198C |
749751
| NVIDIA H100 80GB HBM3 | 2330 10DE 16C0 |
750752
| NVIDIA H100 80GB HBM3 | 2330 10DE 16C1 |
751753
| NVIDIA H100 PCIe | 2331 10DE 1626 |
752754
| NVIDIA H100 | 2339 10DE 17FC |
753755
| NVIDIA H800 NVL | 233A 10DE 183A |
754756
| NVIDIA GH200 120GB | 2342 10DE 16EB |
757+
| NVIDIA GH200 120GB | 2342 10DE 1805 |
755758
| NVIDIA GH200 480GB | 2342 10DE 1809 |
756759
| NVIDIA GeForce RTX 3060 Ti | 2414 |
757760
| NVIDIA GeForce RTX 3080 Ti Laptop GPU | 2420 |
@@ -805,6 +808,7 @@ Subsystem Device ID.
805808
| NVIDIA RTX A2000 12GB | 2571 10DE 1611 |
806809
| NVIDIA RTX A2000 12GB | 2571 17AA 1611 |
807810
| NVIDIA GeForce RTX 3050 | 2582 |
811+
| NVIDIA GeForce RTX 3050 | 2584 |
808812
| NVIDIA GeForce RTX 3050 Ti Laptop GPU | 25A0 |
809813
| NVIDIA GeForce RTX 3050Ti Laptop GPU | 25A0 103C 8928 |
810814
| NVIDIA GeForce RTX 3050Ti Laptop GPU | 25A0 103C 89F9 |
@@ -837,7 +841,6 @@ Subsystem Device ID.
837841
| NVIDIA RTX A2000 Embedded GPU | 25FA |
838842
| NVIDIA RTX A500 Embedded GPU | 25FB |
839843
| NVIDIA GeForce RTX 4090 | 2684 |
840-
| NVIDIA GeForce RTX 4090 D | 2685 |
841844
| NVIDIA RTX 6000 Ada Generation | 26B1 1028 16A1 |
842845
| NVIDIA RTX 6000 Ada Generation | 26B1 103C 16A1 |
843846
| NVIDIA RTX 6000 Ada Generation | 26B1 10DE 16A1 |
@@ -846,6 +849,7 @@ Subsystem Device ID.
846849
| NVIDIA RTX 5000 Ada Generation | 26B2 103C 17FA |
847850
| NVIDIA RTX 5000 Ada Generation | 26B2 10DE 17FA |
848851
| NVIDIA RTX 5000 Ada Generation | 26B2 17AA 17FA |
852+
| NVIDIA RTX 5880 Ada Generation | 26B3 103C 1934 |
849853
| NVIDIA RTX 5880 Ada Generation | 26B3 10DE 1934 |
850854
| NVIDIA L40 | 26B5 10DE 169D |
851855
| NVIDIA L40 | 26B5 10DE 17DA |

kernel-open/Kbuild

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ EXTRA_CFLAGS += -I$(src)/common/inc
7272
EXTRA_CFLAGS += -I$(src)
7373
EXTRA_CFLAGS += -Wall $(DEFINES) $(INCLUDES) -Wno-cast-qual -Wno-error -Wno-format-extra-args
7474
EXTRA_CFLAGS += -D__KERNEL__ -DMODULE -DNVRM
75-
EXTRA_CFLAGS += -DNV_VERSION_STRING=\"535.154.05\"
75+
EXTRA_CFLAGS += -DNV_VERSION_STRING=\"535.161.07\"
7676

7777
ifneq ($(SYSSRCHOST1X),)
7878
EXTRA_CFLAGS += -I$(SYSSRCHOST1X)

kernel-open/common/inc/nv.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,6 +615,14 @@ typedef enum
615615
#define NV_IS_DEVICE_IN_SURPRISE_REMOVAL(nv) \
616616
(((nv)->flags & NV_FLAG_IN_SURPRISE_REMOVAL) != 0)
617617

618+
/*
619+
* For console setup by EFI GOP, the base address is BAR1.
620+
* For console setup by VBIOS, the base address is BAR2 + 16MB.
621+
*/
622+
#define NV_IS_CONSOLE_MAPPED(nv, addr) \
623+
(((addr) == (nv)->bars[NV_GPU_BAR_INDEX_FB].cpu_address) || \
624+
((addr) == ((nv)->bars[NV_GPU_BAR_INDEX_IMEM].cpu_address + 0x1000000)))
625+
618626
#define NV_SOC_IS_ISO_IOMMU_PRESENT(nv) \
619627
((nv)->iso_iommu_present)
620628

@@ -874,6 +882,8 @@ NvBool NV_API_CALL nv_match_gpu_os_info(nv_state_t *, void *);
874882
NvU32 NV_API_CALL nv_get_os_type(void);
875883

876884
void NV_API_CALL nv_get_updated_emu_seg(NvU32 *start, NvU32 *end);
885+
void NV_API_CALL nv_get_screen_info(nv_state_t *, NvU64 *, NvU16 *, NvU16 *, NvU16 *, NvU16 *, NvU64 *);
886+
877887
struct dma_buf;
878888
typedef struct nv_dma_buf nv_dma_buf_t;
879889
struct drm_gem_object;

kernel-open/common/inc/os-interface.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: Copyright (c) 1999-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
* SPDX-FileCopyrightText: Copyright (c) 1999-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
* SPDX-License-Identifier: MIT
44
*
55
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -162,10 +162,9 @@ NvBool NV_API_CALL os_is_vgx_hyper (void);
162162
NV_STATUS NV_API_CALL os_inject_vgx_msi (NvU16, NvU64, NvU32);
163163
NvBool NV_API_CALL os_is_grid_supported (void);
164164
NvU32 NV_API_CALL os_get_grid_csp_support (void);
165-
void NV_API_CALL os_get_screen_info (NvU64 *, NvU16 *, NvU16 *, NvU16 *, NvU16 *, NvU64, NvU64);
166165
void NV_API_CALL os_bug_check (NvU32, const char *);
167166
NV_STATUS NV_API_CALL os_lock_user_pages (void *, NvU64, void **, NvU32);
168-
NV_STATUS NV_API_CALL os_lookup_user_io_memory (void *, NvU64, NvU64 **, void**);
167+
NV_STATUS NV_API_CALL os_lookup_user_io_memory (void *, NvU64, NvU64 **);
169168
NV_STATUS NV_API_CALL os_unlock_user_pages (NvU64, void *);
170169
NV_STATUS NV_API_CALL os_match_mmap_offset (void *, NvU64, NvU64 *);
171170
NV_STATUS NV_API_CALL os_get_euid (NvU32 *);

kernel-open/conftest.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5213,10 +5213,16 @@ compile_test() {
52135213
# Added by commit 7b7b27214bba ("mm/memory_hotplug: introduce
52145214
# add_memory_driver_managed()") in v5.8-rc1 (2020-06-05)
52155215
#
5216+
# Before commit 3a0aaefe4134 ("mm/memory_hotplug: guard more
5217+
# declarations by CONFIG_MEMORY_HOTPLUG") in v5.10, the
5218+
# add_memory_driver_managed() was not guarded.
5219+
#
52165220
CODE="
52175221
#include <linux/memory_hotplug.h>
52185222
void conftest_add_memory_driver_managed() {
5223+
#if defined(CONFIG_MEMORY_HOTPLUG)
52195224
add_memory_driver_managed();
5225+
#endif
52205226
}"
52215227

52225228
compile_check_conftest "$CODE" "NV_ADD_MEMORY_DRIVER_MANAGED_PRESENT" "" "functions"
@@ -6396,10 +6402,16 @@ compile_test() {
63966402
# DRM_UNLOCKED was removed by commit 2798ffcc1d6a ("drm: Remove
63976403
# locking for legacy ioctls and DRM_UNLOCKED") in Linux
63986404
# next-20231208.
6405+
#
6406+
# DRM_UNLOCKED definition was moved from drmP.h to drm_ioctl.h by
6407+
# commit 2640981f3600 ("drm: document drm_ioctl.[hc]") in v4.12.
63996408
CODE="
64006409
#if defined(NV_DRM_DRM_IOCTL_H_PRESENT)
64016410
#include <drm/drm_ioctl.h>
64026411
#endif
6412+
#if defined(NV_DRM_DRMP_H_PRESENT)
6413+
#include <drm/drmP.h>
6414+
#endif
64036415
int flags = DRM_UNLOCKED;"
64046416

64056417
compile_check_conftest "$CODE" "NV_DRM_UNLOCKED_IOCTL_FLAG_PRESENT" "" "types"

kernel-open/nvidia/nv-mmap.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: Copyright (c) 1999-2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
* SPDX-FileCopyrightText: Copyright (c) 1999-2024 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
* SPDX-License-Identifier: MIT
44
*
55
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -577,12 +577,9 @@ int nvidia_mmap_helper(
577577
//
578578
// This path is similar to the sysmem mapping code.
579579
// TODO: Refactor is needed as part of bug#2001704.
580-
// Use pfn_valid to determine whether the physical address has
581-
// backing struct page. This is used to isolate P8 from P9.
582580
//
583581
if ((nv_get_numa_status(nvl) == NV_NUMA_STATUS_ONLINE) &&
584-
!IS_REG_OFFSET(nv, access_start, access_len) &&
585-
(pfn_valid(PFN_DOWN(mmap_start))))
582+
!IS_REG_OFFSET(nv, access_start, access_len))
586583
{
587584
ret = nvidia_mmap_numa(vma, mmap_context);
588585
if (ret)

kernel-open/nvidia/nv.c

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5640,3 +5640,128 @@ NV_STATUS NV_API_CALL nv_get_egm_info(
56405640
NV_DEV_PRINTF(NV_DBG_INFO, nv, "Cannot get EGM info\n");
56415641
return NV_ERR_NOT_SUPPORTED;
56425642
}
5643+
5644+
void NV_API_CALL nv_get_screen_info(
5645+
nv_state_t *nv,
5646+
NvU64 *pPhysicalAddress,
5647+
NvU16 *pFbWidth,
5648+
NvU16 *pFbHeight,
5649+
NvU16 *pFbDepth,
5650+
NvU16 *pFbPitch,
5651+
NvU64 *pFbSize
5652+
)
5653+
{
5654+
*pPhysicalAddress = 0;
5655+
*pFbWidth = *pFbHeight = *pFbDepth = *pFbPitch = *pFbSize = 0;
5656+
5657+
#if defined(CONFIG_FB) && defined(NV_NUM_REGISTERED_FB_PRESENT)
5658+
if (num_registered_fb > 0)
5659+
{
5660+
int i;
5661+
5662+
for (i = 0; i < num_registered_fb; i++)
5663+
{
5664+
if (!registered_fb[i])
5665+
continue;
5666+
5667+
/* Make sure base address is mapped to GPU BAR */
5668+
if (NV_IS_CONSOLE_MAPPED(nv, registered_fb[i]->fix.smem_start))
5669+
{
5670+
*pPhysicalAddress = registered_fb[i]->fix.smem_start;
5671+
*pFbWidth = registered_fb[i]->var.xres;
5672+
*pFbHeight = registered_fb[i]->var.yres;
5673+
*pFbDepth = registered_fb[i]->var.bits_per_pixel;
5674+
*pFbPitch = registered_fb[i]->fix.line_length;
5675+
*pFbSize = (NvU64)(*pFbHeight) * (NvU64)(*pFbPitch);
5676+
return;
5677+
}
5678+
}
5679+
}
5680+
#endif
5681+
5682+
/*
5683+
* If the screen info is not found in the registered FBs then fallback
5684+
* to the screen_info structure.
5685+
*
5686+
* The SYSFB_SIMPLEFB option, if enabled, marks VGA/VBE/EFI framebuffers as
5687+
* generic framebuffers so the new generic system-framebuffer drivers can
5688+
* be used instead. DRM_SIMPLEDRM drives the generic system-framebuffers
5689+
* device created by SYSFB_SIMPLEFB.
5690+
*
5691+
* SYSFB_SIMPLEFB registers a dummy framebuffer which does not contain the
5692+
* information required by nv_get_screen_info(), therefore you need to
5693+
* fall back onto the screen_info structure.
5694+
*
5695+
* After commit b8466fe82b79 ("efi: move screen_info into efi init code")
5696+
* in v6.7, 'screen_info' is exported as GPL licensed symbol for ARM64.
5697+
*/
5698+
5699+
#if NV_CHECK_EXPORT_SYMBOL(screen_info)
5700+
/*
5701+
* If there is not a framebuffer console, return 0 size.
5702+
*
5703+
* orig_video_isVGA is set to 1 during early Linux kernel
5704+
* initialization, and then will be set to a value, such as
5705+
* VIDEO_TYPE_VLFB or VIDEO_TYPE_EFI if an fbdev console is used.
5706+
*/
5707+
if (screen_info.orig_video_isVGA > 1)
5708+
{
5709+
NvU64 physAddr = screen_info.lfb_base;
5710+
#if defined(VIDEO_CAPABILITY_64BIT_BASE)
5711+
physAddr |= (NvU64)screen_info.ext_lfb_base << 32;
5712+
#endif
5713+
5714+
/* Make sure base address is mapped to GPU BAR */
5715+
if (NV_IS_CONSOLE_MAPPED(nv, physAddr))
5716+
{
5717+
*pPhysicalAddress = physAddr;
5718+
*pFbWidth = screen_info.lfb_width;
5719+
*pFbHeight = screen_info.lfb_height;
5720+
*pFbDepth = screen_info.lfb_depth;
5721+
*pFbPitch = screen_info.lfb_linelength;
5722+
*pFbSize = (NvU64)(*pFbHeight) * (NvU64)(*pFbPitch);
5723+
}
5724+
}
5725+
#else
5726+
{
5727+
nv_linux_state_t *nvl = NV_GET_NVL_FROM_NV_STATE(nv);
5728+
struct pci_dev *pci_dev = nvl->pci_dev;
5729+
int i;
5730+
5731+
if (pci_dev == NULL)
5732+
return;
5733+
5734+
BUILD_BUG_ON(NV_GPU_BAR_INDEX_IMEM != NV_GPU_BAR_INDEX_FB + 1);
5735+
for (i = NV_GPU_BAR_INDEX_FB; i <= NV_GPU_BAR_INDEX_IMEM; i++)
5736+
{
5737+
int bar_index = nv_bar_index_to_os_bar_index(pci_dev, i);
5738+
struct resource *gpu_bar_res = &pci_dev->resource[bar_index];
5739+
struct resource *res = gpu_bar_res->child;
5740+
5741+
/*
5742+
* Console resource will become child resource of pci-dev resource.
5743+
* Check if child resource start address matches with expected
5744+
* console start address.
5745+
*/
5746+
if ((res != NULL) &&
5747+
NV_IS_CONSOLE_MAPPED(nv, res->start))
5748+
{
5749+
NvU32 res_name_len = strlen(res->name);
5750+
5751+
/*
5752+
* The resource name ends with 'fb' (efifb, vesafb, etc.).
5753+
* For simple-framebuffer, the resource name is 'BOOTFB'.
5754+
* Confirm if the resources name either ends with 'fb' or 'FB'.
5755+
*/
5756+
if ((res_name_len > 2) &&
5757+
!strcasecmp((res->name + res_name_len - 2), "fb"))
5758+
{
5759+
*pPhysicalAddress = res->start;
5760+
*pFbSize = resource_size(res);
5761+
return;
5762+
}
5763+
}
5764+
}
5765+
}
5766+
#endif
5767+
}

0 commit comments

Comments
 (0)