Skip to content

Commit db0c4e6

Browse files
committed
595.58.03
1 parent df1c9a3 commit db0c4e6

Some content is hidden

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

63 files changed

+611
-195
lines changed

README.md

Lines changed: 8 additions & 3 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 595.45.04.
4+
version 595.58.03.
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-
595.45.04 driver release. This can be achieved by installing
20+
595.58.03 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

@@ -185,7 +185,7 @@ table below).
185185
For details on feature support and limitations, see the NVIDIA GPU driver
186186
end user README here:
187187

188-
https://us.download.nvidia.com/XFree86/Linux-x86_64/595.45.04/README/kernel_open.html
188+
https://us.download.nvidia.com/XFree86/Linux-x86_64/595.58.03/README/kernel_open.html
189189

190190
For vGPU support, please refer to the README.vgpu packaged in the vGPU Host
191191
Package for more details.
@@ -946,6 +946,7 @@ Subsystem Device ID.
946946
| NVIDIA B200 | 2901 10DE 1999 |
947947
| NVIDIA B200 | 2901 10DE 199B |
948948
| NVIDIA B200 | 2901 10DE 20DA |
949+
| NVIDIA B200 | 2909 10DE 22EB |
949950
| NVIDIA GB200 | 2941 10DE 2046 |
950951
| NVIDIA GB200 | 2941 10DE 20CA |
951952
| NVIDIA GB200 | 2941 10DE 20D5 |
@@ -974,6 +975,8 @@ Subsystem Device ID.
974975
| NVIDIA RTX PRO 6000 Blackwell Server Edition | 2BB5 10DE 204E |
975976
| NVIDIA RTX PRO 6000 Blackwell Server Edition | 2BB5 10DE 220B |
976977
| NVIDIA RTX 6000D | 2BB9 10DE 2091 |
978+
| NVIDIA RTX 6000D | 2BB9 10DE 2092 |
979+
| NVIDIA RTX 6000D | 2BB9 10DE 2279 |
977980
| NVIDIA GeForce RTX 5080 | 2C02 |
978981
| NVIDIA GeForce RTX 5070 Ti | 2C05 |
979982
| NVIDIA GeForce RTX 5090 Laptop GPU | 2C18 |
@@ -992,6 +995,7 @@ Subsystem Device ID.
992995
| NVIDIA RTX PRO 4000 Blackwell | 2C34 17AA 2052 |
993996
| NVIDIA RTX PRO 5000 Blackwell Generation Laptop GPU | 2C38 |
994997
| NVIDIA RTX PRO 4000 Blackwell Generation Laptop GPU | 2C39 |
998+
| NVIDIA RTX PRO 4500 Blackwell Server Edition | 2C3A 10DE 21F4 |
995999
| NVIDIA GeForce RTX 5090 Laptop GPU | 2C58 |
9961000
| NVIDIA GeForce RTX 5080 Laptop GPU | 2C59 |
9971001
| NVIDIA RTX PRO 5000 Blackwell Embedded GPU | 2C77 |
@@ -1021,3 +1025,4 @@ Subsystem Device ID.
10211025
| NVIDIA GeForce RTX 5070 Ti Laptop GPU | 2F58 |
10221026
| NVIDIA B300 SXM6 AC | 3182 10DE 20E6 |
10231027
| NVIDIA GB300 | 31C2 10DE 21F1 |
1028+
| NVIDIA GB300 | 31C3 10DE 22F8 |

kernel-open/Kbuild

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ ccflags-y += -I$(src)/common/inc
7979
ccflags-y += -I$(src)
8080
ccflags-y += -Wall $(DEFINES) $(INCLUDES) -Wno-cast-qual -Wno-format-extra-args
8181
ccflags-y += -D__KERNEL__ -DMODULE -DNVRM
82-
ccflags-y += -DNV_VERSION_STRING=\"595.45.04\"
82+
ccflags-y += -DNV_VERSION_STRING=\"595.58.03\"
8383

8484
# Include and link Tegra out-of-tree modules.
8585
ifneq ($(wildcard /usr/src/nvidia/nvidia-public),)

kernel-open/common/inc/nv-linux.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: Copyright (c) 2001-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
* SPDX-FileCopyrightText: Copyright (c) 2001-2026 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
@@ -1351,7 +1351,6 @@ typedef struct nv_linux_state_s {
13511351
struct reset_control *nvdisplay_reset;
13521352
struct reset_control *dsi_core_reset;
13531353
struct reset_control *mipi_cal_reset;
1354-
struct reset_control *hdacodec_reset;
13551354

13561355
/*
13571356
* nv_imp_icc_path represents the interconnect path across which display

kernel-open/common/inc/nv-mm.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,16 @@ static inline void nv_vma_flags_clear_word(struct vm_area_struct *vma, unsigned
216216
ACCESS_PRIVATE(vma, __vm_flags) &= ~flags;
217217
#endif
218218
}
219+
220+
static inline int nv_is_vma_write_locked(struct vm_area_struct *vma, unsigned int *mm_lock_seq)
221+
{
222+
#if defined(NV_IS_VMA_WRITE_LOCKED_HAS_MM_LOCK_SEQ_ARG)
223+
return __is_vma_write_locked(vma, mm_lock_seq);
224+
#else
225+
*mm_lock_seq = __vma_raw_mm_seqnum(vma);
226+
return __is_vma_write_locked(vma);
227+
#endif
228+
}
219229
#endif // !NV_CAN_CALL_VMA_START_WRITE
220230

221231
static inline void nv_vm_flags_set(struct vm_area_struct *vma, vm_flags_t flags)

kernel-open/common/inc/nvkms-kapi.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,17 @@ struct NvKmsKapiGpuInfo {
604604
MIGDeviceId migDevice;
605605
};
606606

607+
/*
608+
* Linux kernel options CONFIG_RANDSTRUCT_* randomize structs that are composed
609+
* entirely of function pointers, but can only control struct layout for sources
610+
* built by kbuild. NvKmsKapiCallbacks is shared between kbuild-built
611+
* nvidia-drm.ko, and the "OS-agnostic" portions of nvidia-modeset.ko (not built
612+
* by kbuild). Add a _padding member to disable struct randomization.
613+
*
614+
* Refer to https://github.com/NVIDIA/open-gpu-kernel-modules/issues/1033
615+
*/
607616
struct NvKmsKapiCallbacks {
617+
int _padding;
608618
void (*suspendResume)(NvBool suspend);
609619
void (*remove)(NvU32 gpuId);
610620
void (*probe)(const struct NvKmsKapiGpuInfo *gpu_info);

kernel-open/common/inc/nvtypes.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* SPDX-FileCopyrightText: Copyright (c) 1993-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
* SPDX-FileCopyrightText: Copyright (c) 1993-2026 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
@@ -514,6 +514,16 @@ typedef struct
514514
#define NV_DECLARE_ALIGNED(TYPE_VAR, ALIGN) __declspec(align(ALIGN)) TYPE_VAR
515515
#elif defined(__arm)
516516
#define NV_DECLARE_ALIGNED(TYPE_VAR, ALIGN) __align(ALIGN) TYPE_VAR
517+
#endif
518+
519+
#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
520+
#define NV_ALIGNOF(type) _Alignof(type)
521+
#elif defined(__cplusplus) && (__cplusplus >= 201103L)
522+
#define NV_ALIGNOF(type) alignof(type)
523+
#elif defined(__GNUC__) || defined(__clang__)
524+
#define NV_ALIGNOF(type) __alignof__(type)
525+
#elif defined(_MSC_VER)
526+
#define NV_ALIGNOF(type) __alignof(type)
517527
#endif
518528

519529
/***************************************************************************\

kernel-open/conftest.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5117,6 +5117,26 @@ compile_test() {
51175117
compile_check_conftest "$CODE" "NV_DRM_CRTC_FUNCS_HAS_GET_VBLANK_TIMESTAMP" "" "types"
51185118
;;
51195119

5120+
is_vma_write_locked_has_mm_lock_seq_arg)
5121+
#
5122+
# Determine if __is_vma_write_locked() takes only a single
5123+
# 'struct vm_area_struct *' argument.
5124+
#
5125+
# Commit 22f7639f2f03 ("mm/vma: improve and document
5126+
# __is_vma_write_locked()") removed the 'unsigned int *mm_lock_seq'
5127+
# parameter in v7.0-rc1.
5128+
#
5129+
CODE="
5130+
#include <linux/mm.h>
5131+
#include <linux/mmap_lock.h>
5132+
int conftest_is_vma_write_locked_has_mm_lock_seq_arg(struct vm_area_struct *vma) {
5133+
unsigned int mm_lock_seq;
5134+
return __is_vma_write_locked(vma, &mm_lock_seq);
5135+
}"
5136+
5137+
compile_check_conftest "$CODE" "NV_IS_VMA_WRITE_LOCKED_HAS_MM_LOCK_SEQ_ARG" "" "types"
5138+
;;
5139+
51205140
# When adding a new conftest entry, please use the correct format for
51215141
# specifying the relevant upstream Linux kernel commit. Please
51225142
# avoid specifying -rc kernels, and only use SHAs that actually exist

kernel-open/nvidia-drm/nvidia-drm-gem-nvkms-memory.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -585,6 +585,14 @@ int nv_drm_gem_alloc_nvkms_memory_ioctl(struct drm_device *dev,
585585
allocParams.compressible = &p->compressible;
586586

587587
pMemory = nvKms->allocateMemory(nv_dev->pDevice, &allocParams);
588+
if (pMemory == NULL && (p->flags & NV_GEM_ALLOC_NO_SCANOUT)) {
589+
NV_DRM_DEV_LOG_INFO(
590+
nv_dev,
591+
"Failed to allocate NVKMS video memory for GEM object, trying to fall back to sysmem");
592+
allocParams.useVideoMemory = false;
593+
pMemory = nvKms->allocateMemory(nv_dev->pDevice, &allocParams);
594+
}
595+
588596
if (pMemory == NULL) {
589597
ret = -EINVAL;
590598
NV_DRM_DEV_LOG_ERR(nv_dev,

kernel-open/nvidia-uvm/uvm_gpu.c

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2921,7 +2921,7 @@ static NV_STATUS add_gpu(const NvProcessorUuid *gpu_uuid,
29212921
#if UVM_IS_CONFIG_HMM()
29222922
// HMM was disabled when first initialising the parent so we can't support
29232923
// it now. Tell the caller to retry with it disabled.
2924-
else if (!parent_gpu->devmem && enable_hmm) {
2924+
else if (!parent_gpu->devmem && enable_hmm && uvm_hmm_is_enabled_system_wide()) {
29252925
status = NV_ERR_BUSY_RETRY;
29262926
goto error;
29272927
}
@@ -3222,10 +3222,25 @@ uvm_gpu_phys_address_t uvm_gpu_peer_phys_address(uvm_gpu_t *owning_gpu, NvU64 ad
32223222
uvm_gpu_address_t uvm_gpu_peer_copy_address(uvm_gpu_t *owning_gpu, NvU64 address, uvm_gpu_t *accessing_gpu)
32233223
{
32243224
uvm_gpu_identity_mapping_t *gpu_peer_mapping;
3225+
const bool mig_peers_use_phys = uvm_gpus_are_smc_peers(owning_gpu, accessing_gpu) &&
3226+
accessing_gpu->parent->ce_phys_vidmem_write_supported;
32253227

3226-
if (accessing_gpu->parent->peer_copy_mode == UVM_GPU_PEER_COPY_MODE_PHYSICAL)
3228+
// MIG peers do not create peer vidmem mappings like other peers. They do
3229+
// create their vidmem identity mappings to cover all possible physical
3230+
// addresses, even those of other MIG peers.
3231+
// Use vidmem this identity mapping if CEs need to use virtual addresses.
3232+
if (uvm_gpus_are_smc_peers(owning_gpu, accessing_gpu) && !mig_peers_use_phys) {
3233+
uvm_gpu_phys_address_t phys_address = uvm_gpu_peer_phys_address(owning_gpu, address, accessing_gpu);
3234+
return uvm_gpu_address_virtual_from_vidmem_phys(accessing_gpu, phys_address.address);
3235+
}
3236+
3237+
// Use physical addresses for MIGs peers if CE allows it. Irespective of
3238+
// the peer copy mode.
3239+
if (accessing_gpu->parent->peer_copy_mode == UVM_GPU_PEER_COPY_MODE_PHYSICAL || mig_peers_use_phys)
32273240
return uvm_gpu_address_from_phys(uvm_gpu_peer_phys_address(owning_gpu, address, accessing_gpu));
32283241

3242+
// MIG peers do not create peer GPU mappings so it should never reach here.
3243+
UVM_ASSERT(!uvm_gpus_are_smc_peers(owning_gpu, accessing_gpu));
32293244
UVM_ASSERT(accessing_gpu->parent->peer_copy_mode == UVM_GPU_PEER_COPY_MODE_VIRTUAL);
32303245
gpu_peer_mapping = uvm_gpu_get_peer_mapping(accessing_gpu, owning_gpu->id);
32313246

kernel-open/nvidia/nv-mmap.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -957,15 +957,22 @@ void NV_API_CALL nv_set_safe_to_mmap_locked(
957957
}
958958

959959
#if !NV_CAN_CALL_VMA_START_WRITE
960+
961+
#if defined(VM_REFCNT_EXCLUDE_READERS_FLAG)
962+
#define NV_VMA_LOCK_OFFSET VM_REFCNT_EXCLUDE_READERS_FLAG
963+
#else
964+
#define NV_VMA_LOCK_OFFSET VMA_LOCK_OFFSET
965+
#endif
966+
960967
static NvBool nv_vma_enter_locked(struct vm_area_struct *vma, NvBool detaching)
961968
{
962-
NvU32 tgt_refcnt = VMA_LOCK_OFFSET;
969+
NvU32 tgt_refcnt = NV_VMA_LOCK_OFFSET;
963970
NvBool interrupted = NV_FALSE;
964971
if (!detaching)
965972
{
966973
tgt_refcnt++;
967974
}
968-
if (!refcount_add_not_zero(VMA_LOCK_OFFSET, &vma->vm_refcnt))
975+
if (!refcount_add_not_zero(NV_VMA_LOCK_OFFSET, &vma->vm_refcnt))
969976
{
970977
return NV_FALSE;
971978
}
@@ -995,7 +1002,7 @@ static NvBool nv_vma_enter_locked(struct vm_area_struct *vma, NvBool detaching)
9951002
if (interrupted)
9961003
{
9971004
// Clean up on error: release refcount and dep_map
998-
refcount_sub_and_test(VMA_LOCK_OFFSET, &vma->vm_refcnt);
1005+
refcount_sub_and_test(NV_VMA_LOCK_OFFSET, &vma->vm_refcnt);
9991006
rwsem_release(&vma->vmlock_dep_map, _RET_IP_);
10001007
return NV_FALSE;
10011008
}
@@ -1011,7 +1018,7 @@ void nv_vma_start_write(struct vm_area_struct *vma)
10111018
{
10121019
NvU32 mm_lock_seq;
10131020
NvBool locked;
1014-
if (__is_vma_write_locked(vma, &mm_lock_seq))
1021+
if (nv_is_vma_write_locked(vma, &mm_lock_seq))
10151022
return;
10161023

10171024
locked = nv_vma_enter_locked(vma, NV_FALSE);
@@ -1020,7 +1027,7 @@ void nv_vma_start_write(struct vm_area_struct *vma)
10201027
if (locked)
10211028
{
10221029
NvBool detached;
1023-
detached = refcount_sub_and_test(VMA_LOCK_OFFSET, &vma->vm_refcnt);
1030+
detached = refcount_sub_and_test(NV_VMA_LOCK_OFFSET, &vma->vm_refcnt);
10241031
rwsem_release(&vma->vmlock_dep_map, _RET_IP_);
10251032
WARN_ON_ONCE(detached);
10261033
}

0 commit comments

Comments
 (0)