Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Add driver checks for CUDA 11.7, Add ccache support, cuSparse Fix #3257

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jun 6, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 34 additions & 35 deletions 69 CMakeModules/config_ccache.cmake
Original file line number Diff line number Diff line change
@@ -1,42 +1,41 @@
# picked up original content from https://crascit.com/2016/04/09/using-ccache-with-cmake/

if (UNIX)
find_program(CCACHE_PROGRAM ccache)
find_program(CCACHE_PROGRAM ccache)

set(CCACHE_FOUND OFF)
if(CCACHE_PROGRAM)
set(CCACHE_FOUND ON)
endif()
set(CCACHE_FOUND OFF)
if(CCACHE_PROGRAM)
set(CCACHE_FOUND ON)
endif()

option(AF_USE_CCACHE "Use ccache when compiling" ${CCACHE_FOUND})
option(AF_USE_CCACHE "Use ccache when compiling" ${CCACHE_FOUND})

if(${AF_USE_CCACHE})
# Set up wrapper scripts
set(C_LAUNCHER "${CCACHE_PROGRAM}")
set(CXX_LAUNCHER "${CCACHE_PROGRAM}")
set(NVCC_LAUNCHER "${CCACHE_PROGRAM}")
configure_file(${ArrayFire_SOURCE_DIR}/CMakeModules/launch-c.in launch-c)
configure_file(${ArrayFire_SOURCE_DIR}/CMakeModules/launch-cxx.in launch-cxx)
configure_file(${ArrayFire_SOURCE_DIR}/CMakeModules/launch-nvcc.in launch-nvcc)
execute_process(COMMAND chmod a+rx
"${ArrayFire_BINARY_DIR}/launch-c"
"${ArrayFire_BINARY_DIR}/launch-cxx"
"${ArrayFire_BINARY_DIR}/launch-nvcc"
)
if(CMAKE_GENERATOR STREQUAL "Xcode")
# Set Xcode project attributes to route compilation and linking
# through our scripts
set(CMAKE_XCODE_ATTRIBUTE_CC "${ArrayFire_BINARY_DIR}/launch-c")
set(CMAKE_XCODE_ATTRIBUTE_CXX "${ArrayFire_BINARY_DIR}/launch-cxx")
set(CMAKE_XCODE_ATTRIBUTE_LD "${ArrayFire_BINARY_DIR}/launch-c")
set(CMAKE_XCODE_ATTRIBUTE_LDPLUSPLUS "${ArrayFire_BINARY_DIR}/launch-cxx")
else()
# Support Unix Makefiles and Ninja
set(CMAKE_C_COMPILER_LAUNCHER "${ArrayFire_BINARY_DIR}/launch-c")
set(CMAKE_CXX_COMPILER_LAUNCHER "${ArrayFire_BINARY_DIR}/launch-cxx")
set(CUDA_NVCC_EXECUTABLE "${ArrayFire_BINARY_DIR}/launch-nvcc")
endif()
if(${AF_USE_CCACHE})
message(STATUS "ccache FOUND: ${CCACHE_PROGRAM}")
# Set up wrapper scripts
set(C_LAUNCHER "${CCACHE_PROGRAM}")
set(CXX_LAUNCHER "${CCACHE_PROGRAM}")
set(NVCC_LAUNCHER "${CCACHE_PROGRAM}")
configure_file(${ArrayFire_SOURCE_DIR}/CMakeModules/launch-c.in launch-c)
configure_file(${ArrayFire_SOURCE_DIR}/CMakeModules/launch-cxx.in launch-cxx)
configure_file(${ArrayFire_SOURCE_DIR}/CMakeModules/launch-nvcc.in launch-nvcc)
execute_process(COMMAND chmod a+rx
"${ArrayFire_BINARY_DIR}/launch-c"
"${ArrayFire_BINARY_DIR}/launch-cxx"
"${ArrayFire_BINARY_DIR}/launch-nvcc"
)
if(CMAKE_GENERATOR STREQUAL "Xcode")
# Set Xcode project attributes to route compilation and linking
# through our scripts
set(CMAKE_XCODE_ATTRIBUTE_CC "${ArrayFire_BINARY_DIR}/launch-c")
set(CMAKE_XCODE_ATTRIBUTE_CXX "${ArrayFire_BINARY_DIR}/launch-cxx")
set(CMAKE_XCODE_ATTRIBUTE_LD "${ArrayFire_BINARY_DIR}/launch-c")
set(CMAKE_XCODE_ATTRIBUTE_LDPLUSPLUS "${ArrayFire_BINARY_DIR}/launch-cxx")
else()
# Support Unix Makefiles and Ninja
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
set(CUDA_NVCC_EXECUTABLE ${CCACHE_PROGRAM} "${CUDA_NVCC_EXECUTABLE}")
endif()
mark_as_advanced(CCACHE_PROGRAM)
mark_as_advanced(AF_USE_CCACHE)
endif()
mark_as_advanced(CCACHE_PROGRAM)
mark_as_advanced(AF_USE_CCACHE)
2 changes: 1 addition & 1 deletion 2 src/backend/cuda/cusparseModule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ cusparseModule::cusparseModule()
#ifdef AF_cusparse_STATIC_LINKING
module(nullptr, nullptr)
#else
module("cusparse", nullptr)
module({"cusparse"}, {"64_11", "64_10", "64_9", "64_8"}, {""})
#endif
{
#ifdef AF_cusparse_STATIC_LINKING
Expand Down
19 changes: 11 additions & 8 deletions 19 src/backend/cuda/device_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ struct ToolkitDriverVersions {

// clang-format off
static const int jetsonComputeCapabilities[] = {
8070,
7020,
6020,
5030,
Expand All @@ -95,6 +96,7 @@ static const int jetsonComputeCapabilities[] = {

// clang-format off
static const cuNVRTCcompute Toolkit2MaxCompute[] = {
{11070, 8, 7, 0},
{11060, 8, 6, 0},
{11050, 8, 6, 0},
{11040, 8, 6, 0},
Expand Down Expand Up @@ -129,13 +131,14 @@ struct ComputeCapabilityToStreamingProcessors {
// clang-format off
static const ToolkitDriverVersions
CudaToDriverVersion[] = {
{11060, 510.39f, 511.23f},
{11050, 495.29f, 496.13f},
{11040, 470.42f, 471.11f},
{11030, 465.19f, 465.89f},
{11020, 460.27f, 460.82f},
{11010, 455.23f, 456.38f},
{11000, 450.51f, 451.48f},
{11070, 450.80f, 452.39f},
{11060, 450.80f, 452.39f},
{11050, 450.80f, 452.39f},
{11040, 450.80f, 452.39f},
{11030, 450.80f, 452.39f},
{11020, 450.80f, 452.39f},
{11010, 450.80f, 452.39f},
{11000, 450.36f, 451.22f},
{10020, 440.33f, 441.22f},
{10010, 418.39f, 418.96f},
{10000, 410.48f, 411.31f},
Expand All @@ -156,7 +159,7 @@ static ComputeCapabilityToStreamingProcessors gpus[] = {
{0x21, 48}, {0x30, 192}, {0x32, 192}, {0x35, 192}, {0x37, 192},
{0x50, 128}, {0x52, 128}, {0x53, 128}, {0x60, 64}, {0x61, 128},
{0x62, 128}, {0x70, 64}, {0x75, 64}, {0x80, 64}, {0x86, 128},
{-1, -1},
{0x87, 128}, {-1, -1},
};

// pulled from CUTIL from CUDA SDK
Expand Down
25 changes: 17 additions & 8 deletions 25 src/backend/opencl/device_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,20 +244,29 @@ DeviceManager::DeviceManager()
// Sort OpenCL devices based on default criteria
stable_sort(mDevices.begin(), mDevices.end(), compare_default);

auto devices = move(mDevices);
mDevices.clear();

// Create contexts and queues once the sort is done
for (int i = 0; i < nDevices; i++) {
cl_platform_id device_platform =
mDevices[i]->getInfo<CL_DEVICE_PLATFORM>();
devices[i]->getInfo<CL_DEVICE_PLATFORM>();
cl_context_properties cps[3] = {
CL_CONTEXT_PLATFORM, (cl_context_properties)(device_platform), 0};

mContexts.push_back(make_unique<Context>(*mDevices[i], cps));
mQueues.push_back(make_unique<CommandQueue>(
*mContexts.back(), *mDevices[i], cl::QueueProperties::None));
mIsGLSharingOn.push_back(false);
mDeviceTypes.push_back(getDeviceTypeEnum(*mDevices[i]));
mPlatforms.push_back(getPlatformEnum(*mDevices[i]));
try {
mContexts.push_back(make_unique<Context>(*devices[i], cps));
mQueues.push_back(make_unique<CommandQueue>(
*mContexts.back(), *devices[i], cl::QueueProperties::None));
mIsGLSharingOn.push_back(false);
mDeviceTypes.push_back(getDeviceTypeEnum(*devices[i]));
mPlatforms.push_back(getPlatformEnum(*devices[i]));
mDevices.emplace_back(std::move(devices[i]));
} catch (const cl::Error& err) {
AF_TRACE("Error creating context for device {} with error {}\n",
devices[i]->getInfo<CL_DEVICE_NAME>(), err.what());
}
}
nDevices = mDevices.size();

bool default_device_set = false;
deviceENV = getEnvVar("AF_OPENCL_DEFAULT_DEVICE");
Expand Down
2 changes: 1 addition & 1 deletion 2 src/backend/opencl/jit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ void evalNodes(vector<Param> &outputs, const vector<Node *> &output_nodes) {
uint out_elements = outDims[3] * out_info.strides[3];
uint groups = divup(out_elements, local_0);

global_1 = divup(groups, 1000) * local_1;
global_1 = divup(groups, work_group_size) * local_1;
global_0 = divup(groups, global_1) * local_0;

} else {
Expand Down
9 changes: 7 additions & 2 deletions 9 vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@
"cuda": {
"description": "Build CUDA backend",
"dependencies": [
"cuda",
"cudnn"
"cuda"
]
},
"opencl": {
Expand All @@ -55,6 +54,12 @@
"dependencies": [
"intel-mkl"
]
},
"cudnn": {
"description": "Build CUDA with support for cuDNN",
"dependencies": [
"cudnn"
]
}
},
"builtin-baseline": "14e7bb4ae24616ec54ff6b2f6ef4e8659434ea44"
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.