I am having trouble getting cuda support in blender. I have a nvidia gtx970 gpu and have configured my system the following way after looking at various online information.
Can anyone spot where my issue lies?
nixos-version:
19.09.2079.8731aaaf8b3 (Loris)
nvidia-smi:
Sun Feb 16 21:40:40 2020
+-----------------------------------------------------------------------------+
| NVIDIA-SMI 440.36 Driver Version: 440.36 CUDA Version: 10.2 |
|-------------------------------+----------------------+----------------------+
| GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC |
| Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. |
|===============================+======================+======================|
| 0 GeForce GTX 970 Off | 00000000:01:00.0 Off | N/A |
| 30% 30C P8 9W / 180W | 990MiB / 4039MiB | 0% Default |
+-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+
| Processes: GPU Memory |
| GPU PID Type Process name Usage |
|=============================================================================|
| 0 1037 G ...bppvdxn86lf8rv-xorg-server-1.20.5/bin/X 420MiB |
| 0 1617 G /run/current-system/sw/bin/kwin_x11 90MiB |
| 0 1619 G /run/current-system/sw/bin/krunner 2MiB |
| 0 1621 G /run/current-system/sw/bin/plasmashell 130MiB |
| 0 2340 G ...AAAAAAAAAAAAAAgAAAAAAAAA --shared-files 72MiB |
| 0 3929 G ...cker-5.16.5/libexec/kscreenlocker_greet 261MiB |
+-----------------------------------------------------------------------------+
configuration.nix:
{ config, pkgs, ... }:
let
unstableTarball =
fetchTarball https://github.com/NixOS/nixpkgs-channels/archive/nixos-unstable.tar.gz;
in
{
imports =
[ # Include the results of the hardware scan.
./hardware-configuration.nix
];
boot = {
loader = {
systemd-boot.enable = true;
efi.canTouchEfiVariables = true;
};
kernelParams = [
"amd_iommu=on"
];
kernelModules = [
"kvm-amd"
"vfio-pci"
"nvidia-uvm"
];
extraModprobeConfig = ''
options kvm ignore_msrs=1
options vfio_pci ids=1002:67df,1002:aaf0
'';
blacklistedKernelModules = [
"radeon" "amdgpu"
];
};
networking.hostName = "thorium"; # Define your hostname.
# networking.wireless.enable = true; # Enables wireless support via wpa_supplicant.
# The global useDHCP flag is deprecated, therefore explicitly set to false here.
# Per-interface useDHCP will be mandatory in the future, so this generated config
# replicates the default behaviour.
networking.useDHCP = false;
networking.bridges = {
br0 = { interfaces = [ "enp5s0" ];
};
};
# networking.interfaces.enp5s0.useDHCP = true;
networking.interfaces.br0.useDHCP = true;
## Internationalisation properties.
# i18n = {
# consoleFont = "Lat2-Terminus16";
# consoleKeyMap = "us";
# defaultLocale = "en_US.UTF-8";
# };
time.timeZone = "Europe/Oslo";
# List packages installed in system profile. To search, run:
# $ nix search wget
nixpkgs.config = {
allowUnfree = true;
packageOverrides = pkgs: {
unstable = import unstableTarball {
config = config.nixpkgs.config;
};
};
blender = {
cudaSupport = true;
};
unstable.blender = {
cudaSupport = true;
};
};
environment.systemPackages = with pkgs; [
pciutils
wget
# vim
(import ../../modules/vim.nix)
wireguard
google-chrome
virtmanager-qt
barrier
git
steam
## From unstable
unstable.blender
];
programs = {
vim.defaultEditor = true;
};
## SERVICES ##
nix.gc = {
automatic = true;
dates = "weekly";
options = "--delete-older-than 30d";
};
services.openssh = {
enable = true;
forwardX11 = true;
};
# Security config.
security.sudo.wheelNeedsPassword = false;
# Open ports in the firewall.
# networking.firewall.allowedTCPPorts = [ ... ];
# networking.firewall.allowedUDPPorts = [ ... ];
# Or disable the firewall altogether.
# networking.firewall.enable = false;
virtualisation.libvirtd = {
enable = true;
qemuOvmf = true;
qemuRunAsRoot = false;
onBoot = "ignore";
};
# Enable CUPS to print documents.
# services.printing.enable = true;
# Enable sound.
sound.enable = true;
hardware.pulseaudio.enable = true;
# Enable the X11 windowing system.
services.xserver.enable = true;
services.xserver.videoDrivers = [ "nvidia" ];
hardware.opengl.driSupport32Bit = true;
hardware.opengl.extraPackages32 = with pkgs.pkgsi686Linux; [ libva ];
hardware.pulseaudio.support32Bit = true;
# Enable the KDE Desktop Environment.
services.xserver.displayManager.sddm.enable = true;
services.xserver.desktopManager.plasma5.enable = true;
# Define a user account. Don't forget to set a password with âpasswdâ.
users.users = {
sjakkmarius = {
isNormalUser = true;
extraGroups = [ "wheel" "libvirtd" ];
openssh.authorizedKeys.keys = [ "ssh-rsa ..." ];
};
};
# This value determines the NixOS release with which your system is to be
# compatible, in order to avoid breaking some software such as database
# servers. You should change this only after NixOS release notes say you
# should.
system.stateVersion = "19.09"; # Did you read the comment?
}