Tuesday, May 12, 2009

bv2.co.uk » Blog Archive » Visual Studio 2008 and CUDA

CUDA with Visual Studio 2008

bv2.co.uk » Blog Archive » Visual Studio 2008 and CUDA

Visual Studio 2008 and CUDA

As promised I received my Visual Studio 2008 on Friday from polyhedron and set about installing it on Saturday. This post will describe how to get VS 2008 to work with CUDA. I use CUDA 2.2 which is still under NDA so I wont be making any comments about its performance improvements today. Rather I will describe how to set up syntax highlighting, building and Intellisense.

Visual Studio is now distributed in DVD format which makes the installation process much easier due to not having to swop disks every few minutes. The installation went smoothly and quickly as I had the prerequisites (.net etc) installed already. I usually install software on my D drive and it didn’t have any complaints or issues with that either.

I already had the CUDA 2.2 SDK and toolkit installed along with the 185 drivers so I could move directly to configuring my Visual Studio to use CUDA:

Syntax highlighting: By default a .cu file is displayed all in black which makes editing rather tricky. NVidia supply a usertype.dat file which you will find under: “NVIDIA Corporation\NVIDIA CUDA SDK\doc\syntax_highlighting\visual_studio_8″ copy this file to: “\Program Files\Microsoft Visual Studio 9.0\Common7\IDE”. Now open up Visual Studio and navigate to: tools->options->text editor->file extension. In the extension box type “cu”, make sure you select “Microsoft Visual C++” in the drop down and not the default of “Microsoft Visual C#”. If you do select the C# one they syntax highlighting will still work but you wont see all the “__syncthreads()” etc highlighted.

Building: This is rather simple to configure, you can either specify the standard “nvcc ” command line for each .cu file in your project by right clicking ->properties->custom build. A better solution is to select a custom build rule for your project by selecting “project -> custom build rules -> find existing”. Again NVidia supply a rules file which you will find under the “\NVIDIA Corporation\NVIDIA CUDA SDK\common” directory. Select this build rule in your project properties and it makes it much easier to configure options for your building of CUDA projects.

Intellisense: Getting intellisense to work on .cu and .cuh files proved to be the most tricky step. I don’t actually use it very much as I try and keep my code fairly simple but its still nice to have when you can’t remember parameters etc. Logically I thought by adding .cu to the file extensions lists in the options wherever there was .c,.cpp etc listed and by the step used in enabling syntax highlighting it would just magically work. Sadly this was not the case. I did find a suggestion on the web mentioning a process that would enable it but it seemed rather clumsy to me. It involves writing your CUDA code in a .c file and then just as you hit compile a pre-build step copies the .c file to a .cu extension. To me it seemed odd that the Intellisense would work with .c,.cpp,.h etc and not with .cu where it is clearly just a different extension but essentially C code. As I ran out of option dialogs in Visual Studio I decided to look in the registry. After about 15 minutes I found what turned out to be the key. The “fix” is really simple: open the registry editor and navigate to “HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\9.0\Languages\Language Services\C/C++” then go to the string entry “NCB Default C/C++ Extensions” and add “;.cu;.cuh” to the end of the list. Restart Visual Studio and Intellisense will work for your CUDA files. Keep in mind it doesnt know about CUDA specific extensions but will still help with all the normal C bits.

Saturday, February 28, 2009

Sony PS3Eye Camera DirectShow Capture Source Filter *Update* v2.1.0.0130 « AlexP’s Weblog

Sony PS3Eye Camera DirectShow Capture Source Filter *Update* v2.1.0.0130 « AlexP’s Weblog: "Manual removal of PS3Eye.ax and PS3EyeLib.dll files:

- Close any program that are using PS3Eye camera.
- Press ‘WinKey’+R on your keyboard or alternatively go to Start->Run
- Type the following: regsvr32 /u “C:\Program Files\AlexP\PS3Eye.ax”
- You will see the following dialog box confirming successful un-registration of the PS3Eye.ax file."

Monday, November 24, 2008

웹초보의 Tech 2.1 :: 윈도우의 아쉬운 2%를 채워주는 프리웨어 Top 10

웹초보의 Tech 2.1 :: 윈도우의 아쉬운 2%를 채워주는 프리웨어 Top 10
윈도우를 사용하다 보면 "아.. 이런 기능이 있었으면 좋을텐데.." 하고 아쉬워 할 때가 있는데요. 그럴때 그 아쉬움을 채워주는 유틸리티를 만나게 되면 마치 보석을 캔 것 같은 뿌듯함과 함께 컴퓨터 사용이 한층 즐거워집니다.

그 런 의미에서 제가 나름대로 "아쉬운 2%를 채워주는 중독성 강한 유틸리티 10종"을 뽑아봤습니다. (순전히 제 사용 경험에서 나온 것이니까 더 좋은 유틸리티가 있으면 댓글로 추천해 주세요. 당연히 이 포스트에 적극적으로 반영하겠습니다. 그리고 소개하는 것들 중 더 자세한 사용법이 궁금하신 분들은 문의해 주시고요. 미흡하지만 요청한 건에 한하여 자세한 사용법을 올리도록 노력하겠습니다..^^)

엠파스 블로그 - 세상과 맞닿은 나의공간

엠파스 블로그 - 세상과 맞닿은 나의공간
관리자 계정 이름 바꾸기

관리자 계정(Administrator)은 지울 수 없다. 그러나 이 계정 이름을 바꿀 수는 있다.
해킹을 당할 수도 있기 때문에 관리자 계정 이름을 바꾸는 것이 좋다.

1. 관리자로 로그인한다.
2. 제어판 - 관리도구 - 컴퓨터 관리 - 로컬 사용자와 그룹 - 사용자 선택하고 왼쪽 화면에서 Administrator 에 오른쪽 마우스를 눌러 내 이름으로 바꾼다.
제어판 - 사용자 계정 - 내 이름 계정에서 암호를 만든다.

자동 로그인 끄기, 켜기
시작-실행(R) 창에 다음을 써넣고 확인을 누른다.
control userpasswords2
'사용자 이름과 암호를 입력해야 이 컴퓨터를 사용할 수 있음'에 v표시를 하면 암호를 묻고
v표시를 없애면 자동로그인 한다.
http://qaos.com/article.php?sid=86 이 글을 보고 썼다.


파코즈에서 펐다.
컴퓨터관리 > 로컬 사용자와 그룹 > 사용자
에서 고칠 수 있습니다.
그리고 administrator ID 변경은
gpedit.msc > 컴퓨터 구성 > 보안 설정 > 로컬 정책 > 보안 옵션
>계정 : administrator 계정 이름 바꾸기


다른 방법
시작 > 실행 > regedit > 확인하면
레지스터편집기가 나옵니다.
여기서
HKEY_LOCAL_MACHINE -> SOFTWARE -> Microsoft -> Windows NT -> CurrentVersion으로 가시면
CurrentVersion 목록 중에
RegisteredOwner와 RegisteredOwner이란 게 있습니다.
RegisteredOrganization : 사용자 회사명
RegisteredOwner : 사용자 이름 입니다.
더블클릭하셔서 창이 하나 뜨면 거기서
값데이터를 사용하고 싶은 이름으로 바꾸시고 확인하시면 됩니다.
재부팅 하는 거 없구요..바로 바뀌고 사용가능합니다..
이상 허접팁이었습니다 ㅠ.ㅠ

Thursday, October 09, 2008

MS IT Academy Course

http://itastudentpass.microsoftelearning.com/

IT Academy Course: Database Developer
7698-SP2778-3898

IT Academy Course: Windows Developer
8515-SP5160-4914

IT Academy Course: Windows Server
8324-SP2274-5822

IT Academy Course: Web Developer
8291-SP2543-1195

IT Academy Course: Windows Client
6456-SP5347-9845