cudaMalloc最大能分配的显卡内存空间

luckyboy101 2010-05-04 12:40:19
cudaGetDeviceProperties(&prop, i)
cudaMalloc分配的显卡内存控件是不是不能超过prop.totalGlobalMem?
我的显卡最大显存大小(MB)256
...全文
559 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
cuda2010 2010-05-04
  • 打赏
  • 举报
回复
如果是cuda3.0,还可以使用cudaMemGetInfo(),更方便一点。
  • 打赏
  • 举报
回复
是物理内存大小.
但如果还要显示的话,一般还要减去128MB左右用于显示.
如故用cu(驱动层)api的话,还可以用以下函数:
cuMemGetInfo ( unsigned int * free,
unsigned int * total
)

Returns in *free and *total respectively, the free and total amount of memory available for allocation by the CUDA context, in bytes.


Parameters:
free - Returned free memory in bytes
total - Returned total memory in bytes

581

社区成员

发帖
与我相关
我的任务
社区描述
CUDA™是一种由NVIDIA推出的通用并行计算架构,该架构使GPU能够解决复杂的计算问题。 它包含了CUDA指令集架构(ISA)以及GPU内部的并行计算引擎。
社区管理员
  • CUDA编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧