penn-graphics-research / claymore

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Excutable issue with "cudaErrorInvalidDevice", any solution?

DrChiZhang opened this issue · comments

Try to run mgsp with single GPU, while report the following error

[Init -- Begin] Cuda
[InitInfo -- DevNum] Detected 1 CUDA Capable device(s)
[InitInfo -- DevNum] Prepare to use 1 device(s) in Multi-GPU test
[InitInfo -- Dev Property] GPU device 0 (0-th group on board)
global memory: 25390546944 bytes,
shared memory per block: 49152 bytes,
registers per SM: 65536,
Multi-Processor count: 84,
SM compute capabilities: 8.6.
[InitInfo -- stream] Create 32 streams for device 0
monotonic allocator alignment (Bytes): 512 size (MB): 2900.7
[InitInfo -- memory] device 0
free bytes/total bytes: 24332795904/25390546944,
pre-allocated size: 3041599488 bytes

    [Init] CudaContext 0
    [InitInfo -- Default Dev] Default context: 0

[Init -- End] == Finished 'Cuda' initialization

CUDA error at /home/chi/MyCode/GitHub/claymore/Library/MnSystem/Cuda/Cuda.h:73 code=101(cudaErrorInvalidDevice) "cudaSetDevice(dev_id)"

Any idea?

I could not test the multi-GPU version and therefore could not fix all issues MGSP has.

I guess it tries to set an device that does not exist. Anyways, if you don't have more than one GPU don't use MGSP but the single-GPU version.
If you have multiple GPUs you might want to fix the issues existing in MGSP.

Also you might want to take a look at my repository based on this one, which might contain some unmerged fixes:
https://github.com/OaSiS-Masterthesis/OaSiS/tree/dev

(In general though, after working a lot with this API, I suggest not using it, but instead search for alternatives. There are other GPU implementations for the material point method that are more stable and better commented and maintainable.)

thanks for your reply, with single GPU, my build is fine, while stop with the following screen print:
model constitutive[jfluid], file[two_dragons.sdf]
load grid size 77, 118, 401
[-9.545950, -14.752900, -87.934502] - [19.250000, 29.500000, 100.250000], scale 0.000013, parcount 608461, lsdx 0.250000, dx 0.003906
init 0-th model with 608461 particles

It then waits for key input.

It then waits for key input.

Would you please give me example? I am not familiar with this code.

I correct: It first loads the models, then waits for key input. Though loading the models should not take that long actually.

It's the main method in
https://github.com/penn-graphics-research/claymore/blob/master/Projects/GMPM/gmpm.cu

You are at the init_model call in parse_scene. Loading might take a while but not much actually (though depends on hardware and how you compiled it).
If the partio file for the model was created and filled, then the initialization is finished and the initialization of the next model starts.

After that then it wayts for key input (getchar).

I correct: It first loads the models, then waits for key input. Though loading the models should not take that long actually.

It's the main method in https://github.com/penn-graphics-research/claymore/blob/master/Projects/GMPM/gmpm.cu

You are at the init_model call in parse_scene. Loading might take a while but not much actually (though depends on hardware and how you compiled it). If the partio file for the model was created and filled, then the initialization is finished and the initialization of the next model starts.

After that then it wayts for key input (getchar).

thx, any input seem ok.

@Destranix Any suggestion for stable GPU-accelerated MPM or FLIP solver with active community?

I don't know, haven't searched for one since then. There are some though like https://github.com/kuiwuchn/GPUMPM but I didn't took a deeper look into it (the one linked though I remember having a good project structure but bad documentation).

Guess it might make sense to search through Github and also look at recent SIGGRAPH papers if there are any with public GPU implementation.

I don't know, haven't searched for one since then. There are some though like https://github.com/kuiwuchn/GPUMPM but I didn't took a deeper look into it (the one linked though I remember having a good project structure but bad documentation).

Guess it might make sense to search through Github and also look at recent SIGGRAPH papers if there are any with public GPU implementation.

thanks.