reading saved gpuArray data with a non-gpu computer

조회 수: 10 (최근 30일)
Adi Natan
Adi Natan 2015년 12월 21일
답변: Alison Eele 2019년 9월 19일
After some lengthy calculations using gpus in Matlab (2015b, cuda7), I have saves .mat files that have variables of class gpuArray. I wanted to further analyze them with my non gpu laptop and was underthe impression that a simple gather would work, but I was wrong. I get the following error:
>> gather(x)
Error using gpuArray/gather
Attempting to access the property or method of an invalid object.
I know I can first gather(x) and then save, I wanted to know how would one access data of class gpuArray that is saved in a mat file without have a gpu present?

채택된 답변

Joss Knight
Joss Knight 2015년 12월 23일
Unfortunately, this is not possible. To make data visible to a MATLAB that does not have Parallel Computing Toolbox, you must first gather it before calling save. Without PCT, MATLAB does not know how to construct a gpuArray from the saved data, hence the error you are seeing. With PCT but with no GPU device you will see a different error.
  댓글 수: 2
Adnan Hanif
Adnan Hanif 2016년 12월 1일
I think the question is how to access data of class gpuArray using a non-gpu computer but with PCT installed. Actually, I am also facing the same problem with same error coming up, and I am having PCT available but no gpu. So question is, are both PCT and gpu MUST be available on computer to access gpu-generated/saved mat file? If not, how to access it?
Joss Knight
Joss Knight 2016년 12월 21일
Yes, you must have both and there is no way to access it. You need to find out where the MAT file came from, and get whoever created it to store the data as a normal array not a gpuArray.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Alison Eele
Alison Eele 2019년 9월 19일
This is now possible from R2019b.
To quote from the gpuArray documentation:
"You can load MAT files containing gpuArray data as in-memory arrays when a GPU is not available. A gpuArray loaded without a GPU is limited and you cannot use it for computations. To use a gpuArray loaded without a GPU, retrieve the contents using gather."

카테고리

Help CenterFile Exchange에서 GPU Computing에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by