Skip to content

Commit

Permalink
520.56.06
Browse files Browse the repository at this point in the history
  • Loading branch information
aritger committed Oct 12, 2022
1 parent 90eb107 commit 7c345b8
Show file tree
Hide file tree
Showing 40 changed files with 323 additions and 545 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

## Release 520 Entries

### [520.56.06] 2022-10-12

#### Added

- Introduce support for GeForce RTX 4090 GPUs.

### [520.61.05] 2022-10-10

#### Added
Expand Down
12 changes: 8 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# NVIDIA Linux Open GPU Kernel Module Source

This is the source release of the NVIDIA Linux open GPU kernel modules,
version 520.61.05.
version 520.56.06.


## How to Build
Expand All @@ -17,7 +17,7 @@ as root:

Note that the kernel modules built here must be used with gsp.bin
firmware and user-space NVIDIA GPU driver components from a corresponding
520.61.05 driver release. This can be achieved by installing
520.56.06 driver release. This can be achieved by installing
the NVIDIA GPU driver from the .run file using the `--no-kernel-modules`
option. E.g.,

Expand Down Expand Up @@ -167,15 +167,15 @@ for the target kernel.
## Compatible GPUs

The open-gpu-kernel-modules can be used on any Turing or later GPU
(see the table below). However, in the 520.61.05 release,
(see the table below). However, in the 520.56.06 release,
GeForce and Workstation support is still considered alpha-quality.

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

https://us.download.nvidia.com/XFree86/Linux-x86_64/520.61.05/README/kernel_open.html
https://us.download.nvidia.com/XFree86/Linux-x86_64/520.56.06/README/kernel_open.html

In the below table, if three IDs are listed, the first is the PCI Device
ID, the second is the PCI Subsystem Vendor ID, and the third is the PCI
Expand Down Expand Up @@ -685,6 +685,7 @@ Subsystem Device ID.
| NVIDIA GeForce RTX 3090 Ti | 2203 |
| NVIDIA GeForce RTX 3090 | 2204 |
| NVIDIA GeForce RTX 3080 | 2206 |
| NVIDIA GeForce RTX 3070 Ti | 2207 |
| NVIDIA GeForce RTX 3080 Ti | 2208 |
| NVIDIA GeForce RTX 3080 | 220A |
| NVIDIA CMP 90HX | 220D |
Expand All @@ -709,6 +710,7 @@ Subsystem Device ID.
| NVIDIA A10 | 2236 10DE 1482 |
| NVIDIA A10G | 2237 10DE 152F |
| NVIDIA A10M | 2238 10DE 1677 |
| NVIDIA H100 PCIe | 2331 10DE 1626 |
| NVIDIA GeForce RTX 3060 Ti | 2414 |
| NVIDIA GeForce RTX 3080 Ti Laptop GPU | 2420 |
| NVIDIA RTX A5500 Laptop GPU | 2438 |
Expand Down Expand Up @@ -736,6 +738,7 @@ Subsystem Device ID.
| NVIDIA RTX A3000 12GB Laptop GPU | 24B9 |
| NVIDIA RTX A4500 Laptop GPU | 24BA |
| NVIDIA RTX A3000 12GB Laptop GPU | 24BB |
| NVIDIA GeForce RTX 3060 Ti | 24C9 |
| NVIDIA GeForce RTX 3080 Laptop GPU | 24DC |
| NVIDIA GeForce RTX 3070 Laptop GPU | 24DD |
| NVIDIA GeForce RTX 3070 Ti Laptop GPU | 24E0 |
Expand All @@ -751,6 +754,7 @@ Subsystem Device ID.
| NVIDIA RTX A2000 | 2531 103C 151D |
| NVIDIA RTX A2000 | 2531 10DE 151D |
| NVIDIA RTX A2000 | 2531 17AA 151D |
| NVIDIA GeForce RTX 3060 | 2544 |
| NVIDIA GeForce RTX 3060 Laptop GPU | 2560 |
| NVIDIA GeForce RTX 3050 Ti Laptop GPU | 2563 |
| NVIDIA RTX A2000 12GB | 2571 1028 1611 |
Expand Down
2 changes: 1 addition & 1 deletion kernel-open/Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ EXTRA_CFLAGS += -I$(src)/common/inc
EXTRA_CFLAGS += -I$(src)
EXTRA_CFLAGS += -Wall -MD $(DEFINES) $(INCLUDES) -Wno-cast-qual -Wno-error -Wno-format-extra-args
EXTRA_CFLAGS += -D__KERNEL__ -DMODULE -DNVRM
EXTRA_CFLAGS += -DNV_VERSION_STRING=\"520.61.05\"
EXTRA_CFLAGS += -DNV_VERSION_STRING=\"520.56.06\"

EXTRA_CFLAGS += -Wno-unused-function

Expand Down
5 changes: 5 additions & 0 deletions kernel-open/common/inc/nv-pgprot.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,13 @@ static inline pgprot_t pgprot_modify_writecombine(pgprot_t old_prot)

#define NV_PGPROT_UNCACHED_DEVICE(old_prot) pgprot_noncached(old_prot)
#if defined(NVCPU_AARCH64)
#if defined(NV_MT_DEVICE_GRE_PRESENT)
#define NV_PROT_WRITE_COMBINED_DEVICE (PROT_DEFAULT | PTE_PXN | PTE_UXN | \
PTE_ATTRINDX(MT_DEVICE_GRE))
#else
#define NV_PROT_WRITE_COMBINED_DEVICE (PROT_DEFAULT | PTE_PXN | PTE_UXN | \
PTE_ATTRINDX(MT_DEVICE_nGnRE))
#endif
#define NV_PGPROT_WRITE_COMBINED_DEVICE(old_prot) \
__pgprot_modify(old_prot, PTE_ATTRINDX_MASK, NV_PROT_WRITE_COMBINED_DEVICE)
#define NV_PGPROT_WRITE_COMBINED(old_prot) NV_PGPROT_UNCACHED(old_prot)
Expand Down
48 changes: 21 additions & 27 deletions kernel-open/common/inc/nv.h
Original file line number Diff line number Diff line change
Expand Up @@ -636,33 +636,27 @@ typedef enum
#define NV_GET_NV_STATE(pGpu) \
(nv_state_t *)((pGpu) ? (pGpu)->pOsGpuInfo : NULL)

static inline NvBool IS_REG_OFFSET(nv_state_t *nv, NvU64 offset, NvU64 length)
{
return ((offset >= nv->regs->cpu_address) &&
((offset + (length - 1)) <= (nv->regs->cpu_address + (nv->regs->size - 1))));
}

static inline NvBool IS_FB_OFFSET(nv_state_t *nv, NvU64 offset, NvU64 length)
{
return ((nv->fb) && (offset >= nv->fb->cpu_address) &&
((offset + (length - 1)) <= (nv->fb->cpu_address + (nv->fb->size - 1))));
}

static inline NvBool IS_UD_OFFSET(nv_state_t *nv, NvU64 offset, NvU64 length)
{
return ((nv->ud.cpu_address != 0) && (nv->ud.size != 0) &&
(offset >= nv->ud.cpu_address) &&
((offset + (length - 1)) <= (nv->ud.cpu_address + (nv->ud.size - 1))));
}

static inline NvBool IS_IMEM_OFFSET(nv_state_t *nv, NvU64 offset, NvU64 length)
{
return ((nv->bars[NV_GPU_BAR_INDEX_IMEM].cpu_address != 0) &&
(nv->bars[NV_GPU_BAR_INDEX_IMEM].size != 0) &&
(offset >= nv->bars[NV_GPU_BAR_INDEX_IMEM].cpu_address) &&
((offset + (length - 1)) <= (nv->bars[NV_GPU_BAR_INDEX_IMEM].cpu_address +
(nv->bars[NV_GPU_BAR_INDEX_IMEM].size - 1))));
}
#define IS_REG_OFFSET(nv, offset, length) \
(((offset) >= (nv)->regs->cpu_address) && \
(((offset) + ((length)-1)) <= \
(nv)->regs->cpu_address + ((nv)->regs->size-1)))

#define IS_FB_OFFSET(nv, offset, length) \
(((nv)->fb) && ((offset) >= (nv)->fb->cpu_address) && \
(((offset) + ((length)-1)) <= (nv)->fb->cpu_address + ((nv)->fb->size-1)))

#define IS_UD_OFFSET(nv, offset, length) \
(((nv)->ud.cpu_address != 0) && ((nv)->ud.size != 0) && \
((offset) >= (nv)->ud.cpu_address) && \
(((offset) + ((length)-1)) <= (nv)->ud.cpu_address + ((nv)->ud.size-1)))

#define IS_IMEM_OFFSET(nv, offset, length) \
(((nv)->bars[NV_GPU_BAR_INDEX_IMEM].cpu_address != 0) && \
((nv)->bars[NV_GPU_BAR_INDEX_IMEM].size != 0) && \
((offset) >= (nv)->bars[NV_GPU_BAR_INDEX_IMEM].cpu_address) && \
(((offset) + ((length) - 1)) <= \
(nv)->bars[NV_GPU_BAR_INDEX_IMEM].cpu_address + \
((nv)->bars[NV_GPU_BAR_INDEX_IMEM].size - 1)))

#define NV_RM_MAX_MSIX_LINES 8

Expand Down
17 changes: 17 additions & 0 deletions kernel-open/conftest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2334,6 +2334,23 @@ compile_test() {
compile_check_conftest "$CODE" "NV_PCI_DEV_HAS_ATS_ENABLED" "" "types"
;;

mt_device_gre)
#
# Determine if MT_DEVICE_GRE flag is present.
#
# MT_DEVICE_GRE flag is removed by commit 58cc6b72a21274
# ("arm64: mm: Remove unused support for Device-GRE memory type") in v5.14-rc1
# (2021-06-01).
#
CODE="
#include <asm/memory.h>
unsigned int conftest_mt_device_gre(void) {
return MT_DEVICE_GRE;
}"

compile_check_conftest "$CODE" "NV_MT_DEVICE_GRE_PRESENT" "" "types"
;;

get_user_pages)
#
# Conftest for get_user_pages()
Expand Down
2 changes: 1 addition & 1 deletion kernel-open/nvidia/nv-mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,7 +431,7 @@ static int nvidia_mmap_numa(
const nv_alloc_mapping_context_t *mmap_context)
{
NvU64 start, addr;
NvU64 pages;
unsigned int pages;
NvU64 i;

pages = NV_VMA_SIZE(vma) >> PAGE_SHIFT;
Expand Down
3 changes: 0 additions & 3 deletions kernel-open/nvidia/nv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1429,9 +1429,6 @@ static int nv_open_device(nv_state_t *nv, nvidia_stack_t *sp)
return -ENODEV;
}

if (unlikely(NV_ATOMIC_READ(nvl->usage_count) >= NV_S32_MAX))
return -EMFILE;

if ( ! (nv->flags & NV_FLAG_OPEN))
{
/* Sanity check: !NV_FLAG_OPEN requires usage_count == 0 */
Expand Down
1 change: 1 addition & 0 deletions kernel-open/nvidia/nvidia.Kbuild
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ NV_CONFTEST_TYPE_COMPILE_TESTS += vmalloc_has_pgprot_t_arg
NV_CONFTEST_TYPE_COMPILE_TESTS += mm_has_mmap_lock
NV_CONFTEST_TYPE_COMPILE_TESTS += pci_channel_state
NV_CONFTEST_TYPE_COMPILE_TESTS += pci_dev_has_ats_enabled
NV_CONFTEST_TYPE_COMPILE_TESTS += mt_device_gre
NV_CONFTEST_TYPE_COMPILE_TESTS += remove_memory_has_nid_arg
NV_CONFTEST_TYPE_COMPILE_TESTS += add_memory_driver_managed_has_mhp_flags_arg
NV_CONFTEST_TYPE_COMPILE_TESTS += num_registered_fb
Expand Down
4 changes: 3 additions & 1 deletion kernel-open/nvidia/nvlink_linux.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* SPDX-FileCopyrightText: Copyright (c) 2015-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-FileCopyrightText: Copyright (c) 2015-2019 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
* SPDX-License-Identifier: MIT
*
* Permission is hereby granted, free of charge, to any person obtaining a
Expand Down Expand Up @@ -207,6 +207,8 @@ static int nvlink_fops_release(struct inode *inode, struct file *filp)

nvlink_print(NVLINK_DBG_INFO, "nvlink driver close\n");

WARN_ON(private == NULL);

mutex_lock(&nvlink_drvctx.lock);

if (private->capability_fds.fabric_mgmt > 0)
Expand Down
20 changes: 10 additions & 10 deletions src/common/inc/nvBldVer.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,25 +36,25 @@
// and then checked back in. You cannot make changes to these sections without
// corresponding changes to the buildmeister script
#ifndef NV_BUILD_BRANCH
#define NV_BUILD_BRANCH r521_82
#define NV_BUILD_BRANCH r521_90
#endif
#ifndef NV_PUBLIC_BRANCH
#define NV_PUBLIC_BRANCH r521_82
#define NV_PUBLIC_BRANCH r521_90
#endif

#if defined(NV_LINUX) || defined(NV_BSD) || defined(NV_SUNOS)
#define NV_BUILD_BRANCH_VERSION "rel/gpu_drv/r520/r521_82-338"
#define NV_BUILD_CHANGELIST_NUM (31864828)
#define NV_BUILD_BRANCH_VERSION "rel/gpu_drv/r520/r521_90-315"
#define NV_BUILD_CHANGELIST_NUM (31900380)
#define NV_BUILD_TYPE "Official"
#define NV_BUILD_NAME "rel/gpu_drv/r520/r521_82-338"
#define NV_LAST_OFFICIAL_CHANGELIST_NUM (31864828)
#define NV_BUILD_NAME "rel/gpu_drv/r520/r521_90-315"
#define NV_LAST_OFFICIAL_CHANGELIST_NUM (31900380)

#else /* Windows builds */
#define NV_BUILD_BRANCH_VERSION "r521_82-4"
#define NV_BUILD_CHANGELIST_NUM (31858738)
#define NV_BUILD_BRANCH_VERSION "r521_90-15"
#define NV_BUILD_CHANGELIST_NUM (31900380)
#define NV_BUILD_TYPE "Official"
#define NV_BUILD_NAME "522.06"
#define NV_LAST_OFFICIAL_CHANGELIST_NUM (31858738)
#define NV_BUILD_NAME "522.25"
#define NV_LAST_OFFICIAL_CHANGELIST_NUM (31900380)
#define NV_BUILD_BRANCH_BASE_VERSION R520
#endif
// End buildmeister python edited section
Expand Down
1 change: 1 addition & 0 deletions src/common/inc/nvPNPVendorIds.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ static const PNPVendorId PNPVendorIds[] =
{ "CLO", _VENDOR_NAME_ENTRY("Clone Computers/Analogy") },
{ "CLT", _VENDOR_NAME_ENTRY("automated computer control systems")},
{ "CMD", _VENDOR_NAME_ENTRY("CMD Technology") },
{ "CMN", _VENDOR_NAME_ENTRY("Chimei innolux corp.") },
{ "CMO", _VENDOR_NAME_ENTRY("Chi Mei Optoelectronics corp.") },
{ "CNI", _VENDOR_NAME_ENTRY("Connect International") },
{ "CNT", _VENDOR_NAME_ENTRY("CNet Technology") },
Expand Down
2 changes: 1 addition & 1 deletion src/common/inc/nvUnixVersion.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#if defined(NV_LINUX) || defined(NV_BSD) || defined(NV_SUNOS) || defined(NV_VMWARE) || defined(NV_QNX) || defined(NV_INTEGRITY) || \
(defined(RMCFG_FEATURE_PLATFORM_GSP) && RMCFG_FEATURE_PLATFORM_GSP == 1)

#define NV_VERSION_STRING "520.61.05"
#define NV_VERSION_STRING "520.56.06"

#else

Expand Down
19 changes: 7 additions & 12 deletions src/common/nvlink/interface/nvlink_lib_ctrl.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ typedef struct
typedef struct
{
NvU16 nodeId;
NvU16 linkIndex;
NvU32 linkIndex;
nvlink_pci_dev_info pciInfo;
} nvlink_endpoint;

Expand Down Expand Up @@ -117,7 +117,7 @@ typedef struct
typedef struct
{
NvU16 nodeId;
NvU16 linkIndex;
NvU32 linkIndex;
nvlink_pci_dev_info pciInfo;
NvU8 devUuid[NVLINK_UUID_LEN];
NvU32 devType;
Expand Down Expand Up @@ -189,9 +189,9 @@ typedef enum
/* link and sublink state of an nvlink endpoint */
typedef struct
{
NvU8 linkMode;
NvU8 txSubLinkMode;
NvU8 rxSubLinkMode;
NvU32 linkMode;
NvU32 txSubLinkMode;
NvU32 rxSubLinkMode;
} nvlink_link_state;

/*
Expand Down Expand Up @@ -354,7 +354,7 @@ typedef struct
*/
typedef struct
{
NvU16 linkIndex;
NvU32 linkIndex;
NvBool initStatus;
} nvlink_link_init_status;

Expand Down Expand Up @@ -503,7 +503,7 @@ typedef struct
*/
typedef struct
{
NvU16 linkIndex;
NvU32 linkIndex;
NV_DECLARE_ALIGNED(NvU64 tokenValue, 8);
} nvlink_token_info;

Expand Down Expand Up @@ -1111,11 +1111,6 @@ typedef struct
NvU32 endStatesCount;
} nvlink_get_device_link_states;

/*
* Note: Verify that new parameter structs for IOCTLs satisfy
* sizing restrictions for all OSs they could be used in.
*/

#define CTRL_NVLINK_CHECK_VERSION 0x01
#define CTRL_NVLINK_SET_NODE_ID 0x02
#define CTRL_NVLINK_SET_TX_COMMON_MODE 0x03
Expand Down
13 changes: 1 addition & 12 deletions src/common/nvlink/kernel/nvlink/core/nvlink_link_mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,18 +78,7 @@ nvlink_core_check_link_state
return NV_FALSE;
}

status = link->link_handlers->get_dl_link_mode(link, &crntDlLinkMode);
if (status != NVL_SUCCESS)
{
NVLINK_PRINT((DBG_MODULE_NVLINK_CORE, NVLINK_DBG_LEVEL_ERRORS,
"%s: Unable to get DL link mode for %s:%s\n",
__FUNCTION__, link->dev->deviceName, link->linkName));
return NV_FALSE;
}

if (crntTlLinkMode == NVLINK_LINKSTATE_HS &&
(crntDlLinkMode == NVLINK_LINKSTATE_HS ||
crntDlLinkMode == NVLINK_LINKSTATE_SLEEP))
if (crntTlLinkMode == NVLINK_LINKSTATE_HS)
{
return NV_TRUE;
}
Expand Down
9 changes: 4 additions & 5 deletions src/common/nvlink/kernel/nvlink/core/nvlink_shutdown.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ nvlink_core_powerdown_intranode_conns_from_active_to_off

// to track Failure
conns[i]->end0->inSWCFG = NV_FALSE;
}
}
else
{
conns[i]->end0->inSWCFG = NV_TRUE;
Expand All @@ -448,14 +448,14 @@ nvlink_core_powerdown_intranode_conns_from_active_to_off

// to track Failure
conns[i]->end1->inSWCFG = NV_FALSE;
}
}
else
{
conns[i]->end1->inSWCFG = NV_TRUE;
}

// Change each sublink state to SAFE
if(conns[i]->end0->inSWCFG == NV_TRUE)
if(conns[i]->end0->inSWCFG == NV_TRUE)
{
conns[i]->end0->link_handlers->set_tx_mode(conns[i]->end0,
NVLINK_SUBLINK_STATE_TX_SAFE,
Expand Down Expand Up @@ -928,8 +928,7 @@ nvlink_core_powerdown_floorswept_conns_to_off
{
nvlink_core_get_intranode_conn(links[j], &(conn));
if (conn == NULL ||
_nvlink_core_check_if_conn_in_array(visitedConns, connCount, conn) ||
(conn->end0 == NULL || conn->end1 == NULL))
_nvlink_core_check_if_conn_in_array(visitedConns, connCount, conn))
{
continue;
}
Expand Down
Loading

0 comments on commit 7c345b8

Please sign in to comment.