cuda 9.0安装错误:The driver installation is unable to locate the kernel source.

部署运行你感兴趣的模型镜像

安装cuda 9.0到阿里云ubunut 16.04总是报告错误,尝试了各种办法也无解:

Installing the NVIDIA display driver...
The driver installation is unable to locate the kernel source. Please make sure that the kernel source packages are installed and set up correctly.
If you know that the kernel source packages are installed and set up correctly, you may pass the location of the kernel source with the '--kernel-source-path' flag.

===========
= Summary =
===========

Driver:   Installation Failed
Toolkit:  Installation skipped
Samples:  Not Selected


Logfile is /tmp/cuda_install_24139.log
root@iZbp1hh9ibnz9gvys5xy8nZ:~# more /tmp/cuda_install_24139.log
Using more to view the EULA.

看看了日志“/tmp/cuda_install_24139.log”才知道是编译内核出错,根本不是找不到kernel source!!!

换了最新的cuda10就编译通过了,无fuck可说!

root@iZbp1hh9ibnz9gvys5xy8nZ:~# sh cuda_10.1.243_418.87.00_linux.run
===========
= Summary =
===========

Driver:   Installed
Toolkit:  Installed in /usr/local/cuda-10.1/
Samples:  Not Selected

Please make sure that
 -   PATH includes /usr/local/cuda-10.1/bin
 -   LD_LIBRARY_PATH includes /usr/local/cuda-10.1/lib64, or, add /usr/local/cuda-10.1/lib64 to /etc/ld.so.conf and run ldconfig as root

To uninstall the CUDA Toolkit, run cuda-uninstaller in /usr/local/cuda-10.1/bin
To uninstall the NVIDIA Driver, run nvidia-uninstall

Please see CUDA_Installation_Guide_Linux.pdf in /usr/local/cuda-10.1/doc/pdf for detailed information on setting up CUDA.
Logfile is /var/log/cuda-installer.log
root@iZbp1hh9ibnz9gvys5xy8nZ:~#

 

finally:

root@iZbp1hh9ibnz9gvys5xy8nZ:~# nvidia-smi
Sat Aug 31 23:52:06 2019
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 418.87.00    Driver Version: 418.87.00    CUDA Version: 10.1     |
|-------------------------------+----------------------+----------------------+
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|===============================+======================+======================|
|   0  Tesla P100-PCIE...  Off  | 00000000:00:08.0 Off |                    0 |
| N/A   29C    P0    25W / 250W |      0MiB / 16280MiB |      5%      Default |
+-------------------------------+----------------------+----------------------+

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

 

您可能感兴趣的与本文相关的镜像

PyTorch 2.7

PyTorch 2.7

PyTorch
Cuda

PyTorch 是一个开源的 Python 机器学习库,基于 Torch 库,底层由 C++ 实现,应用于人工智能领域,如计算机视觉和自然语言处理

在Unity中新建项目时遇到错误提示“Unable to locate any Features that satisfy the provide scope”,通常与Unity的依赖注入框架有关,特别是在使用Unity 5及以上版本时,如果配置或代码中存在不兼容的依赖关系,可能导致此类问题。 以下是可能的原因及解决方案: ### 1. 检查Unity容器的注册逻辑 确保所有需要注入的类型和接口都在Unity容器中正确注册。若某个类型没有被正确注册,或者其生命周期管理配置错误,可能会导致解析失败[^1]。例如: ```csharp container.RegisterType<IService, Service>(); ``` ### 2. 校验依赖项的作用域配置 该错误信息中的“provide scope”指的是依赖对象的作用域(如 `PerResolve`, `Singleton`, `InstancePerLifetimeScope` 等)。检查是否在注册时指定了不合理的作用域,或者在解析时未创建对应的作用域上下文[^1]。 例如,若使用了 `InstancePerLifetimeScope`,但未调用 `BeginLifetimeScope()`,则无法正确解析该依赖: ```csharp using (var scope = container.BeginLifetimeScope()) { var service = scope.Resolve<IService>(); } ``` ### 3. 更新Unity库版本 某些旧版本的Unity库(如Unity 4.x)可能存在与作用域相关的Bug。建议升级到最新稳定版本(如Unity 5.11以上),以修复潜在的问题[^1]。 ### 4. 清理并重新构建依赖树 有时项目中存在过期的DLL或缓存文件,可能导致依赖解析失败。尝试以下步骤: - 删除项目中的 `bin` 和 `obj` 文件夹。 - 清理NuGet缓存。 - 重新安装Unity及相关扩展包。 ### 5. 检查构造函数参数匹配 如果目标类的构造函数包含参数,而这些参数未在容器中注册或未通过 `WithParameter` 显式指定,则Unity无法完成依赖注入[^1]。例如: ```csharp container.RegisterType<IService, Service>(new InjectionConstructor("someValue")); ``` ### 6. 使用诊断工具排查问题 启用Unity的诊断日志功能,查看更详细的错误信息,有助于定位具体哪个组件未能正确注册或解析[^1]。 ---
评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值