首页 > 其他分享 >CUDAbyExample环境搭建

CUDAbyExample环境搭建

时间:2023-02-16 20:03:38浏览次数:55  
标签:sudo 环境 dev installed apt packages com CUDAbyExample 搭建

git clone https://github.com/CodedK/CUDA-by-Example-source-code-for-the-book-s-examples-.git

首先是报错

nvcc -o ray ray.cu 
In file included from ../common/cpu_bitmap.h:20:0,
                 from ray.cu:19:
../common/gl_helper.h:44:21: fatal error: GL/glut.h: No such file or directory
 #include <GL/glut.h>

google后发现需要

sudo apt-get install  freeglut3-dev

然而出现众多依赖报错

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 freeglut3-dev : Depends: libgl1-mesa-dev but it is not going to be installed or
                          libgl-dev
                 Depends: libglu1-mesa-dev but it is not going to be installed or
                          libglu-dev
                 Depends: libxext-dev but it is not going to be installed
                 Depends: libxt-dev but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

尝试update,但遇到

Err:7 https://cli.github.com/packages stable InRelease                                                                             
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 23F3D4EA75716059

一共有两个key错误.按照这里提供的方法输入

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 23F3D4EA75716059

和另一个,另外一个解决,但这个仍然无法解决.根据这里提供的方法,输入

curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& sudo apt update \
&& sudo apt install gh -y

update的问题正常.似乎是密钥未注册.然而freeglut3-dev仍然不能安装,绷.

放弃unix,转向Windows.首先是报错

LINK : fatal error LNK1104: 无法打开文件“glut64.lib”

解决方法是将代码自带的lib文件夹下的glut64.lib复制到代码所在目录(作者你太贴心了).继续编译不会报错,但运行.exe文件时会提示找不到glut64.dll.经多方搜索,解决方法为在VS的bin目录下粘贴代码目录下的bin文件夹内的这个文件.目标目录为C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.26.28801\bin\Hostx64\x64\.注意可能随安装版本不同而有所变化.(PS:我不知道直接将glut64.dll复制到代码目录是否有用,或可一试)

标签:sudo,环境,dev,installed,apt,packages,com,CUDAbyExample,搭建
From: https://www.cnblogs.com/linxiaoshu/p/17128093.html

相关文章

  • springboot---多环境启动命令格式
    一、多环境命令启动maven插件中首先clean,再package打包,(修改字符集为UTF-8)使用cmd命令java-jars(Tab键自动补全) -spring.profiles.active=test启动项目  修改端......
  • windows环境下部署项目
    有些时候,我们的项目不得不用windows服务器部署,但是需要注意的是,windows服务是无法开启多进程处理请求的。本文介绍如何在windows上部署flask项目,应用 apache+mod-wsgi......
  • 阿里云 cloud linux 2 搭建LNMP环境
    2023年2月16日15:38:38官方说明: https://www.alibabacloud.com/help/zh/elastic-compute-service/latest/manually-deploy-an-lnmp-environment-on-an-ecs-instance-tha......
  • PowerAutomate 流程中如何使用环境变量
    因为我们需要把一些密钥保护起来,所以如果用环境变量就很方便。这个需要新建一个solution,然后在里面定义环境变量。在流程中,可以这么使用你还可以设置这个组件,保护输入......
  • postman-增加全局环境变量
    varjsonData=pm.response.json();varaccessTokenForMip=jsonData.data.access_token;//tests[accessTokenForMip]=true;pm.globals.set("accessTokenForMip",......
  • 【IMX6ULL】一、Linux开发环境搭建
    注:参考【正点原子】I.MX6U嵌入式Linux驱动开发指南V1.6一、Ubuntu和Windows文件互传在开发的过程中会频繁的在Windows和Ubuntu下进行文件传输,比如在Windwos下进......
  • 直播app开发搭建,js对时间日期判断今天昨天明天
    直播app开发搭建,js对时间日期判断今天昨天明天lettime=function(date){lettime_str="";if(newDate(date).getDate()===newDate().getDate()){time_str="......
  • docker-compose搭建redis-Cluster集群
    环境选择三台机器创建相同目录级:/database/redis/在目录里创建文件:viredis-cluster.tmpl查看防火墙--如果防火墙的状态是打开的记得开端口文件配置redis-clust......
  • hadoop+hive+mysql+sqoop+spark完全分布式集群搭建
    hadoop+hive+mysql+sqoop+spark完全分布式集群搭建零、配置网络(固定ip)(可以不做,但是后面关闭后ip会重复变动,后面步骤中有再次提到,后面操作在做)1.固定ip因centos 7 ip......
  • BOA服务器的搭建以及移植到开发板
    一、概述硬件资源:IAC-335X-Kit开发板宿主机:ubuntu16.04交叉编译工具:arm-arago-linux-gnueabi二、BOA搭建先确定交叉编译工具是否安装正确。安装需要工具bison,flexsudo......