“not a valid win32 program”怎麼解決?

mmjhuang 2012-06-25 08:39:55
最近攒了台机器,配置如下 xeon x5650 的 CPU,Quadro4000的GPU。 window7 64-bit的操作系统。装了visual studio2010。装了CUDA toolkit, CUDA SDK包, 也从NVDIA的网上下载安装了Fortran和C++的编译器(15天试用版的)。尝试用CUDA fortran,按F7进行编译时候会出现licence还剩余多少天的提示。编译生成的exe文件可以运行。但是当我改用CUDA C++时候,就不会出现剩余时间提示,虽然也能搞出个exe文件,但是运行该exe文件时候,就出错,出错提示是说“not a valid win32 application”。之前有朋友建议我将 platform 由win32 改成 x64, 也没用。谁知道这个问题怎么解决?
...全文
2394 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
whucv 2012-08-20
  • 打赏
  • 举报
回复
可能确实32位机和64位会出现不兼容情况
Win32 programs run in protected mode which is available since 80286. But 80286 is now history. So we only have to concern ourselves with 80386 and its descendants. Windows runs each Win32 program in separated virtual space. That means each Win32 program will have its own 4 GB address space. However, this doesn't mean every win32 program has 4GB of physical memory, only that the program can address any address in that range. Windows will do anything necessary to make the memory the program references valid. Of course, the program must adhere to the rules set by Windows, else it will cause the dreaded General Protection Fault. Each program is alone in its address space. This is in contrast to the situation in Win16. All Win16 programs can *see* each other. Not so under Win32. This feature helps reduce the chance of one program writing over other program's code/data. Memory model is also drastically different from the old days of the 16-bit world. Under Win32, we need not be concerned with memory model or segments anymore! There's only one memory model: Flat memory model. There's no more 64K segments. The memory is a large continuous space of 4 GB. That also means you don't have to play with segment registers. You can use any segment register to address any point in the memory space. That's a GREAT help to programmers. This is what makes Win32 assembly programming as easy as C. When you program under Win32, you must know some important rules. One such rule is that, Windows uses esi, edi, ebp and ebx internally and it doesn't expect the values in those registers to change. So remember this rule first: if you use any of those four registers in your callback function, don't ever forget to restore them before returning control to Windows. A callback function is your own function which is called by Windows. The obvious example is the windows procedure. This doesn't mean that you cannot use those four registers, you can. Just be sure to restore them back before passing control back to Windows.

231

社区成员

发帖
与我相关
我的任务
社区描述
CUDA on Windows XP
社区管理员
  • CUDA on Windows XP社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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