Skip to content
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

cudaMallocAsync / cudaMalloc different behave on different driver version #293

Open
WilliamKyle opened this issue Aug 26, 2024 · 0 comments

Comments

@WilliamKyle
Copy link

Code

cudaMallocAsync

#include <cuda_runtime_api.h>

#include <iostream>

using namespace std;

int main(int argc, char *argv[]) {
    void *data;
    cudaStream_t stream_ = 0;
    for (size_t i = 0; i < 32; i++) {
        cudaError_t error = cudaMallocAsync(&data, 1024 * 1024 * 1024, stream_);
        cout << "Gpu use: " << (i + 1) << "G " << cudaGetErrorString(error) << endl;
    }
    getchar();
    return 0;
}

cudaMalloc

#include <cuda_runtime_api.h>

#include <iostream>

using namespace std;

int main(int argc, char *argv[]) {
    void *data;
    cudaStream_t stream_ = 0;
    for (size_t i = 0; i < 32; i++) {
        cudaError_t error = cudaMalloc(&data, 1024 * 1024 * 1024);
        cout << "Gpu use: " << (i + 1) << "G " << cudaGetErrorString(error) << endl;
    }
    getchar();
    return 0;
}

Driver Version 536.67

image

No Option CUDA - Sysmem Fallback Policy

image

cudaMallocAsync

image

cudaMalloc

image

Driver Version 551.61

image

Prefer System Fallback

image

cudaMallocAsync

image

cudaMalloc

image

Prefer No System Fallback

image

cudaMallocAsync

image

cudaMalloc

image

cudaMallocAsync has one more failure when get 12G on 551.61 with Prefer System Fallback

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants
@WilliamKyle and others