как установить cuda на windows 10

CUDA под Windows: советы в начале работы

Софт: Windows 7, 64bit; CUDA Toolkit 6.0; Microsoft Visual Studio 2008

Начал осваивать CUDA с чтения книги:

Сандерс Дж., Кэндрот Э. Технология CUDA в примерах. Введение в программирование графических процессоров. — М.: ДМК Пресс, 2013. — 232 с.: ил. — ISBN: 978-5-94074-504-4.

Что необходимо для работы с CUDA

Для работы с CUDA необходимо иметь:

Пункты 1-3 у меня были, включая компилятор из набора Visual Studio 2008.

CUDA Toolkit можно скачать здесь. Вместе с ним поставляются многочисленные примеры, которые находятся в папке

C:\ProgramData\NVIDIA Corporation\CUDA Samples\v6.0

В папке 0_Simple\template находится заготовка для стандартного CUDA-проекта.

Как создавать проекты CUDA в Visual Studio и запускать примеры из книги

В VS при создании нового проекта выбираем тип NVIDIA/CUDA 6.0 и из шаблонов: CUDA Runtime 6.0.

Сообщения об ошибках

В примере из Главы 4 «Вычисление фрактала Джулиа на GPU» (который, вообще говоря, называется множество Жюлиа), при компиляции появляются сообщения вида:

Для исправления нужно добавить квалификатор __device__ в конструктор структуры:

Решение проблемы «Видеодрайвер nVidia перестал отвечать и был успешно восстановлен»

Такое сообщение появилось у меня при выполнении примера «Вычисление фрактала Джулиа на GPU» (глава 4). Драйвер видеокарты стоял самый новый, конфликтов с предыдущими версиями драйвера не обнаружилось. Видеокарта работала штатно и не была перегрета. Тем не менее сообщение появлялось.

Обзор возможных способов решения этой проблемы приведен здесь. В моем случае помог следующий рецепт.

Необходимо настроить в системном реестре два параметра:

Желательно не отключать проверку ошибок, а увеличить время задержки, установив его равным 3-м или более секундам. Значение подбирается экспериментально: можно начать с 10, и постепенно уменьшать время задержки.

Изменения в реестре вступят в силу после перезагрузки системы.

В результате получим:

как установить cuda на windows 10. julia. как установить cuda на windows 10 фото. как установить cuda на windows 10-julia. картинка как установить cuda на windows 10. картинка julia. Софт: Windows 7, 64bit; CUDA Toolkit 6.0; Microsoft Visual Studio 2008

Читайте также

Комментарии

Дмитрий Храмов
Компьютерное моделирование и все, что с ним связано: сбор данных, их анализ, разработка математических моделей, софт для моделирования, визуализации и оформления публикаций. Ну и за жизнь немного.

Источник

CUDA и удалённый GPU

CUDA всем хороша, пока под рукой есть видеокарта от Nvidia. Но что делать, когда на любимом ноутбуке нет Nvidia видеокарты? Или нужно вести разработку в виртуальной машине?

Я постараюсь рассмотреть в этой статье такое решение, как фреймворк rCUDA (Remote CUDA), который поможет, когда Nvidia видеокарта есть, но установлена не в той машине, на которой предполагается запуск CUDA приложений. Тем, кому это интересно, добро пожаловать под кат.

rCUDA (Remote CUDA) — фреймворк, реализующий CUDA API, позволяющий использовать удалённую видеокарту. Находится в работоспособной бета-версии, доступен только под Linux. Основная цель rCUDA — полная совместимость с CUDA API, вам не нужно никак модифицировать свой код, достаточно задать специальные переменные среды.

Что такое rCUDA

rCUDA (Remote CUDA) — фреймворк, реализующий CUDA API, позволяющий использовать для CUDA вычислений видеокарту, расположенную на удалённой машине, не внося никаких изменений в ваш код. Разработан в политехническом университете Валенсии (rcuda-team).

Ограничения

На данный момент поддерживаются только GNU/Linux системы, однако разработчики обещают поддержку Windows в будущем. Текущая версия rCUDA, 18.03beta, совместима с CUDA 5-8, то есть CUDA 9 не поддерживается. Разработчиками заявлена полная совместимость с CUDA API, за исключением графики.

Возможные сценарии использования

Краткая инструкция

Тестовая конфигурация

Тестирование проводилось на следующей конфигурации:

Сервер:
Ubuntu 16.04, GeForce GTX 660

Клиент:
Виртуальная машина с Ubuntu 16.04 на ноутбуке без дискретной видеокарты.

Получение rCUDA

Cамый сложный этап. К сожалению, на данный момент единственный способ получить свой экземпляр этого фреймворка — заполнить соответствующую форму запроса на официальном сайте. Впрочем, разработчики обещают отвечать в течение 1-2 дней. В моём случае мне прислали дистрибутив в тот же день.

Установка CUDA

Важно! На клиенте следует отказаться от установки nvidia драйвера. По умолчанию CUDA Toolkit будет доступен по адресу /usr/local/cuda/. Установите CUDA Samples, они понадобятся.

Установка rCUDA

Распакуем полученный от разработчиков архив в нашу домашнюю директорию на сервере и на клиенте.

Проделать эти действия нужно как на сервере, так и на клиенте.

Запуск демона rCUDA на сервере

Настройка клиента

Откроем на клиенте терминал, в котором в дальнейшем будем запускать CUDA код. На стороне клиента нам необходимо «подменить» стандартные библиотеки CUDA на библиотеки rCUDA, для чего добавим соответствующие пути в переменную среды LD_LIBRARY_PATH. Также нам необходимо указать количество серверов и их адреса (в моём примере он будет один).

Сборка и запуск

Попробуем собрать и запустить несколько примеров.

Пример 1

Начнём с простого, с deviceQuery — примера, который просто выведет нам параметры CUDA совместимого устройства, то есть в нашем случае удалённого GTX660.

Важно! Без EXTRA_NVCCFLAGS=—cudart=shared чуда не получится
Замените на путь, который вы указали для CUDA Samples при установке CUDA.

Запустим собранный пример:

Если вы всё сделали правильно, результат будет примерно таким:

Самое главное, что мы должны увидеть:

Device0 = GeForce GTX 660
Result = PASS

Отлично! Нам удалось собрать и запустить CUDA приложение на машине без дискретной видеокарты, использовав для этого видеокарту, установленную на удалённом сервере.

Важно! Если вывод приложения начинается со строк вида:

значит необходимо добавить на сервере и на клиенте в файл «/etc/security/limits.conf» следующие строки:

Таким образом, вы разрешите всем пользователям (*) неограниченное (unlimited) блокирование памяти (memlock). Еще лучше будет заменить * на нужного пользователя, а вместо unlimited подобрать менее жирные права.

Пример 2

Теперь попробуем что-то поинтереснее. Протестируем реализацию скалярного произведения векторов с использованием разделяемой памяти и синхронизации («Технология CUDA в примерах» Сандерс Дж. Кэндрот Э. 5.3.1).

В данном примере мы рассчитаем скалярное произведение двух векторов размерностью 33 * 1024, сравнивая ответ с результатом, полученным на CPU.

Такой результат говорит нам, что всё у нас хорошо:

Пример 3

Запустим еще один стандартный тест CUDA- matrixMulCUBLAS (перемножение матриц).

[Matrix Multiply CUBLAS] — Starting…
GPU Device 0: «GeForce GTX 660» with compute capability 3.0

MatrixA(640,480), MatrixB(480,320), MatrixC(640,320)
Computing result using CUBLAS. done.
Performance= 436.24 GFlop/s, Time= 0.451 msec, Size= 196608000 Ops
Computing result using host CPU. done.
Comparing CUBLAS Matrix Multiply with CPU results: PASS

NOTE: The CUDA Samples are not meant for performance measurements. Results may vary when GPU Boost is enabled.

Performance= 436.24 GFlop/s,
Comparing CUBLAS Matrix Multiply with CPU results: PASS

Безопасность

Я не нашёл в документации к rCUDA упоминания о каком-либо способе авторизации. Думаю, на данный момент самое простое, что можно сделать, это открыть доступ к нужному порту (8308) только с определённого адреса.

При помощи iptables это будет выглядеть так:

В остальном оставляю вопрос безопасности за рамками данного поста.

Источник

Шпаргалка по установке CUDA, cuDNN, Tensorflow и PyTorch на Windows 10

В очередной раз после переустановки Windows осознал, что надо накатить драйвера, CUDA, cuDNN, Tensorflow/Keras для обучения нейронных сетей.

Каждый раз для меня это оказывается несложной, но времязатратной операцией: найти подходящую комбинацию Tensorflow/Keras, CUDA, cuDNN и Python несложно, но вспоминаю про эти зависимости только в тот момент, когда при импорте Tensorflow вижу, что видеокарта не обнаружена и начинаю поиск нужной страницы в документации Tensorflow.

В этот раз ситуация немного усложнилась. Помимо установки Tensorflow мне потребовалось установить PyTorch. Со своими зависимостями и поддерживаемыми версиями Python, CUDA и cuDNN.

По итогам нескольких часов экспериментов решил, что надо зафиксировать все полезные ссылки в одном посте для будущего меня.

Краткий алгоритм установки Tensorflow и PyTorch

Примечание: Установить Tensorflow и PyTorch можно в одном виртуальном окружении, но в статье этого алгоритма нет.

Подготовка к установке

Установка CUDA и cuDNN

Устанавливаем Tensorflow

Устанавливаем PyTorch

В моём случае заработала комбинация:

Tensorflow и PyTorch установлены в разных виртуальных окружениях.

Итого

Польза этой статьи будет понятна не скоро: систему переустанавливаю я не часто.

Если воспользуетесь этим алгоритмом и найдёте какие-то ошибки – пишите в комментарии

Источник

Как установить cuda на windows 10

The guide for using NVIDIA CUDA on Windows Subsystem for Linux.

1. Introduction

Windows Subsystem for Linux (WSL) is a Windows 10 feature that enables users to run native Linux command-line tools directly on Windows. WSL is a containerized environment within which users can run Linux native applications from the command line of the Windows 10 shell without requiring the complexity of a dual boot environment. Internally, WSL is tightly integrated with the Microsoft Windows operating system, which allows it to run Linux applications alongside traditional Windows desktop and modern store apps.

как установить cuda на windows 10. wsl launch upt 0625 rz. как установить cuda на windows 10 фото. как установить cuda на windows 10-wsl launch upt 0625 rz. картинка как установить cuda на windows 10. картинка wsl launch upt 0625 rz. Софт: Windows 7, 64bit; CUDA Toolkit 6.0; Microsoft Visual Studio 2008

With WSL 2 and GPU paravirtualization technology, Microsoft enables developers to run GPU accelerated applications on Windows. NVIDIA GPU acceleration will be available with official support on Pascal and later GeForce and Quadro GPUs in Windows Device Driver Model. However, we recommend using Turing or newer architectures for better performance.

The following document describes a workflow for getting started with running CUDA applications or containers in a WSL 2 environment.

2. Getting Started

Getting started with running CUDA on WSL requires you to complete these steps in order:

2.1. WSL 2 System Requirements

WSL 2 GPU acceleration will be available on Pascal and later GPU architecture on both GeForce and Quadro product SKUs in WDDM mode. It will not be available on Quadro GPUs in TCC mode or Tesla GPUs yet.

2.2. Installing Microsoft Windows Insider Preview OS Builds (only for Windows 10)

2.3. Installing NVIDIA Windows Drivers for CUDA, DirectX, and DirectML Support

Install the driver using the executable on the Windows machine. The Windows Display Driver will install both the regular driver components for native Windows and for WSL support. This is the only driver you need to install.

CUDA support enables GPU accelerated computing for data science, machine learning and inference solutions. DirectX support enables graphics on WSL 2 by supporting DX12 APIs. TensorFlow with DirectML support on WSL 2 will get NV GPU hardware acceleration for training and inference workloads.

2.4. Installing WSL 2 and Setting up a Linux Development Environment

2.5. Running CUDA Applications

Once you are on your favorite Linux distro through WSL 2, and after the NVIDIA Windows driver is installed there is nothing more to do to run existing CUDA applications that were built on Linux. Just run your CUDA app as you would run it under Linux!

CUDA support on WSL 2 allows you to run existing GPU accelerated Linux applications or containers almost seamlessly (see limitations here). But in order to build new applications CUDA Toolkit is needed.

2.6. Setting up CUDA Toolkit on WSL 2

In order to compile a CUDA application on WSL 2, you will have to install only the CUDA toolkit. We recommend either of the following two options for installing the CUDA Toolkit.

Installation of CUDA Toolkit using WSL-Ubuntu Package

It is recommended to use the Linux package manager to install the CUDA for the Linux distributions supported under WSL 2. CUDA Toolkit available for Linux distributions can be used for WSL 2 as well, but these toolkits come packaged with the NVIDIA GPU Linux driver which must not be installed. So care must be taken not to override the WSL 2 native drivers already installed in the system.

In order to ease the installation and not to accidentally override the Windows native WSL 2 driver already installed in the system, we have created a separate package under the category WSL-Ubuntu.

Follow the sample instructions below to install the CUDA Toolkit from the WSL-Ubuntu package found here on Ubuntu.

Note that we are installing CUDA because the WSL-ubuntu package only has the CUDA toolkit.

Installation of CUDA Toolkit using Meta Package

If you installed the toolkit using the WSL-Ubuntu package, please skip this section. In case you prefer to install CUDA toolkit from our regular package, note that for WSL 2, you should use the cuda-toolkit- meta-package to avoid installing the NVIDIA driver that is typically bundled with the toolkit.

You can also install other components of the toolkit by choosing the right meta-package.

2.7. Building CUDA Samples

2.8. Running CUDA Containers

2.8.1. Setup

2.8.2. Install Docker

Note that NVIDIA Container Toolkit has not yet been validated with Docker Desktop WSL 2 backend.

2.8.3. Install NVIDIA Container Toolkit

Install the NVIDIA Container Toolkit (previously known as nvidia-docker2). Official WSL 2 support is available starting with nvidia-docker2 v2.6.0 and the underlying runtime library ( libnvidia-container >= 1.5.1).

For brevity, the installation instructions provided here are for Ubuntu.

Set up the stable repositories and the GPG key. The changes to the runtime to support WSL 2 are available in the stable repositories.

Install the NVIDIA runtime packages (and their dependencies) after updating the package listing.

Open a separate WSL 2 window and start the Docker daemon again using the following commands to complete the installation.

In this section, we will walk through some examples of running containers in a WSL 2 environment.

2.8.4. Running Simple CUDA Containers

From the console, you should see output as shown below.

2.8.5. Jupyter Notebooks

After the container starts, you should see that everything is ready:

After the URL is available from the console output, input the URL into your browser to start developing with the Jupyter notebook. Ensure that you replace 127.0.0.1 with localhost in the URL when connecting to the Jupyter notebook from the browser. You should be able to view the TensorFlow tutorial in your browser. Choose any of the tutorials for this example.

Navigate to the Cell menu and select the Run All item, then check the log within the Jupyter notebook WSL 2 container to see the work accelerated by the GPU of your Windows PC.

2.8.6. Deep Learning Framework Containers

Get started quickly with AI training using pre-trained models available from NVIDIA and the NGC catalog. Follow the instructions in this post for more details.

As an example, let’s run a TensorFlow container to do a ResNet-50 training run using GPUs using the 20.03 container from NGC. This is done by launching the container and then running the training script from the nvidia-examples directory.

3. NVIDIA Compute Software Support Matrix for WSL 2

Nvidia-smi (Limited Feature Set)

R495 and later Windows production drivers will officially support WSL2 on Pascal and later GPUs.

For the latest features use WSL2 driver published on CUDA Developer Zone.

4. Known Limitations for Linux CUDA Applications

The following table lists the known limitations on WSL 2 that may affect CUDA applications that use some of these features that are fully supported on Linux.

UVM full features will not be available and therefore applications relying on UVM full features may not work.

If your application is using Managed Memory, your application could see reduced performance and high system memory usage.

Concurrent CPU/GPU access is not supported. CUDA queries will say whether it is supported or not and applications are expected to check this.

5. Features Not Yet Supported

The following table lists the set of features that are currently not supported.

6. Troubleshooting

6.1. Container Runtime Initialization Errors

This usually indicates that the right Windows OS build or Microsoft Windows Insider Preview Builds (Windows 10 only), WSL 2, NVIDIA drivers and NVIDIA Container Toolkit may not be installed correctly. Review the known issues and changelog sections to ensure the right versions of the driver and container toolkit are installed.

If you are still running into this issue, use the dxdiag tools from the Run dialog and provide the diagnostic logs to NVIDIA by posting in the Developer Forums or by filing a report.

You can also use the CUDA on WSL 2 Developer Forums to get in touch with NVIDIA product and engineering teams for help.

6.2. Checking WSL Kernel Version

как установить cuda на windows 10. wsl2 ubuntu lts. как установить cuda на windows 10 фото. как установить cuda на windows 10-wsl2 ubuntu lts. картинка как установить cuda на windows 10. картинка wsl2 ubuntu lts. Софт: Windows 7, 64bit; CUDA Toolkit 6.0; Microsoft Visual Studio 2008

7. Release Notes

7.1. 510.06

7.1.1. Changelog

7.1.2. New Features

The following new features are included in this release:

7.1.3. Resolved Issues

7.1.4. Known Limitations

7.1.5. Known Issues

» /usr/lib/wsl/lib » is not included in the WSL PATH environment for OS Win10 21H2 (19044.1200).

7.2. 471.21

Note that this message is an incorrect warning for WSL 2 and will be fixed in future releases of the DL Framework containers to correctly detect the NVIDIA GPUs. The DL Framework containers will still continue to be accelerated using CUDA on WSL 2.

7.3. 470.76

7.4. 470.14

7.5. 465.42

1/28/2021: CUDA Toolkit 11.2 support, nvidia-smi, NVML support and critical performance improvements.

The following software versions are supported with this preview release for WSL 2:

7.6. 465.21

The following software versions are supported with this preview release for WSL 2:

NVIDIA Driver for Windows 10: 465.21

7.7. 465.12

7.8. 460.20

7.9. 460.15

The following software versions are supported with this preview release for WSL 2:

7.10. 455.41

The following software versions are supported with this preview release for WSL 2:

7.11. 455.38

The following software versions are supported with this preview release for WSL 2:

Notices

Notice

This document is provided for information purposes only and shall not be regarded as a warranty of a certain functionality, condition, or quality of a product. NVIDIA Corporation (“NVIDIA”) makes no representations or warranties, expressed or implied, as to the accuracy or completeness of the information contained in this document and assumes no responsibility for any errors contained herein. NVIDIA shall have no liability for the consequences or use of such information or for any infringement of patents or other rights of third parties that may result from its use. This document is not a commitment to develop, release, or deliver any Material (defined below), code, or functionality.

NVIDIA reserves the right to make corrections, modifications, enhancements, improvements, and any other changes to this document, at any time without notice.

Customer should obtain the latest relevant information before placing orders and should verify that such information is current and complete.

NVIDIA products are sold subject to the NVIDIA standard terms and conditions of sale supplied at the time of order acknowledgement, unless otherwise agreed in an individual sales agreement signed by authorized representatives of NVIDIA and customer (“Terms of Sale”). NVIDIA hereby expressly objects to applying any customer general terms and conditions with regards to the purchase of the NVIDIA product referenced in this document. No contractual obligations are formed either directly or indirectly by this document.

NVIDIA products are not designed, authorized, or warranted to be suitable for use in medical, military, aircraft, space, or life support equipment, nor in applications where failure or malfunction of the NVIDIA product can reasonably be expected to result in personal injury, death, or property or environmental damage. NVIDIA accepts no liability for inclusion and/or use of NVIDIA products in such equipment or applications and therefore such inclusion and/or use is at customer’s own risk.

NVIDIA makes no representation or warranty that products based on this document will be suitable for any specified use. Testing of all parameters of each product is not necessarily performed by NVIDIA. It is customer’s sole responsibility to evaluate and determine the applicability of any information contained in this document, ensure the product is suitable and fit for the application planned by customer, and perform the necessary testing for the application in order to avoid a default of the application or the product. Weaknesses in customer’s product designs may affect the quality and reliability of the NVIDIA product and may result in additional or different conditions and/or requirements beyond those contained in this document. NVIDIA accepts no liability related to any default, damage, costs, or problem which may be based on or attributable to: (i) the use of the NVIDIA product in any manner that is contrary to this document or (ii) customer product designs.

No license, either expressed or implied, is granted under any NVIDIA patent right, copyright, or other NVIDIA intellectual property right under this document. Information published by NVIDIA regarding third-party products or services does not constitute a license from NVIDIA to use such products or services or a warranty or endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectual property rights of the third party, or a license from NVIDIA under the patents or other intellectual property rights of NVIDIA.

Reproduction of information in this document is permissible only if approved in advance by NVIDIA in writing, reproduced without alteration and in full compliance with all applicable export laws and regulations, and accompanied by all associated conditions, limitations, and notices.

THIS DOCUMENT AND ALL NVIDIA DESIGN SPECIFICATIONS, REFERENCE BOARDS, FILES, DRAWINGS, DIAGNOSTICS, LISTS, AND OTHER DOCUMENTS (TOGETHER AND SEPARATELY, “MATERIALS”) ARE BEING PROVIDED “AS IS.” NVIDIA MAKES NO WARRANTIES, EXPRESSED, IMPLIED, STATUTORY, OR OTHERWISE WITH RESPECT TO THE MATERIALS, AND EXPRESSLY DISCLAIMS ALL IMPLIED WARRANTIES OF NONINFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR PURPOSE. TO THE EXTENT NOT PROHIBITED BY LAW, IN NO EVENT WILL NVIDIA BE LIABLE FOR ANY DAMAGES, INCLUDING WITHOUT LIMITATION ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL, PUNITIVE, OR CONSEQUENTIAL DAMAGES, HOWEVER CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF ANY USE OF THIS DOCUMENT, EVEN IF NVIDIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. Notwithstanding any damages that customer might incur for any reason whatsoever, NVIDIA’s aggregate and cumulative liability towards customer for the products described herein shall be limited in accordance with the Terms of Sale for the product.

Источник

CUDA: Начало

как установить cuda на windows 10. cb82f262d3742c77aca8fc8b66d7f03e. как установить cuda на windows 10 фото. как установить cuda на windows 10-cb82f262d3742c77aca8fc8b66d7f03e. картинка как установить cuda на windows 10. картинка cb82f262d3742c77aca8fc8b66d7f03e. Софт: Windows 7, 64bit; CUDA Toolkit 6.0; Microsoft Visual Studio 2008
Это первая публикация из цикла статей об использовании GPGPU и nVidia CUDA. Планирую писать не очень объемно, чтобы не слишком утомлять читателей, но достаточно часто.

Я предполагаю, что читатель осведомлен, что такое CUDA, если нет, то вводную статью можно найти на Хабре.

Что потребуется для работы:

1. Видеокарта из серии nVidia GeForce 8xxx/9xxx или более современная
2. CUDA Toolkit v.2.1 (скачать можно здесь: www.nvidia.ru/object/cuda_get_ru.html)
3. CUDA SDK v.2.1 (скачать можно там же где Toolkit)
4. Visual Studio 2008
5. CUDA Visual Studio Wizard (скачать можно здесь: sourceforge.net/projects/cudavswizard)

Создание CUDA проекта:

После установки всего необходимого в VS появиться новый вид проекта для С++ с названием CU-DA WinApp, это именно то, что нам надо. В данном типе проекта доступны дополнительные на-стройки для CUDA, позволяющие настроить параметры компиляции под GPU, например версию Compute Capability в зависимости от типа GPU и т.д.
Обычно я создаю чистый проект (Empty Project), так как Precompiled Headers навряд ли пригодиться для CUDA.
Важно отметить, как собирается CUDA приложение. Файлы с расширением *.cpp обрабатываются компилятором MS C++ (cl.exe), а файлы c расширением *.cu компилятором CUDA (nvcc.exe), который в свою очередь определяет, какой код будет работать на GPU, а какой на CPU. Код из *.cu, работающий на CPU, передается на компиляцию MS C++, эту особенность удобно использовать для написания динамических библиотек, которые будут экспортировать функции, использующие для расчетов GPU.
Далее привожу листинг простой программы на CUDA, который выводит на экран информацию об аппаратных возможностях GPU.

Листинг. Программа CudaInfo.

int main()
<
int deviceCount;
cudaDeviceProp deviceProp;

//Сколько устройств CUDA установлено на PC.
cudaGetDeviceCount(&deviceCount);

for ( int i = 0; i //Получаем информацию об устройстве
cudaGetDeviceProperties(&deviceProp, i);

В программе я подключаю библиотеку “cuda_runtime_api.h”. Хотя это делать не обязательно, так она инклюдится автоматически, но без неё не будет работать IntelliSence (хотя все равно периодически косячит).

Заключение

Я думаю, что это самый простой способ для написания CUDA-программ, так как требуется минимум усилий для конфигурирования и настройки среды, единственная проблема только с использованием IntelliSence.
В следующий раз будет рассмотрено использование CUDA для математических вычислений и вопросы работы с память видеокарты.

Источник

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *