Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CUDA 12.6 update 3 toolkit install overlay on Visual Studio 2022 #89

Open
obriensystems opened this issue Dec 24, 2024 · 0 comments
Open
Assignees

Comments

@obriensystems
Copy link
Member

obriensystems commented Dec 24, 2024

see ObrienlabsDev/cuda#1

on p1gen6
see
https://github.com/ObrienlabsDev/blog/wiki/CUDA-based-%E2%80%90-High-Performance-Computing-%E2%80%90-LLM-Training-%E2%80%90-Ground-to-GCP-Cloud-Hybrid#appendix-e-setup-a-workstation-with-nvidia-cuda

download
https://developer.nvidia.com/cuda-downloads?target_os=Windows&target_arch=x86_64&target_version=11&target_type=exe_local

cuda_12.6.3_561.17_windows.exe

image

check versions


micha@p1gen6 MINGW64 ~
$ nvidia-smi
Mon Dec 23 19:52:51 2024
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 561.17                 Driver Version: 561.17         CUDA Version: 12.6     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                  Driver-Model | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA RTX 3500 Ada Gene...  WDDM  |   00000000:01:00.0 Off |                  Off |
| N/A   62C    P3             26W /   80W |       0MiB /  12282MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|  No running processes found                                                             |
+-----------------------------------------------------------------------------------------+


PS C:\Users\mich> nvidia-smi
Mon Dec 23 19:53:30 2024
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 561.17                 Driver Version: 561.17         CUDA Version: 12.6     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                  Driver-Model | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA RTX 3500 Ada Gene...  WDDM  |   00000000:01:00.0 Off |                  Off |
| N/A   60C    P3             21W /   96W |       0MiB /  12282MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|  No running processes found                                                             |
+-----------------------------------------------------------------------------------------+

PS C:\Users\mich> nvcc --version
nvcc: NVIDIA (R) Cuda compiler driver
Copyright (c) 2005-2024 NVIDIA Corporation
Built on Wed_Oct_30_01:18:48_Pacific_Daylight_Time_2024
Cuda compilation tools, release 12.6, V12.6.85
Build cuda_12.6.r12.6/compiler.35059454_0

check path

$ echo $PATH
/c/Users/mich/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/mingw64/bin:/usr/bin:/c/Users/mich/bin:/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.6/bin:/c/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.6/libnvvp....

also copy v12.6 to /opt/CUDA

add env vars
CUDA_PATH=C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.6
CUDA_ENV=12.6

create a new project using the cuda 12.6 template in visual studio 2022

image

image

build and run via ide

image

run via cli

micha@p1gen6 MINGW64 /c/wse_github_vs/ObrienlabsDev/cuda/add_example (main)
$ ls
add_example/  add_example.sln  add_example.vcxproj  add_example.vcxproj.user  kernel.cu  x64/

micha@p1gen6 MINGW64 /c/wse_github_vs/ObrienlabsDev/cuda/add_example (main)
$ cd x64/Release/

micha@p1gen6 MINGW64 /c/wse_github_vs/ObrienlabsDev/cuda/add_example/x64/Release (main)
$ ls
add_example.exe*  add_example.exp  add_example.lib  add_example.pdb

micha@p1gen6 MINGW64 /c/wse_github_vs/ObrienlabsDev/cuda/add_example/x64/Release (main)
$ ./add_example.exe
{1,2,3,4,5} + {10,20,30,40,50} = {11,22,33,44,55}

updating vs

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant