diff --git a/Samples/7_libNVVM/README.md b/Samples/7_libNVVM/README.md index 09fbe98c..fdeee769 100644 --- a/Samples/7_libNVVM/README.md +++ b/Samples/7_libNVVM/README.md @@ -71,7 +71,7 @@ A Note About the cuda-c-linking Sample This sample requires a development package (or locally-built) LLVM library between versions 7 to 14 inclusive. LLVM 15 defaults to using opaque pointers, -which are currently not supported in libNVVM. +which are not supported in libNVVM for pre-Blackwell architectures. The LLVM_HOME environment variable is required for users who wish to build the cuda-c-linking sample and have a locally built copy of LLVM that they wish to diff --git a/Samples/7_libNVVM/cuda-c-linking/CMakeLists.txt b/Samples/7_libNVVM/cuda-c-linking/CMakeLists.txt index 072b6aa5..0a6dea2e 100644 --- a/Samples/7_libNVVM/cuda-c-linking/CMakeLists.txt +++ b/Samples/7_libNVVM/cuda-c-linking/CMakeLists.txt @@ -1,4 +1,4 @@ -# Copyright (c) 1993-2023, NVIDIA CORPORATION. All rights reserved. +# Copyright (c) 1993-2025, NVIDIA CORPORATION. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -29,7 +29,7 @@ if (LLVM_PACKAGE_VERSION VERSION_GREATER_EQUAL "15" OR LLVM_PACKAGE_VERSION VERSION_LESS "7") message(STATUS "The cuda-c-linking sample is expected to build with " "LLVM development libraries v7 to v14, opaque pointers are " - "not yet supported in libNVVM.") + "not supported in libNVVM for pre-Blackwell architectures.") return() endif () diff --git a/Samples/7_libNVVM/cuda-c-linking/cuda-c-linking.cpp b/Samples/7_libNVVM/cuda-c-linking/cuda-c-linking.cpp index 3717c413..de7d1be1 100644 --- a/Samples/7_libNVVM/cuda-c-linking/cuda-c-linking.cpp +++ b/Samples/7_libNVVM/cuda-c-linking/cuda-c-linking.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 1993-2023, NVIDIA CORPORATION. All rights reserved. +// Copyright (c) 1993-2025, NVIDIA CORPORATION. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions @@ -216,8 +216,8 @@ int main(int argc, char **argv) checkCudaErrors(cuDeviceGetAttribute(&devMajor, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, device)); checkCudaErrors(cuDeviceGetAttribute(&devMinor, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, device)); outs() << "Device Compute Capability: " << devMajor << "." << devMinor << "\n"; - if (devMajor < 5) { - errs() << "ERROR: Device 0 is not sm_50 or later.\n"; + if (devMajor < 7 && devMinor < 5) { + errs() << "ERROR: Device 0 is not sm_75 or later.\n"; return 1; } diff --git a/Samples/7_libNVVM/device-side-launch/dsl.c b/Samples/7_libNVVM/device-side-launch/dsl.c index 17cfe835..3dbce390 100644 --- a/Samples/7_libNVVM/device-side-launch/dsl.c +++ b/Samples/7_libNVVM/device-side-launch/dsl.c @@ -1,4 +1,4 @@ -// Copyright (c) 2014-2023, NVIDIA CORPORATION. All rights reserved. +// Copyright (c) 2014-2025, NVIDIA CORPORATION. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions @@ -181,8 +181,8 @@ static CUdevice cudaDeviceInit(int *major, int *minor) checkCudaErrors(cuDeviceGetAttribute(major, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, cuDevice)); checkCudaErrors(cuDeviceGetAttribute(minor, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, cuDevice)); printf("compute capability = %d.%d\n", *major, *minor); - if (*major < 5) { - fprintf(stderr, "Device 0 is not sm_50 or later\n"); + if (*major < 7 && *minor < 5) { + fprintf(stderr, "Device 0 is not sm_75 or later\n"); exit(EXIT_FAILURE); } return cuDevice; diff --git a/Samples/7_libNVVM/ptxgen/README.md b/Samples/7_libNVVM/ptxgen/README.md index 8d838d29..d4ee4257 100644 --- a/Samples/7_libNVVM/ptxgen/README.md +++ b/Samples/7_libNVVM/ptxgen/README.md @@ -22,6 +22,6 @@ interleaved. For example, - $ ptxgen a.ll -arch=compute_50 b.bc + $ ptxgen a.ll -arch=compute_75 b.bc -links a.ll and b.bc, and generates PTX code for the compute_50 architecture. +links a.ll and b.bc, and generates PTX code for the compute_75 architecture. diff --git a/Samples/7_libNVVM/simple/simple.c b/Samples/7_libNVVM/simple/simple.c index 58c31d5b..12b8dcc2 100644 --- a/Samples/7_libNVVM/simple/simple.c +++ b/Samples/7_libNVVM/simple/simple.c @@ -1,4 +1,4 @@ -// Copyright (c) 1993-2023, NVIDIA CORPORATION. All rights reserved. +// Copyright (c) 1993-2025, NVIDIA CORPORATION. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions @@ -74,8 +74,8 @@ static CUdevice cudaDeviceInit(int *devMajor, int *devMinor) // Obtain the device's compute capability. checkCudaErrors(cuDeviceGetAttribute(devMajor, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, cuDevice)); - if (*devMajor < 5) { - fprintf(stderr, "Device 0 is not sm_50 or later\n"); + if (*devMajor < 7 && *devMinor < 5) { + fprintf(stderr, "Device 0 is not sm_75 or later\n"); exit(EXIT_FAILURE); } checkCudaErrors(cuDeviceGetAttribute(devMinor, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, cuDevice)); diff --git a/Samples/7_libNVVM/uvmlite/uvmlite.c b/Samples/7_libNVVM/uvmlite/uvmlite.c index f977e092..cfe61cd9 100644 --- a/Samples/7_libNVVM/uvmlite/uvmlite.c +++ b/Samples/7_libNVVM/uvmlite/uvmlite.c @@ -1,4 +1,4 @@ -// Copyright (c) 2014-2023, NVIDIA CORPORATION. All rights reserved. +// Copyright (c) 2014-2025, NVIDIA CORPORATION. All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions @@ -172,8 +172,8 @@ static CUdevice cudaDeviceInit(int *major, int *minor) checkCudaErrors(cuDeviceGetAttribute(major, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MAJOR, cuDevice)); checkCudaErrors(cuDeviceGetAttribute(minor, CU_DEVICE_ATTRIBUTE_COMPUTE_CAPABILITY_MINOR, cuDevice)); printf("compute capability = %d.%d\n", *major, *minor); - if (*major < 5) { - fprintf(stderr, "Device 0 is not sm_50 or later\n"); + if (*major < 7 && *minor < 5) { + fprintf(stderr, "Device 0 is not sm_75 or later\n"); exit(EXIT_FAILURE); }